From eea3cc7ad167d2f53bee0a1e5d301f62802cbd12 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:41:37 +0800 Subject: [PATCH 001/119] [Build]: only install grpc in amd64 (#10212) [Build]: only install grpc in amd64 Unblock marvell-armhf build. --- files/build_templates/sonic_debian_extension.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 991b838a6d23..6cafa76014d1 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -131,8 +131,10 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install psutil sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install ipaddr # Install Python module for grpcio and grpcio-toole -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.39.0" -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.39.0" +if [[ $CONFIGURED_ARCH == amd64 ]]; then + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.39.0" + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.39.0" +fi # Install SwSS SDK Python 3 package # Note: the scripts will be overwritten by corresponding Python 2 package From 3fa627f290bf1d04a11aa13118bbbff57058bea3 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Mon, 14 Mar 2022 18:09:20 +0800 Subject: [PATCH 002/119] Add a config variable to override default container registry instead of dockerhub. (#10166) * Add variable to reset default docker registry * fix bug in docker version control --- Makefile.work | 9 +++++++-- dockers/docker-base-bullseye/Dockerfile.j2 | 7 ++++--- dockers/docker-base-buster/Dockerfile.j2 | 7 ++++--- dockers/docker-base-stretch/Dockerfile.j2 | 7 ++++--- dockers/docker-base/Dockerfile.j2 | 7 ++++--- dockers/docker-ptf/Dockerfile.j2 | 7 ++++--- dockers/docker-sonic-mgmt/Dockerfile.j2 | 3 ++- rules/config | 3 +++ scripts/docker_version_control.sh | 6 ++++-- slave.mk | 3 +++ sonic-slave-bullseye/Dockerfile.j2 | 11 ++++++----- sonic-slave-buster/Dockerfile.j2 | 9 +++++---- sonic-slave-jessie/Dockerfile.j2 | 7 ++++--- sonic-slave-stretch/Dockerfile.j2 | 7 ++++--- 14 files changed, 58 insertions(+), 35 deletions(-) diff --git a/Makefile.work b/Makefile.work index 39879110d4e8..8042de7d198b 100644 --- a/Makefile.work +++ b/Makefile.work @@ -115,6 +115,10 @@ rules/config.user: 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 endif @@ -139,9 +143,9 @@ $(shell SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ scripts/generate_buildinfo_config.sh) # Generate the slave Dockerfile, and prepare build info for it -$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) +$(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 scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV)) +$(shell BUILD_SLAVE=y DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) 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-* src/sonic-build-hooks/hooks/* | sha1sum | awk '{print substr($$1,0,11);}') @@ -291,6 +295,7 @@ SONIC_BUILD_INSTRUCTION := make \ 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) \ ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \ SLAVE_DIR=$(SLAVE_DIR) \ ENABLE_AUTO_TECH_SUPPORT=$(ENABLE_AUTO_TECH_SUPPORT) \ diff --git a/dockers/docker-base-bullseye/Dockerfile.j2 b/dockers/docker-base-bullseye/Dockerfile.j2 index 3ac14a4841c4..1b33003ce0a9 100644 --- a/dockers/docker-base-bullseye/Dockerfile.j2 +++ b/dockers/docker-base-bullseye/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" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-bullseye +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-bullseye +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:bullseye +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:bullseye {% endif %} # Clean documentation in FROM image diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index ac3fd7743e77..e16a0f677b07 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" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-buster +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-buster {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-buster +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-buster {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:buster +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:buster {% endif %} # Clean documentation in FROM image diff --git a/dockers/docker-base-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2 index b77814bb2820..5603dc502792 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" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:stretch +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:stretch {% endif %} # Clean documentation in FROM image diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index 616a4cde7aff..15df3fe8a754 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-jessie {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-jessie {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:jessie +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:jessie {% endif %} ## Remove retired jessie-updates repo diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index b152e94e99b0..d999d01e0026 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {% else %} -FROM debian:buster +FROM {{ prefix }}debian:buster {% endif %} MAINTAINER Pavel Shirshov diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 8349df8e439f..df26f2ccf38c 100755 --- 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 diff --git a/rules/config b/rules/config index c7ffbcaa4510..fe5d7ac3e991 100644 --- a/rules/config +++ b/rules/config @@ -211,3 +211,6 @@ INCLUDE_MUX = y # ENABLE_ASAN - enable address sanitizer ENABLE_ASAN ?= n + +# reset default container registry from dockerhub to other +DEFAULT_CONTAINER_REGISTRY ?= diff --git a/scripts/docker_version_control.sh b/scripts/docker_version_control.sh index 595477c859c6..da8cd0484f49 100755 --- a/scripts/docker_version_control.sh +++ b/scripts/docker_version_control.sh @@ -16,6 +16,8 @@ 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:` @@ -25,7 +27,7 @@ if [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,all,* ]] || [[ ",$SONIC_VERSION exit 0 fi if [ -f $version_file ];then - hash_value=`grep "${ARCH}:${image_tag}" $version_file | awk -F== '{print$2}'` + hash_value=`grep "${ARCH}:${image_tag_noprefix}" $version_file | awk -F== '{print$2}'` fi if [ -z $hash_value ];then hash_value=unknown @@ -43,5 +45,5 @@ else fi fi if [[ "$hash_value" != "unknown" ]];then - echo -e "${ARCH}:${image_tag}==$hash_value" >> $new_version_file + echo -e "${ARCH}:${image_tag_noprefix}==$hash_value" >> $new_version_file fi diff --git a/slave.mk b/slave.mk index 66831571aa7d..0bd81ff371a7 100644 --- a/slave.mk +++ b/slave.mk @@ -130,6 +130,8 @@ 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 ifeq ($(SONIC_ENABLE_PFCWD_ON_START),y) ENABLE_PFCWD_ON_START = y @@ -326,6 +328,7 @@ $(info "PDDF_SUPPORT" : "$(PDDF_SUPPORT)") $(info "MULTIARCH_QEMU_ENVIRON" : "$(MULTIARCH_QEMU_ENVIRON)") $(info "SONIC_VERSION_CONTROL_COMPONENTS": "$(SONIC_VERSION_CONTROL_COMPONENTS)") $(info "ENABLE_ASAN" : "$(ENABLE_ASAN)") +$(info "DEFAULT_CONTAINER_REGISTRY" : "$(SONIC_DEFAULT_CONTAINER_REGISTRY)") ifeq ($(CONFIGURED_PLATFORM),vs) $(info "BUILD_MULTIASIC_KVM" : "$(BUILD_MULTIASIC_KVM)") endif diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index dc6ba779e264..a75cef0b680e 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -1,13 +1,14 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu -FROM multiarch/debian-debootstrap:armhf-bullseye +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin {%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu -FROM multiarch/debian-debootstrap:arm64-bullseye +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin {%- else -%} -FROM debian:bullseye +FROM {{ prefix }}debian:bullseye {%- endif %} MAINTAINER gulv@microsoft.com diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 715ad8e19057..fa8ac44f1b9e 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -1,11 +1,12 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/qemu-user-static:x86_64-arm-5.0.0-2 as qemu -FROM multiarch/debian-debootstrap:armhf-buster +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" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-buster +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-buster {%- else -%} -FROM debian:buster +FROM {{ prefix }}debian:buster {%- endif %} MAINTAINER gulv@microsoft.com diff --git a/sonic-slave-jessie/Dockerfile.j2 b/sonic-slave-jessie/Dockerfile.j2 index 2eaa306cdce4..1d98e6d9b6c5 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 diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index d9528f67d02a..ad13ed0c124a 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {%- else -%} -FROM debian:stretch +FROM {{ prefix }}debian:stretch {%- endif %} MAINTAINER gulv@microsoft.com From 2919b4820f95bd49ceb579986f5c58b4e3532c6e Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:45:27 +0200 Subject: [PATCH 003/119] [hostcfgd] record feature state in STATE DB (#9842) - Why I did it To implement blocking feature state change. - How I did it Record the actual feature state in STATE DB from hostcfg. - How to verify it UT + verification by running on the switch and checking STATE DB. Signed-off-by: Stepan Blyschak --- files/image_config/monit/container_checker | 13 +++---- src/sonic-host-services/scripts/hostcfgd | 39 ++++++++++++++----- .../tests/hostcfgd/hostcfgd_radius_test.py | 1 + .../tests/hostcfgd/hostcfgd_tacacs_test.py | 3 +- .../tests/hostcfgd/hostcfgd_test.py | 24 ++++++++++-- 5 files changed, 59 insertions(+), 21 deletions(-) diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker index 197e4f04a499..a67a96a0c18c 100755 --- a/files/image_config/monit/container_checker +++ b/files/image_config/monit/container_checker @@ -32,7 +32,7 @@ def get_expected_running_containers(): 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 + @return: A set which contains the expected running containers and a set that has containers marked as "always_enabled". """ config_db = swsssdk.ConfigDBConnector() @@ -82,7 +82,7 @@ def get_current_running_from_DB(always_running_containers): state_db = swsscommon.DBConnector("STATE_DB", 0) tbl = swsscommon.Table(state_db, "FEATURE") if not tbl.getKeys(): - return False, None + return running_containers for name in tbl.getKeys(): data = dict(tbl.get(name)[1]) @@ -101,7 +101,7 @@ def get_current_running_from_DB(always_running_containers): print("Failed to get container '{}'. Error: '{}'".format(name, err)) pass - return True, running_containers + return running_containers def get_current_running_from_dockers(): @@ -128,13 +128,12 @@ 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() + current_running_containers = get_current_running_from_DB(always_running_containers) + current_running_containers.update(get_current_running_from_dockers()) return current_running_containers diff --git a/src/sonic-host-services/scripts/hostcfgd b/src/sonic-host-services/scripts/hostcfgd index 9b39fb5eb807..be8317259e38 100755 --- a/src/sonic-host-services/scripts/hostcfgd +++ b/src/sonic-host-services/scripts/hostcfgd @@ -12,7 +12,7 @@ import signal import jinja2 from sonic_py_common import device_info from swsscommon.swsscommon import SubscriberStateTable, DBConnector, Select -from swsscommon.swsscommon import ConfigDBConnector, TableConsumable +from swsscommon.swsscommon import ConfigDBConnector, TableConsumable, Table # FILE PAM_AUTH_CONF = "/etc/pam.d/common-auth-sonic" @@ -41,6 +41,7 @@ RADIUS_PAM_AUTH_CONF_DIR = "/etc/pam_radius_auth.d/" # MISC Constants CFG_DB = "CONFIG_DB" +STATE_DB = "STATE_DB" HOSTCFGD_MAX_PRI = 10 # Used to enforce ordering b/w daemons under Hostcfgd DEFAULT_SELECT_TIMEOUT = 1000 @@ -166,16 +167,23 @@ class FeatureHandler(object): SYSTEMD_SYSTEM_DIR = '/etc/systemd/system/' SYSTEMD_SERVICE_CONF_DIR = os.path.join(SYSTEMD_SYSTEM_DIR, '{}.service.d/') - def __init__(self, config_db, device_config): + # Feature state constants + FEATURE_STATE_ENABLED = "enabled" + FEATURE_STATE_DISABLED = "disabled" + FEATURE_STATE_FAILED = "failed" + + def __init__(self, config_db, feature_state_table, device_config): self._config_db = config_db + self._feature_state_table = feature_state_table self._device_config = device_config self._cached_config = {} self.is_multi_npu = device_info.is_multi_npu() def handle(self, feature_name, op, feature_cfg): if not feature_cfg: - self._cached_config.pop(feature_name) syslog.syslog(syslog.LOG_INFO, "Deregistering feature {}".format(feature_name)) + self._cached_config.pop(feature_name) + self._feature_state_table._del(feature_name) return feature = Feature(feature_name, feature_cfg, self._device_config) @@ -253,7 +261,6 @@ class FeatureHandler(object): return True def update_feature_auto_restart(self, feature, feature_name): - dir_name = self.SYSTEMD_SERVICE_CONF_DIR.format(feature_name) auto_restart_conf = os.path.join(dir_name, 'auto_restart.conf') @@ -341,8 +348,11 @@ class FeatureHandler(object): except Exception as err: syslog.syslog(syslog.LOG_ERR, "Feature '{}.{}' failed to be enabled and started" .format(feature.name, feature_suffixes[-1])) + self.set_feature_state(feature, self.FEATURE_STATE_FAILED) return + self.set_feature_state(feature, self.FEATURE_STATE_ENABLED) + def disable_feature(self, feature): cmds = [] feature_names, feature_suffixes = self.get_feature_attribute(feature) @@ -363,11 +373,17 @@ class FeatureHandler(object): except Exception as err: syslog.syslog(syslog.LOG_ERR, "Feature '{}.{}' failed to be stopped and disabled" .format(feature.name, feature_suffixes[-1])) + self.set_feature_state(feature, self.FEATURE_STATE_FAILED) return + self.set_feature_state(feature, self.FEATURE_STATE_DISABLED) + def resync_feature_state(self, feature): self._config_db.mod_entry('FEATURE', feature.name, {'state': feature.state}) + def set_feature_state(self, feature, state): + self._feature_state_table.set(feature.name, [('state', state)]) + class Iptables(object): def __init__(self): @@ -914,14 +930,14 @@ class NtpCfg(object): new_src = data.get('src_intf', '') new_src_set = set(new_src.split(";")) new_vrf = data.get('vrf', '') - + # Update the Local Cache self.ntp_global = data # check if ntp server configured, if not, do nothing if not self.ntp_servers: syslog.syslog(syslog.LOG_INFO, "No ntp server when global config change, do nothing") - return + return if orig_src_set != new_src_set: syslog.syslog(syslog.LOG_INFO, "ntp global update for source intf old {} new {}, restarting ntp-config" @@ -957,6 +973,7 @@ class HostConfigDaemon: self.config_db = ConfigDBConnector() self.config_db.connect(wait_for_init=True, retry_on=True) self.dbconn = DBConnector(CFG_DB, 0) + self.state_db_conn = DBConnector(STATE_DB, 0) self.selector = Select() syslog.syslog(syslog.LOG_INFO, 'ConfigDB connect success') @@ -964,6 +981,8 @@ class HostConfigDaemon: self.callbacks = dict() self.subscriber_map = dict() + feature_state_table = Table(self.state_db_conn, 'FEATURE') + # Load DEVICE metadata configurations self.device_config = {} self.device_config['DEVICE_METADATA'] = self.config_db.get_table('DEVICE_METADATA') @@ -976,7 +995,7 @@ class HostConfigDaemon: self.iptables = Iptables() # Intialize Feature Handler - self.feature_handler = FeatureHandler(self.config_db, self.device_config) + self.feature_handler = FeatureHandler(self.config_db, feature_state_table, self.device_config) self.feature_handler.sync_state_field() # Initialize Ntp Config Handler @@ -987,7 +1006,7 @@ class HostConfigDaemon: # Initialize AAACfg self.hostname_cache="" self.aaacfg = AaaCfg() - + def load(self): aaa = self.config_db.get_table('AAA') @@ -1004,7 +1023,7 @@ class HostConfigDaemon: self.hostname_cache = dev_meta['localhost']['hostname'] except Exception as e: pass - + # Update AAA with the hostname self.aaacfg.hostname_update(self.hostname_cache) @@ -1130,7 +1149,7 @@ class HostConfigDaemon: self.subscribe('VLAN_SUB_INTERFACE', lambda table, key, op, data: self.vlan_sub_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) self.subscribe('PORTCHANNEL_INTERFACE', lambda table, key, op, data: self.portchannel_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) self.subscribe('INTERFACE', lambda table, key, op, data: self.phy_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - + syslog.syslog(syslog.LOG_INFO, "Waiting for systemctl to finish initialization") self.wait_till_system_init_done() diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py index 4e3d18648100..9738f16852e5 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py @@ -36,6 +36,7 @@ hostcfgd.SubscriberStateTable = MockSubscriberStateTable hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector +hostcfgd.Table = mock.Mock() class TestHostcfgdRADIUS(TestCase): diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py index 3cc3504d606b..18bf5c17e6c2 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py @@ -35,6 +35,7 @@ hostcfgd.SubscriberStateTable = MockSubscriberStateTable hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector +hostcfgd.Table = mock.Mock() class TestHostcfgdTACACS(TestCase): """ @@ -44,7 +45,7 @@ def run_diff(self, file1, file2): return subprocess.check_output('diff -uR {} {} || true'.format(file1, file2), shell=True) """ - Check different config + Check different config """ def check_config(self, test_name, test_data, config_name): t_path = templates_path diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py index bbce866e2331..db9a35075a02 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py @@ -27,20 +27,23 @@ hostcfgd.SubscriberStateTable = MockSubscriberStateTable hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector +hostcfgd.Table = mock.Mock() class TestHostcfgd(TestCase): """ Test hostcfd daemon - feature """ - def __verify_table(self, table, expected_table): + def __verify_table(self, table, feature_state_table, expected_table): """ verify config db tables - Compares Config DB table (FEATURE) with expected output table + Compares Config DB table (FEATURE) with expected output table. + Verifies that State DB table (FEATURE) is updated. Args: table(dict): Current Config Db table + feature_state_table(Mock): Mocked State DB FEATURE table expected_table(dict): Expected Config Db table Returns: @@ -48,6 +51,19 @@ def __verify_table(self, table, expected_table): """ ddiff = DeepDiff(table, expected_table, ignore_order=True) print('DIFF:', ddiff) + + def get_state(cfg_state): + """ Translates CONFIG DB state field into STATE DB state field """ + if cfg_state == 'always_disabled': + return 'disabled' + elif cfg_state == 'always_enabled': + return 'enabled' + else: + return cfg_state + + feature_state_table.set.assert_has_calls([ + mock.call(feature, [('state', get_state(table[feature]['state']))]) for feature in table + ]) return True if not ddiff else False def __verify_fs(self, table): @@ -93,6 +109,7 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): fs.add_real_paths(swsscommon_package.__path__) # add real path of swsscommon for database_config.json fs.create_dir(hostcfgd.FeatureHandler.SYSTEMD_SYSTEM_DIR) MockConfigDb.set_config_db(test_data['config_db']) + feature_state_table_mock = mock.Mock() with mock.patch('hostcfgd.subprocess') as mocked_subprocess: popen_mock = mock.Mock() attrs = test_data['popen_attributes'] @@ -102,7 +119,7 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): # Initialize Feature Handler device_config = {} device_config['DEVICE_METADATA'] = MockConfigDb.CONFIG_DB['DEVICE_METADATA'] - feature_handler = hostcfgd.FeatureHandler(MockConfigDb(), device_config) + feature_handler = hostcfgd.FeatureHandler(MockConfigDb(), feature_state_table_mock, device_config) # sync the state field and Handle Feature Updates feature_handler.sync_state_field() @@ -113,6 +130,7 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): # Verify if the updates are properly updated assert self.__verify_table( MockConfigDb.get_config_db()['FEATURE'], + feature_state_table_mock, test_data['expected_config_db']['FEATURE'] ), 'Test failed for test data: {0}'.format(test_data) mocked_subprocess.check_call.assert_has_calls(test_data['expected_subprocess_calls'], any_order=True) From 330eb8dda9e4ce276e50e9d3d3fcf8cb90d89fb0 Mon Sep 17 00:00:00 2001 From: Song Yuan <64041228+ysmanman@users.noreply.github.com> Date: Mon, 14 Mar 2022 11:24:26 -0700 Subject: [PATCH 004/119] update submodule sonic-py-swsssdk (#10220) --- src/sonic-py-swsssdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 7cd7e0c1580d..24366480c213 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 7cd7e0c1580d15c341160c68b73fd7d948e9fd24 +Subproject commit 24366480c213893388766a3b0dd3c492b9c04b8f From d7c3ce00454682cc9c5b6b7a5d56dd82384f4536 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 14 Mar 2022 11:34:02 -0700 Subject: [PATCH 005/119] Specify the filesystem type when mounting to /host (#10169) When mounting the partition that contains `/host` during initramfs, the mount binary available there (coming from busybox) tries each filesystem in `/proc/filesystems` and sees which one succeeds. During this time, there may be some error messages logged into dmesg because some of the incorrect filesystems failed to mount the partition. Specify the filesystem type explicitly so that initramfs knows it's that type, and we know what filesystem will always get used there. Fixes #9998 Signed-off-by: Saikrishna Arcot --- files/initramfs-tools/union-mount.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/initramfs-tools/union-mount.j2 b/files/initramfs-tools/union-mount.j2 index c680e69300d1..7a64f71d70bb 100644 --- a/files/initramfs-tools/union-mount.j2 +++ b/files/initramfs-tools/union-mount.j2 @@ -132,7 +132,7 @@ case "${ROOT}" in ;; *) ## Mount the raw partition again - mount ${ROOT} ${rootmnt}/host + mount -t ext4 ${ROOT} ${rootmnt}/host ;; esac From 0243ed95387792635edcde3800633f610df35204 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 15 Mar 2022 10:03:54 +0800 Subject: [PATCH 006/119] [build]: Fix marvell-armhf build hung issue (#10156) (#10229) Why I did it The marvel-armhf build is hung, it does not exit after waiting for a long time. It is caused by the process /etc/entropy.py which is started by the postinst script in target/debs/buster/sonic-platform-nokia-7215_1.0_armhf.deb --- files/build_templates/sonic_debian_extension.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 6cafa76014d1..455179c08029 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -652,6 +652,11 @@ fi {% if installer_images.strip() -%} ## 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 LANG=C DOCKER_HOST="$DOCKER_HOST" chroot $FILESYSTEM_ROOT docker info From 286ff289f56835117e8890014e41f5cc16f27e4d Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Tue, 15 Mar 2022 14:47:36 +0800 Subject: [PATCH 007/119] [sonic-config-engine] Add failure details in sonic-config-engine unit test. (#10210) --- src/sonic-config-engine/tests/test_j2files.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index eb002720d98d..b922ae45dbcf 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -1,4 +1,3 @@ -import filecmp import json import os import shutil @@ -110,7 +109,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 utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_l2switch_template(self): argument = '-k Mellanox-SN2700 --preset l2 -p ' + self.t0_port_config @@ -211,7 +210,7 @@ def test_qos_arista7050_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self): arista_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'arista', 'x86_64-arista_7800r3_48cq2_lc', 'Arista-7800R3-48CQ2-C48') @@ -235,7 +234,7 @@ def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self): os.remove(cfg_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, sample_output_file) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_qos_dell9332_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32') @@ -254,7 +253,7 @@ def test_qos_dell9332_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell9332.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) 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') @@ -273,7 +272,7 @@ def test_qos_dell6100_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell6100.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected): dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) @@ -293,7 +292,7 @@ def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer os.remove(buffers_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, expected) - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_buffers_dell6100_render_template(self): 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') @@ -313,7 +312,7 @@ def test_ipinip_multi_asic(self): print(argument) self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'multi_npu_data', utils.PYvX_DIR, 'ipinip.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_swss_switch_render_template(self): switch_template = os.path.join( @@ -342,7 +341,7 @@ def test_swss_switch_render_template(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_swss_switch_render_template_multi_asic(self): # verify the ECMP hash seed changes per namespace @@ -374,7 +373,7 @@ def test_swss_switch_render_template_multi_asic(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) os.environ["NAMESPACE_ID"] = "" def test_ndppd_conf(self): From 18d00dfbe70d1dba75e2c534585879944b4e9230 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:20:36 +0200 Subject: [PATCH 008/119] [teamd.sh] kill teamd docker on warm shutdown for faster shutdown (#10219) This can save 6 sec for teamd LAG restoration - the time between: ``` Mar 9 13:51:10.467757 r-panther-13 WARNING teamd#teamd_PortChannel1[28]: Got SIGUSR1. Mar 9 13:52:33.310707 r-panther-13 INFO teamd#teamd_PortChannel1[27]: carrier changed to UP ``` - Why I did it Optimize warm boot. Specifically reduce the time needed for LAG restoration. - How I did it Kill teamd docker after graceful shutdown of teamd processes. - How to verify it Run warm reboot. Signed-off-by: Stepan Blyschak --- files/scripts/teamd.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/scripts/teamd.sh b/files/scripts/teamd.sh index 57b70913e917..4de3f25c4dbd 100755 --- a/files/scripts/teamd.sh +++ b/files/scripts/teamd.sh @@ -93,13 +93,17 @@ stop() { # 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 -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..." } From d08add5523096bd40a880724dded9fe2d0e923ed Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Tue, 15 Mar 2022 21:40:55 +0800 Subject: [PATCH 009/119] [submodule] Update sonic-swss submodule pointer (#10209) Update sonic-swss with the following changes: 29d5d8da Use abort instead of exit in case calling SAI API failure (#2170) 12f980c8 Fix issue config qos reload causing orchagent aborted via tracking dependencies among QoS tables (#2116) 6e5ed1c0 [chassis][syncd][sai] Adjusting response timeout during syncd init (#2159) 0a99f546 Try get port operational speed from STATE DB (#2119) 828cccfe [crm] Use sai_object_type_get_availability() API to get counters (#2098) 18c73a19 Allow IPv4 link-local nexthops (#1903) Signed-off-by: Stephen Sun --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 7d2942f7ef4a..00266891a9f4 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 7d2942f7ef4ac01209582c02d142bd131208b2a4 +Subproject commit 00266891a9f41e5bd37100b05237e865cde429b2 From 5a531f4eb24edf0caca47edcf0d5a2c73e0e63d4 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:21:50 -0400 Subject: [PATCH 010/119] [Nokia][VoQ] The role of the Inband port should be "Inb" and recycle port (#9950) Signed-off-by: mlok --- .../Nokia-IXR7250E-36x400G/0/port_config.ini | 3 ++- .../Nokia-IXR7250E-36x400G/1/port_config.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini index 8d017026081c..3633842330f8 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini @@ -17,4 +17,5 @@ Ethernet14 24,25,26,27,28,29,30,31 Ethernet14 15 Eth14 Ethernet15 16,17,18,19,20,21,22,23 Ethernet15 16 Eth15-ASIC0 Ext 400000 0 16 8 Ethernet16 8,9,10,11,12,13,14,15 Ethernet16 17 Eth16-ASIC0 Ext 400000 0 17 8 Ethernet17 0,1,2,3,4,5,6,7 Ethernet17 18 Eth17-ASIC0 Ext 400000 0 18 8 -Ethernet-IB0 115 Ethernet-IB0 37 Rcy-ASIC0 Int 10000 0 19 8 +Ethernet-IB0 115 Ethernet-IB0 37 Rcy1-ASIC0 Inb 10000 0 19 8 +Ethernet-Rec0 116 Ethernet-Rec0 39 Rcy2-ASIC0 Rec 10000 1 20 8 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini index 76fd968fec28..90376150d657 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini @@ -17,4 +17,5 @@ Ethernet32 24,25,26,27,28,29,30,31 Ethernet32 33 Eth14 Ethernet33 16,17,18,19,20,21,22,23 Ethernet33 34 Eth15-ASIC1 Ext 400000 0 16 8 Ethernet34 8,9,10,11,12,13,14,15 Ethernet34 35 Eth16-ASIC1 Ext 400000 0 17 8 Ethernet35 0,1,2,3,4,5,6,7 Ethernet35 36 Eth17-ASIC1 Ext 400000 0 18 8 -Ethernet-IB1 115 Ethernet-IB1 38 Rcy-ASIC1 Int 10000 0 19 8 +Ethernet-IB1 115 Ethernet-IB1 38 Rcy1-ASIC1 Inb 10000 0 19 8 +Ethernet-Rec1 116 Ethernet-Rec1 40 Rcy2-ASIC1 Rec 10000 1 20 8 From 28f6a51d26af0a744ab5194bd8a8101953ce1304 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 15 Mar 2022 10:26:36 -0700 Subject: [PATCH 011/119] [doc] Moving Configuration.md from swss to sonic-yang-models folder (#10078) #### Why I did it Moved Configuration.md from swss to yang folder. The configuration schema should be present along with yang models and when users add yang model they could update configuration document as well. --- src/sonic-yang-models/doc/Configuration.md | 1540 ++++++++++++++++++++ 1 file changed, 1540 insertions(+) create mode 100644 src/sonic-yang-models/doc/Configuration.md diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md new file mode 100644 index 000000000000..b5890681ce41 --- /dev/null +++ b/src/sonic-yang-models/doc/Configuration.md @@ -0,0 +1,1540 @@ +# SONiC Configuration Database Manual + +Table of Contents +================= + + * [Introduction](#introduction) + * [Configuration](#configuration) + * [Config Load and Save](#config-load-and-save) + * [Incremental Configuration](#incremental-configuration) + * [Redis and Json Schema](#redis-and-json-schema) + * [ACL and Mirroring](#acl-and-mirroring) + * [BGP Sessions](#bgp-sessions) + * [BUFFER_PG](#buffer_pg) + * [Buffer pool](#buffer-pool) + * [Buffer profile](#buffer-profile) + * [Buffer queue](#buffer-queue) + * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) + * [Buffer port egress profile list](#buffer-port-egress-profile-list) + * [Cable length](#cable-length) + * [COPP_TABLE](#copp_table) + * [CRM](#crm) + * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) + * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) + * [Device Metadata](#device-metadata) + * [Device neighbor metada](#device-neighbor-metada) + * [DSCP_TO_TC_MAP](#dscp_to_tc_map) + * [FLEX_COUNTER_TABLE](#flex_counter_table) + * [L2 Neighbors](#l2-neighbors) + * [Loopback Interface](#loopback-interface) + * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) + * [Management Interface](#management-interface) + * [Management port](#management-port) + * [Management VRF](#management-vrf) + * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) + * [NTP Global Configuration](#ntp-global-configuration) + * [NTP and SYSLOG servers](#ntp-and-syslog-servers) + * [Policer](#policer) + * [Port](#port) + * [Port Channel](#port-channel) + * [Portchannel member](#portchannel-member) + * [Scheduler](#scheduler) + * [Port QoS Map](#port-qos-map) + * [Queue](#queue) + * [Tacplus Server](#tacplus-server) + * [TC to Priority group map](#tc-to-priority-group-map) + * [TC to Queue map](#tc-to-queue-map) + * [Versions](#versions) + * [VLAN](#vlan) + * [VLAN_MEMBER](#vlan_member) + * [Virtual router](#virtual-router) + * [WRED_PROFILE](#wred_profile) + * [For Developers](#for-developers) + * [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template) + * [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb) + + + +# Introduction +This document lists the configuration commands schema applied in the SONiC eco system. All these commands find relevance in collecting system information, analysis and even for trouble shooting. All the commands are categorized under relevant topics with corresponding examples. + +# Configuration + +SONiC is managing configuration in a single source of truth - a redisDB +instance that we refer as ConfigDB. Applications subscribe to ConfigDB +and generate their running configuration correspondingly. + +(Before Sep 2017, we were using an XML file named minigraph.xml to +configure SONiC devices. For historical documentation, please refer to +[Configuration with +Minigraph](https://github.com/Azure/SONiC/wiki/Configuration-with-Minigraph-(~Sep-2017))) + +# **Config Load and Save** + +In current version of SONiC, ConfigDB is implemented as database 4 of +local redis. When system boots, configurations will be loaded from +/etc/sonic/config_db.json file into redis. Please note that ConfigDB +content won't be written back into /etc/sonic/config_db.json file +automatically. In order to do that, a config save command need to be +manually executed from CLI. Similarly, config load will trigger a force +load of json file into DB. Generally, content in +/etc/sonic/config_db.json can be considered as starting config, and +content in redisDB running config. + +We keep a way to load configuration from minigraph and write into +ConfigDB for backward compatibility. To do that, run `config +load_minigraph`. + +### Incremental Configuration + +The design of ConfigDB supports incremental configuration - application +could subscribe to changes in ConfigDB and response correspondingly. +However, this feature is not implemented by all applications yet. By Sep +2017 now, the only application that supports incremental configuration +is BGP (docker-fpm-quagga). For other applications, a manual restart is +required after configuration changes in ConfigDB. + +# **Redis and Json Schema** + +ConfigDB uses a table-object schema that is similar with +[AppDB](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md), +and `config_db.json` is a straight-forward serialization of DB. As an +example, the following fragments could be BGP-related configuration in +redis and json, correspondingly: + + +***Redis format*** +``` +127.0.0.1:6379[4]> keys BGP_NEIGHBOR:* + +1) "BGP_NEIGHBOR:10.0.0.31" +2) "BGP_NEIGHBOR:10.0.0.39" +3) "BGP_NEIGHBOR:10.0.0.11" +4) "BGP_NEIGHBOR:10.0.0.7" + +... + +127.0.0.1:6379[4]> hgetall BGP_NEIGHBOR:10.0.0.3 + +1) "admin_status" +2) "up" +3) "peer_addr" +4) "10.0.0.2" +5) "asn" +6) "65200" +7) "name" +8) "ARISTA07T2" +``` + +***Json format*** +``` +"BGP_NEIGHBOR": { + "10.0.0.57": { + "rrclient": "0", + "name": "ARISTA01T1", + "local_addr": "10.0.0.56", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + }, + "10.0.0.59": { + "rrclient": "0", + "name": "ARISTA02T1", + "local_addr": "10.0.0.58", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + }, +} +``` + +Full sample config_db.json files are availables at +[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db.json) +and +[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db_t0.json). + + +### ACL and Mirroring + +ACL and mirroring related configuration are defined in +**MIRROR_SESSION**, **ACL_TABLE** and **ACL_RULE** tables. Those +tables are in progress of migrating from APPDB. Please refer to their +schema in APPDB +[here](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md) +and migration plan +[here](https://github.com/Azure/SONiC/wiki/ACL-Configuration-Requirement-Description). + +``` +{ +"MIRROR_SESSION": { + "everflow0": { + "src_ip": "10.1.0.32", + "dst_ip": "2.2.2.2" + } + }, + +"ACL_TABLE": { + "DATAACL": { + "policy_desc" : "data_acl", + "type": "l3", + "ports": [ + "Ethernet0", + "Ethernet4", + "Ethernet8", + "Ethernet12" + ] + } + } +} +``` + +***Below ACL table added as per the mail*** +``` +{ +"ACL_TABLE": { + "aaa": { + "type": "L3", + "ports": "Ethernet0" + } + }, +"ACL_RULE": { + "aaa|rule_0": { + "PRIORITY": "55", + "PACKET_ACTION": "DROP", + "L4_SRC_PORT": "0" + }, + "aaa|rule_1": { + "PRIORITY": "55", + "PACKET_ACTION": "DROP", + "L4_SRC_PORT": "1" + } + } +} +``` + +***Below ACL table added by comparig minigraph.xml & config_db.json*** + +``` +{ +"ACL_TABLE": { + "EVERFLOW": { + "type": "MIRROR", + "policy_desc": "EVERFLOW", + "ports": [ + "PortChannel0001", + "PortChannel0002", + "PortChannel0003", + "PortChannel0004" + ] + }, + "EVERFLOWV6": { + "type": "MIRRORV6", + "policy_desc": "EVERFLOWV6", + "ports": [ + "PortChannel0001", + "PortChannel0002", + "PortChannel0003", + "PortChannel0004" + ] + }, + "SNMP_ACL": { + "services": [ + "SNMP" + ], + "type": "CTRLPLANE", + "policy_desc": "SNMP_ACL" + }, + "SSH_ONLY": { + "services": [ + "SSH" + ], + "type": "CTRLPLANE", + "policy_desc": "SSH_ONLY" + } + }, + +"ACL_RULE": { + "SNMP_ACL|DEFAULT_RULE": { + "PRIORITY": "1", + "PACKET_ACTION": "DROP", + "ETHER_TYPE": "2048" + }, + "SNMP_ACL|RULE_1": { + "PRIORITY": "9999", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "1.1.1.1/32", + "IP_PROTOCOL": "17" + }, + "SNMP_ACL|RULE_2": { + "PRIORITY": "9998", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "2.2.2.2/32", + "IP_PROTOCOL": "17" + }, + "SSH_ONLY|DEFAULT_RULE": { + "PRIORITY": "1", + "PACKET_ACTION": "DROP", + "ETHER_TYPE": "2048" + }, + "SSH_ONLY|RULE_1": { + "PRIORITY": "9999", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "4.4.4.4/8", + "IP_PROTOCOL": "6" + } + } +} + +``` + +***ACL table type configuration example*** +``` +{ + "ACL_TABLE_TYPE": { + "CUSTOM_L3": { + "MATCHES": [ + "IN_PORTS", + "OUT_PORTS", + "SRC_IP" + ], + "ACTIONS": [ + "PACKET_ACTION", + "MIRROR_INGRESS_ACTION" + ], + "BIND_POINTS": [ + "PORT", + "LAG" + ] + } + }, + "ACL_TABLE": { + "DATAACL": { + "STAGE": "INGRESS", + "TYPE": "CUSTOM_L3", + "PORTS": [ + "Ethernet0", + "PortChannel1" + ] + } + }, + "ACL_RULE": { + "DATAACL|RULE0": { + "PRIORITY": "999", + "PACKET_ACTION": "DROP", + "SRC_IP": "1.1.1.1/32", + } + } +} +``` + +### BGP Sessions + +BGP session configuration is defined in **BGP_NEIGHBOR** table. BGP +neighbor address is used as key of bgp neighbor objects. Object +attributes include remote AS number, neighbor router name, and local +peering address. Dynamic neighbor is also supported by defining peer +group name and IP ranges in **BGP_PEER_RANGE** table. + +``` +{ +"BGP_NEIGHBOR": { + "10.0.0.61": { + "local_addr": "10.0.0.60", + "asn": 64015, + "name": "ARISTA15T0" + }, + "10.0.0.49": { + "local_addr": "10.0.0.48", + "asn": 64009, + "name": "ARISTA09T0" + }, + + "10.0.0.63": { + "rrclient": "0", + "name": "ARISTA04T1", + "local_addr": "10.0.0.62", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + } + +"BGP_PEER_RANGE": { + "BGPSLBPassive": { + "name": "BGPSLBPassive", + "ip_range": [ + "10.250.0.0/27" + ] + }, + "BGPVac": { + "name": "BGPVac", + "ip_range": [ + "10.2.0.0/16" + ] + } + } +} +``` + +### BUFFER_PG + +When the system is running in traditional buffer model, profiles needs to explicitly configured: + +``` +{ +"BUFFER_PG": { + "Ethernet0|3-4": { + "profile": "pg_lossless_40000_5m_profile" + }, + "Ethernet1|3-4": { + "profile": "pg_lossless_40000_5m_profile" + }, + "Ethernet2|3-4": { + "profile": "pg_lossless_40000_5m_profile" + } + } +} + +``` + +When the system is running in dynamic buffer model, profiles can be: + + - either calculated dynamically according to ports' configuration and just configured as "NULL"; + - or configured explicitly. + +``` +{ +"BUFFER_PG": { + "Ethernet0|3-4": { + "profile": "NULL" + }, + "Ethernet1|3-4": { + "profile": "NULL" + }, + "Ethernet2|3-4": { + "profile": "static_profile" + } + } +} + +``` + +### Buffer pool + +When the system is running in traditional buffer model, the size of all of the buffer pools and xoff of ingress_lossless_pool need to be configured explicitly. + +``` +{ +"BUFFER_POOL": { + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "15982720" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic", + "size": "9243812" + }, + "ingress_lossless_pool": { + "xoff": "4194112", + "type": "ingress", + "mode": "dynamic", + "size": "10875072" + } + } +} + +``` + +When the system is running in dynamic buffer model, the size of some of the buffer pools can be omitted and will be dynamically calculated. + +``` +{ +"BUFFER_POOL": { + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "15982720" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic", + }, + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + } + } +} + +``` + + +### Buffer profile + +``` +{ +"BUFFER_PROFILE": { + "egress_lossless_profile": { + "static_th": "3995680", + "pool": "egress_lossless_pool", + "size": "1518" + }, + "egress_lossy_profile": { + "dynamic_th": "3", + "pool": "egress_lossy_pool", + "size": "1518" + }, + "ingress_lossy_profile": { + "dynamic_th": "3", + "pool": "ingress_lossless_pool", + "size": "0" + }, + "pg_lossless_40000_5m_profile": { + "xon_offset": "2288", + "dynamic_th": "-3", + "xon": "2288", + "xoff": "66560", + "pool": "ingress_lossless_pool", + "size": "1248" + }, + "pg_lossless_40000_40m_profile": { + "xon_offset": "2288", + "dynamic_th": "-3", + "xon": "2288", + "xoff": "71552", + "pool": "ingress_lossless_pool", + "size": "1248" + } + } +} + +``` + +When the system is running in dynamic buffer model and the headroom_type is dynamic, only dynamic_th needs to be configured and rest of fields can be omitted. +This kind of profiles will be handled by buffer manager and won't be applied to SAI. + +``` +{ + { + "non_default_dynamic_th_profile": { + "dynamic_th": 1, + "headroom_type": "dynamic" + } + } +} +``` + +### Buffer queue + +``` +{ +"BUFFER_QUEUE": { + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|0-2": { + "profile": "egress_lossy_profile" + }, + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|3-4": { + "profile": "egress_lossless_profile" + }, + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|5-6": { + "profile": "egress_lossy_profile" + } + } +} + +``` + +### Buffer port ingress profile list + +``` +{ +"BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet50": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + }, + "Ethernet52": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + }, + "Ethernet56": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + } + } +} + +``` + +### Buffer port egress profile list + +``` +{ +"BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet50": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + }, + "Ethernet52": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + }, + "Ethernet56": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + } + } +} + +``` + +### Cable length + +``` +{ +"CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet9": "5m", + "Ethernet2": "5m", + "Ethernet58": "5m", + "Ethernet59": "5m", + "Ethernet50": "40m", + "Ethernet51": "5m", + "Ethernet52": "40m", + "Ethernet53": "5m", + "Ethernet54": "40m", + "Ethernet55": "5m", + "Ethernet56": "40m" + } + } +} + +``` + +### COPP_TABLE + +``` +{ +"COPP_TABLE": { + "default": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "0", + "red_action": "drop" + }, + + "trap.group.arp": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "4", + "red_action": "drop", + "trap_action": "trap", + "trap_ids": "arp_req,arp_resp,neigh_discovery", + "trap_priority": "4" + }, + + "trap.group.lldp.dhcp.udld": { + "queue": "4", + "trap_action": "trap", + "trap_ids": "lldp,dhcp,udld", + "trap_priority": "4" + }, + + "trap.group.bgp.lacp": { + "queue": "4", + "trap_action": "trap", + "trap_ids": "bgp,bgpv6,lacp", + "trap_priority": "4" + }, + + "trap.group.ip2me": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "1", + "red_action": "drop", + "trap_action": "trap", + "trap_ids": "ip2me", + "trap_priority": "1" + } + } +} +``` + +### CRM + +``` +{ +"CRM": { + "Config": { + "acl_table_threshold_type": "percentage", + "nexthop_group_threshold_type": "percentage", + "fdb_entry_high_threshold": "85", + "acl_entry_threshold_type": "percentage", + "ipv6_neighbor_low_threshold": "70", + "nexthop_group_member_low_threshold": "70", + "acl_group_high_threshold": "85", + "ipv4_route_high_threshold": "85", + "acl_counter_high_threshold": "85", + "ipv4_route_low_threshold": "70", + "ipv4_route_threshold_type": "percentage", + "ipv4_neighbor_low_threshold": "70", + "acl_group_threshold_type": "percentage", + "ipv4_nexthop_high_threshold": "85", + "ipv6_route_threshold_type": "percentage", + "snat_entry_threshold_type": "percentage", + "snat_entry_high_threshold": "85", + "snat_entry_low_threshold": "70", + "dnat_entry_threshold_type": "percentage", + "dnat_entry_high_threshold": "85", + "dnat_entry_low_threshold": "70", + "ipmc_entry_threshold_type": "percentage", + "ipmc_entry_high_threshold": "85", + "ipmc_entry_low_threshold": "70" + } + } +} + +``` + +### Data Plane L3 Interfaces + +IP configuration for data plane are defined in **INTERFACE**, +**PORTCHANNEL_INTERFACE**, and **VLAN_INTERFACE** table. The objects +in all three tables have the interface (could be physical port, port +channel, or vlan) that IP address is attached to as first-level key, and +IP prefix as second-level key. IP interface objects don't have any +attributes. + +``` +{ +"INTERFACE": { + "Ethernet0|10.0.0.0/31": {}, + "Ethernet4|10.0.0.2/31": {}, + "Ethernet8|10.0.0.4/31": {} + ... + }, + +"PORTCHANNEL_INTERFACE": { + "PortChannel01|10.0.0.56/31": {}, + "PortChannel01|FC00::71/126": {}, + "PortChannel02|10.0.0.58/31": {}, + "PortChannel02|FC00::75/126": {} + ... + }, +"VLAN_INTERFACE": { + "Vlan1000|192.168.0.1/27": {} + } +} + +``` + + +### DEFAULT_LOSSLESS_BUFFER_PARAMETER + +This table stores the default lossless buffer parameters for dynamic buffer calculation. + +``` +{ + "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { + "AZURE": { + "default_dynamic_th": "0", + "over_subscribe_ratio": "2" + } + } +} +``` + +### Device Metadata + +The **DEVICE_METADATA** table contains only one object named +*localhost*. In this table the device metadata such as hostname, hwsku, +deployment envionment id and deployment type are specified. BGP local AS +number is also specified in this table as current only single BGP +instance is supported in SONiC. + +``` +{ +"DEVICE_METADATA": { + "localhost": { + "hwsku": "Force10-S6100", + "default_bgp_status": "up", + "docker_routing_config_mode": "unified", + "hostname": "sonic-s6100-01", + "platform": "x86_64-dell_s6100_c2538-r0", + "mac": "4c:76:25:f4:70:82", + "default_pfcwd_status": "disable", + "bgp_asn": "65100", + "deployment_id": "1", + "type": "ToRRouter", + "buffer_model": "traditional" + } + } +} + +``` + + +### Device neighbor metada + +``` +{ +"DEVICE_NEIGHBOR_METADATA": { + "ARISTA01T1": { + "lo_addr": "None", + "mgmt_addr": "10.11.150.45", + "hwsku": "Arista-VM", + "type": "LeafRouter" + }, + "ARISTA02T1": { + "lo_addr": "None", + "mgmt_addr": "10.11.150.46", + "hwsku": "Arista-VM", + "type": "LeafRouter" + } + } +} + +``` + + +### DSCP_TO_TC_MAP +``` +{ +"DSCP_TO_TC_MAP": { + "AZURE": { + "1": "1", + "0": "1", + "3": "3", + "2": "1", + "5": "2", + "4": "4", + "7": "1", + "6": "1", + "9": "1", + "8": "0" + } + } +} + +``` + + +### MPLS_TC_TO_TC_MAP +``` +{ +"MPLS_TC_TO_TC_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "2", + "5": "3", + "6": "3", + "7": "4" + } + } +} + +``` + +### FLEX_COUNTER_TABLE + +``` +{ +"FLEX_COUNTER_TABLE": { + "PFCWD": { + "FLEX_COUNTER_STATUS": "enable" + }, + "PORT": { + "FLEX_COUNTER_STATUS": "enable" + }, + "QUEUE": { + "FLEX_COUNTER_STATUS": "enable" + } + } +} + +``` + + +### L2 Neighbors + +The L2 neighbor and connection information can be configured in +**DEVICE_NEIGHBOR** table. Those information are used mainly for LLDP. +While mandatory fields include neighbor name acting as object key and +remote port / local port information in attributes, optional information +about neighbor device such as device type, hwsku, management address and +loopback address can also be defined. + +``` +{ +"DEVICE_NEIGHBOR": { + "ARISTA04T1": { + "mgmt_addr": "10.20.0.163", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet124", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA03T1": { + "mgmt_addr": "10.20.0.162", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet120", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA02T1": { + "mgmt_addr": "10.20.0.161", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet116", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA01T1": { + "mgmt_addr": "10.20.0.160", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet112", + "type": "LeafRouter", + "port": "Ethernet1" + } + } +} +``` + +### Loopback Interface + +Loopback interface configuration lies in **LOOPBACK_INTERFACE** table +and has similar schema with data plane interfaces. The loopback device +name and loopback IP prefix act as multi-level key for loopback +interface objects. + +``` +{ +"LOOPBACK_INTERFACE": { + "Loopback0|10.1.0.32/32": {}, + "Loopback0|FC00:1::32/128": {} + } +} + +``` + +### LOSSLESS_TRAFFIC_PATTERN + +The LOSSLESS_TRAFFIC_PATTERN table stores parameters related to +lossless traffic for dynamic buffer calculation + +``` +{ + "LOSSLESS_TRAFFIC_PATTERN": { + "AZURE": { + "mtu": "1024", + "small_packet_percentage": "100" + } + } +} +``` + +### Management Interface + +Management interfaces are defined in **MGMT_INTERFACE** table. Object +key is composed of management interface name and IP prefix. Attribute +***gwaddr*** specify the gateway address of the prefix. +***forced_mgmt_routes*** attribute can be used to specify addresses / +prefixes traffic to which are forced to go through management network +instead of data network. + +``` +{ +"MGMT_INTERFACE": { + "eth0|10.11.150.11/16": { + "gwaddr": "10.11.0.1" + }, + "eth0|FC00:2::32/64": { + "forced_mgmt_routes": [ + "10.0.0.100/31", + "10.250.0.8", + "10.255.0.0/28" + ], + "gwaddr": "fc00:2::1" + } + } +} + +``` + +### Management port + +``` +{ +"MGMT_PORT": { + "eth0": { + "alias": "eth0", + "admin_status": "up" + } + } +} + +``` + + +### Management VRF + +``` +{ +"MGMT_VRF_CONFIG": { + "vrf_global": { + "mgmtVrfEnabled": "true" + } + } +} +``` + +### MAP_PFC_PRIORITY_TO_QUEUE + +``` +{ +"MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` +### NTP Global Configuration + +These configuration options are used to modify the way that +ntp binds to the ports on the switch and which port it uses to +make ntp update requests from. + +***NTP VRF*** + +If this option is set to `default` then ntp will run within the default vrf +**when the management vrf is enabled**. If the mgmt vrf is enabled and this value is +not set to default then ntp will run within the mgmt vrf. + +This option **has no effect** if the mgmt vrf is not enabled. + +``` +{ +"NTP": { + "global": { + "vrf": "default" + } + } +} +``` + + +***NTP Source Port*** + +This option sets the port which ntp will choose to send time update requests from by. + +NOTE: If a Loopback interface is defined on the switch ntp will choose this by default, so this setting +is **required** if the switch has a Loopback interface and the ntp peer does not have defined routes +for that address. + +``` +{ +"NTP": { + "global": { + "src_intf": "Ethernet1" + } + } +} +``` + +### NTP and SYSLOG servers + +These information are configured in individual tables. Domain name or IP +address of the server is used as object key. Currently there are no +attributes in those objects. + +***NTP server*** +``` +{ +"NTP_SERVER": { + "2.debian.pool.ntp.org": {}, + "1.debian.pool.ntp.org": {}, + "3.debian.pool.ntp.org": {}, + "0.debian.pool.ntp.org": {} + }, + +"NTP_SERVER": { + "23.92.29.245": {}, + "204.2.134.164": {} + } +} +``` + +***Syslogserver*** +``` +{ +"SYSLOG_SERVER": { + "10.0.0.5": {}, + "10.0.0.6": {}, + "10.11.150.5": {} + } +} +``` + +### Policer + +Below is an example of the policer table configuration. +``` +{ + "POLICER": { + "everflow_static_policer": { + "meter_type": "bytes", + "mode": "sr_tcm", + "cir": "12500000", + "cbs": "12500000", + "pir": "17500000", + "pbs": "17500000", + "color": "aware", + "red_packet_action": "drop", + "yellow_packet_action": "drop" + "green_packet_action": "forward" + } + } +} + +``` +Key to the table defines policer name Below are the fields +- meter_type - Mandatory field. Defines how the metering is done. values - bytes, packets +- mode - Mandatory field. Defines one of the three modes support. values - sr_tcm, tr_tcm, storm +- cir - Committed information rate bytes/sec or packets/sec based on meter_type +- cbs - Committed burst size in bytes or packets based on meter_type +- pir - Peak information rate in bytes/sec or packets/sec based on meter_type +- pbs - Peak burst size in bytes or packets based on meter_type +- color - Defines the color source for the policer. values - aware, blind +- red_packet_action - Defines the action to be taken for red color packets +- yellow_packet_action - Defines the action to be taken for yellow color packets +- green_packet_action - Defines the action to be taken for green color packets. + +The packet action could be: + +- 'drop' +- 'forward' +- 'copy' +- 'copy_cancel' +- 'trap' +- 'log' +- 'deny' +- 'transit' +### Port + +In this table the physical port configurations are defined. Each object +will have port name as its key, and port name alias and port speed as +optional attributes. + +``` +{ +"PORT": { + "Ethernet0": { + "index": "0", + "lanes": "101,102", + "description": "fortyGigE1/1/1", + "mtu": "9100", + "alias": "fortyGigE1/1/1", + "speed": "40000" + }, + "Ethernet1": { + "index": "1", + "lanes": "103,104", + "description": "fortyGigE1/1/2", + "mtu": "9100", + "alias": "fortyGigE1/1/2", + "admin_status": "up", + "speed": "40000" + }, + "Ethernet63": { + "index": "63", + "lanes": "87,88", + "description": "fortyGigE1/4/16", + "mtu": "9100", + "alias": "fortyGigE1/4/16", + "speed": "40000" + } + } +} + +``` + +### Port Channel + +Port channels are defined in **PORTCHANNEL** table with port channel +name as object key and member list as attribute. + +``` +{ +"PORTCHANNEL": { + "PortChannel0003": { + "admin_status": "up", + "min_links": "1", + "members": [ + "Ethernet54" + ], + "mtu": "9100" + }, + "PortChannel0004": { + "admin_status": "up", + "min_links": "1", + "members": [ + "Ethernet56" + ], + "mtu": "9100" + } + } +} +``` + + +### Portchannel member + +``` +{ +"PORTCHANNEL_MEMBER": { + "PortChannel0001|Ethernet50": {}, + "PortChannel0002|Ethernet52": {}, + "PortChannel0003|Ethernet54": {}, + "PortChannel0004|Ethernet56": {} + } +} + +``` +### Scheduler + +``` +{ +"SCHEDULER": { + "scheduler.0": { + "type": "STRICT" + }, + "scheduler.1": { + "type": "WRR" + "weight": "1", + "meter_type": "bytes", + "pir": "1250000000", + "pbs": "8192" + }, + "scheduler.port": { + "meter_type": "bytes", + "pir": "1000000000", + "pbs": "8192" + } + } +} +``` + +### Port QoS Map + +``` +{ +"PORT_QOS_MAP": { + "Ethernet50,Ethernet52,Ethernet54,Ethernet56": { + "tc_to_pg_map": "AZURE", + "tc_to_queue_map": "AZURE", + "pfc_enable": "3,4", + "pfc_to_queue_map": "AZURE", + "dscp_to_tc_map": "AZURE", + "dscp_to_fc_map": "AZURE", + "exp_to_fc_map": "AZURE", + "scheduler": "scheduler.port" + } + } +} +``` + +### Queue +``` +{ +"QUEUE": { + "Ethernet56|4": { + "wred_profile": "AZURE_LOSSLESS", + "scheduler": "scheduler.1" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + } + } +} +``` + + +### Tacplus Server + +``` +{ +"TACPLUS_SERVER": { + "10.0.0.8": { + "priority": "1", + "tcp_port": "49" + }, + "10.0.0.9": { + "priority": "1", + "tcp_port": "49" + } + } +} +``` + + +### TC to Priority group map + +``` +{ +"TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` + +### TC to Queue map + +``` +{ +"TC_TO_QUEUE_MAP": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` + +### Versions + +This table is where the curret version of the software is recorded. +``` +{ + "VERSIONS": { + "DATABASE": { + "VERSION": "version_1_0_1" + } + } +} +``` + +### VLAN + +This table is where VLANs are defined. VLAN name is used as object key, +and member list as well as an integer id are defined as attributes. If a +DHCP relay is required for this VLAN, a dhcp_servers attribute must be +specified for that VLAN, the value of which is a list that must contain +the domain name or IP address of one or more DHCP servers. + +``` +{ +"VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2", + "192.0.0.3", + "192.0.0.4" + ], + "members": [ + "Ethernet0", + "Ethernet4", + "Ethernet8", + "Ethernet12" + ], + "vlanid": "1000" + } + } +} +``` + +### VLAN_MEMBER + +VLAN member table has Vlan name together with physical port or port +channel name as object key, and tagging mode as attributes. + +``` +{ +"VLAN_MEMBER": { + "Vlan1000|PortChannel47": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "untagged" + }, + "Vlan2000|PortChannel47": { + "tagging_mode": "tagged" + } + } +} +``` + +### Virtual router + +The virtual router table allows to insert or update a new virtual router +instance. The key of the instance is its name. The attributes in the +table allow to change properties of a virtual router. Attributes: + +- 'v4' contains boolean value 'true' or 'false'. Enable or + disable IPv4 in the virtual router +- 'v6' contains boolean value 'true' or 'false'. Enable or + disable IPv6 in the virtual router +- 'src_mac' contains MAC address. What source MAC address will be + used for packets egressing from the virtual router +- 'ttl_action' contains packet action. Defines the action for + packets with TTL == 0 or TTL == 1 +- 'ip_opt_action' contains packet action. Defines the action for + packets with IP options +- 'l3_mc_action' contains packet action. Defines the action for + unknown L3 multicast packets + +The packet action could be: + +- 'drop' +- 'forward' +- 'copy' +- 'copy_cancel' +- 'trap' +- 'log' +- 'deny' +- 'transit' + + +***TBD*** +``` +'VRF:rid1': { + 'v4': 'true', + 'v6': 'false', + 'src_mac': '02:04:05:06:07:08', + 'ttl_action': 'copy', + 'ip_opt_action': 'deny', + 'l3_mc_action': 'drop' +} +``` + + +### WRED_PROFILE + +``` +{ +"WRED_PROFILE": { + "AZURE_LOSSLESS": { + "red_max_threshold": "2097152", + "wred_green_enable": "true", + "ecn": "ecn_all", + "green_min_threshold": "1048576", + "red_min_threshold": "1048576", + "wred_yellow_enable": "true", + "yellow_min_threshold": "1048576", + "green_max_threshold": "2097152", + "green_drop_probability": "5", + "yellow_max_threshold": "2097152", + "wred_red_enable": "true", + "yellow_drop_probability": "5", + "red_drop_probability": "5" + } + } +} +``` + +### BREAKOUT_CFG + +This table is introduced as part of Dynamic Port Breakout(DPB) feature. +It shows the current breakout mode of all ports(root ports). +The list of root ports, all possible breakout modes, and default breakout modes + are obtained/derived from platform.json and hwsku.json files. + +``` +"BREAKOUT_CFG": { + "Ethernet0": { + "brkout_mode": "4x25G[10G]" + }, + "Ethernet4": { + "brkout_mode": "4x25G[10G]" + }, + "Ethernet8": { + "brkout_mode": "4x25G[10G]" + }, + + ...... + + "Ethernet116": { + "brkout_mode": "2x50G" + }, + "Ethernet120": { + "brkout_mode": "2x50G" + }, + "Ethernet124": { + "brkout_mode": "2x50G" + } +} +``` + +### AAA + +The AAA table defined the method SONiC used for Authentication, Authorization and Accounting. +The method could be: +- default +- local +- tacacs+ +- radius + +``` +"AAA": { + "authentication": { + "login": "local" + }, + "authorization": { + "login": "local" + }, + "accounting": { + "login": "local" + } +} +``` + +For Developers +============== + +Generating Application Config by Jinja2 Template +------------------------------------------------ + +To be added. + +Incremental Configuration by Subscribing to ConfigDB +---------------------------------------------------- + +Detail instruction to be added. A sample could be found in this +[PR](https://github.com/Azure/sonic-buildimage/pull/861) that +implemented dynamic configuration for BGP. From 004dc699104a898c2ac5d5938661e2efeff47954 Mon Sep 17 00:00:00 2001 From: gechiang <62408185+gechiang@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:50:33 -0700 Subject: [PATCH 012/119] [BRCM SAI 6.0.0.13-3] Fix Warmreboot issue (#10225) --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index ce3470e6635c..e23515a1f5ea 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_VERSION = 6.0.0.13-1 +LIBSAIBCM_VERSION = 6.0.0.13-3 LIBSAIBCM_BRANCH_NAME = REL_6.0 LIBSAIBCM_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_VERSION)" From 98cfec29823720d3410a06d66f17597bb07891d8 Mon Sep 17 00:00:00 2001 From: FuzailBrcm <51665572+FuzailBrcm@users.noreply.github.com> Date: Wed, 16 Mar 2022 06:35:34 +0530 Subject: [PATCH 013/119] Using SFP refactoring framework in PDDF sfp class (#10047) * Using SFP refactoring framework in PDDF sfp class * Fixing a typo error --- .../sonic_platform_pddf_base/pddf_sfp.py | 1237 +---------------- 1 file changed, 66 insertions(+), 1171 deletions(-) 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 cf77986aba64..f11acf1a209b 100644 --- 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 @@ -5,164 +5,21 @@ ############################################################################# try: - import time - from ctypes import create_string_buffer - 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 - from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase 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_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 -# 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 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_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 = 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_MODULE_THRESHOLD_OFFSET = 0 -SFP_MODULE_THRESHOLD_WIDTH = 40 -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') - -PAGE_OFFSET = 0 -KEY_OFFSET = 1 -KEY_WIDTH = 2 -FUNC_NAME = 3 - -INFO_OFFSET = 128 -DOM_OFFSET = 0 -DOM_OFFSET1 = 384 - - -class PddfSfp(SfpBase): +class PddfSfp(SfpOptoeBase): """ PDDF generic Sfp class """ pddf_obj = {} plugin_data = {} - _port_to_eeprom_mapping = {} _port_start = 0 _port_end = 0 - _port_to_type_mapping = {} - _qsfp_ports = [] - _sfp_ports = [] - - # Read out any bytes from any offset - 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") - try: - sysfsfile_eeprom = open(self.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 as e: - print("Error: Unable to open eeprom_path: %s" % (str(e))) - finally: - if sysfsfile_eeprom: - sysfsfile_eeprom.close() - - return eeprom_raw def __init__(self, index, pddf_data=None, pddf_plugin_data=None): if not pddf_data or not pddf_plugin_data: @@ -183,492 +40,49 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None): 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.eeprom_path = self.pddf_obj.get_path(self.device, 'eeprom') - self.info_dict_keys = ['type', 'vendor_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 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 - vendor_rev |1*255VCHAR |vendor revision 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 not self.get_presence(): - return None - - if self.is_osfp_port: - sfpi_obj = inf8628InterfaceId() - offset = 0 - type_offset = OSFP_TYPE_OFFSET - vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP - hw_rev_offset = OSFP_HW_REV_OFFSET - vendor_name_offset = OSFP_VENDOR_NAME_OFFSET - vendor_pn_offset = OSFP_VENDOR_PN_OFFSET - vendor_sn_offset = OSFP_VENDOR_SN_OFFSET - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP - sfp_type = 'OSFP' - - elif self.is_qsfp_port: - sfpi_obj = sff8436InterfaceId() - offset = 128 - type_offset = XCVR_TYPE_OFFSET - vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP - hw_rev_offset = XCVR_HW_REV_OFFSET - vendor_name_offset = XCVR_VENDOR_NAME_OFFSET - vendor_pn_offset = XCVR_VENDOR_PN_OFFSET - vendor_sn_offset = XCVR_VENDOR_SN_OFFSET - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP - sfp_type = 'QSFP' - else: - sfpi_obj = sff8472InterfaceId() - offset = 0 - type_offset = XCVR_TYPE_OFFSET - vendor_rev_width = XCVR_HW_REV_WIDTH_SFP - hw_rev_offset = XCVR_HW_REV_OFFSET - vendor_name_offset = XCVR_VENDOR_NAME_OFFSET - vendor_pn_offset = XCVR_VENDOR_PN_OFFSET - vendor_sn_offset = XCVR_VENDOR_SN_OFFSET - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP - sfp_type = 'SFP' - - 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) - if sfp_type_raw is not None: - 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) - 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) - 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) - 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( - sfp_vendor_name_raw, 0) - - sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( - (offset + 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 + hw_rev_offset), vendor_rev_width) - sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( - sfp_vendor_rev_raw, 0) - - sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( - (offset + vendor_sn_offset), XCVR_VENDOR_SN_WIDTH) - sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( - sfp_vendor_sn_raw, 0) - - xcvr_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') - compliance_code_dict = dict() - - if sfp_interface_bulk_data: - xcvr_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] - xcvr_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] - xcvr_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] - xcvr_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] - xcvr_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] - xcvr_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] - else: - xcvr_info_dict['type'] = sfp_type_data['data']['type']['value'] if sfp_type_data else 'N/A' - xcvr_info_dict['type_abbrv_name'] = sfp_type_abbrv_name['data']['type_abbrv_name']['value'] \ - if sfp_type_abbrv_name else 'N/A' - - xcvr_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] \ - if sfp_vendor_name_data else 'N/A' - xcvr_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' - xcvr_info_dict['vendor_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['cable_type'] = "Unknown" - xcvr_info_dict['cable_length'] = "Unknown" - - if sfp_type == 'QSFP': - for key in qsfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - xcvr_info_dict['cable_type'] = key - xcvr_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) + SfpOptoeBase.__init__(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'] - xcvr_info_dict['specification_compliance'] = str(compliance_code_dict) + def get_eeprom_path(self): + return self.eeprom_path - 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']) - else: - xcvr_info_dict['nominal_bit_rate'] = 'N/A' - elif sfp_type == 'OSFP': - pass - else: - for key in sfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - xcvr_info_dict['cable_type'] = key - xcvr_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'] - xcvr_info_dict['specification_compliance'] = str(compliance_code_dict) - - xcvr_info_dict['nominal_bit_rate'] = str( - sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) - - return xcvr_info_dict - - def get_transceiver_bulk_status(self): + def get_name(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. - ======================================================================== + Retrieves the name of the device + Returns: + string: The name of the device """ - # check present status - if not self.get_presence(): - return None - - xcvr_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') - - if self.is_osfp_port: - # Below part is added to avoid fail xcvrd, shall be implemented later - pass - elif self.is_qsfp_port: - # QSFPs - 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_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) - else: - return None - - 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) - 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 None - - xcvr_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - xcvr_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( - (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 None - - xcvr_dom_info_dict['tx1power'] = 'N/A' - xcvr_dom_info_dict['tx2power'] = 'N/A' - 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) - 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 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'] - xcvr_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] - - if dom_channel_monitor_raw: - xcvr_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - xcvr_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - xcvr_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] - xcvr_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] - xcvr_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] - xcvr_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] - xcvr_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] - xcvr_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] - xcvr_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] - xcvr_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] - - else: - # SFPs - offset = 256 - - sfpd_obj = sff8472Dom() - if sfpd_obj is None: - return None - - 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) - 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) - 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 None - - xcvr_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - xcvr_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - xcvr_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RXPower']['value'] - xcvr_dom_info_dict['rx2power'] = 'N/A' - xcvr_dom_info_dict['rx3power'] = 'N/A' - xcvr_dom_info_dict['rx4power'] = 'N/A' - xcvr_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TXBias']['value'] - xcvr_dom_info_dict['tx2bias'] = 'N/A' - xcvr_dom_info_dict['tx3bias'] = 'N/A' - xcvr_dom_info_dict['tx4bias'] = 'N/A' - xcvr_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TXPower']['value'] - xcvr_dom_info_dict['tx2power'] = 'N/A' - xcvr_dom_info_dict['tx3power'] = 'N/A' - xcvr_dom_info_dict['tx4power'] = 'N/A' - - xcvr_dom_info_dict['rx_los'] = self.get_rx_los() - xcvr_dom_info_dict['tx_fault'] = self.get_tx_fault() - xcvr_dom_info_dict['reset_status'] = self.get_reset_status() - xcvr_dom_info_dict['lp_mode'] = self.get_lpmode() - - return xcvr_dom_info_dict + # Name of the port/sfp ? + return 'PORT{}'.format(self.port_index) - def get_transceiver_threshold_info(self): + def get_presence(self): """ - Retrieves transceiver threshold info of this SFP + Retrieves the presence of the PSU 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. - ======================================================================== + bool: True if PSU is present, False if not """ - # check present status - if not self.get_presence(): - return None - - xcvr_dom_threshold_info_dict = dict.fromkeys(self.threshold_dict_keys, 'N/A') - - if self.is_osfp_port: - # Below part is added to avoid fail xcvrd, shall be implemented later - pass - elif self.is_qsfp_port: - # QSFPs - sfpd_obj = sff8436Dom() - if sfpd_obj is None: - return None - - offset = 384 - dom_thres_raw = self.__read_eeprom_specific_bytes( - (offset+QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) - 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: - xcvr_dom_threshold_info_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] - xcvr_dom_threshold_info_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] - xcvr_dom_threshold_info_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] - xcvr_dom_threshold_info_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] - xcvr_dom_threshold_info_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] - xcvr_dom_threshold_info_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] - 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((offset + 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) - ch_th_data = channel_threshold_values.get('data') - if ch_th_data: - xcvr_dom_threshold_info_dict['rxpowerhighalarm'] = ch_th_data['RxPowerHighAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerlowalarm'] = ch_th_data['RxPowerLowAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerhighwarning'] = ch_th_data['RxPowerHighWarning']['value'] - xcvr_dom_threshold_info_dict['rxpowerlowwarning'] = ch_th_data['RxPowerLowWarning']['value'] - xcvr_dom_threshold_info_dict['txpowerhighalarm'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txpowerlowalarm'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txpowerhighwarning'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txpowerlowwarning'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txbiashighalarm'] = ch_th_data['TxBiasHighAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiaslowalarm'] = ch_th_data['TxBiasLowAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiashighwarning'] = ch_th_data['TxBiasHighWarning']['value'] - xcvr_dom_threshold_info_dict['txbiaslowwarning'] = ch_th_data['TxBiasLowWarning']['value'] + output = self.pddf_obj.get_attr_name_output(self.device, 'xcvr_present') + if not output: + return False + mode = output['mode'] + modpres = output['status'].rstrip() + if 'XCVR' in self.plugin_data: + if 'xcvr_present' in self.plugin_data['XCVR']: + ptype = self.sfp_type + vtype = 'valmap-'+ptype + if vtype in self.plugin_data['XCVR']['xcvr_present'][mode]: + vmap = self.plugin_data['XCVR']['xcvr_present'][mode][vtype] + if modpres in vmap: + return vmap[modpres] + else: + return False + # if self.plugin_data doesn't specify anything regarding Transceivers + if modpres == '1': + return True else: - # SFPs - sfpd_obj = sff8472Dom() - offset = 256 - eeprom_ifraw = self.__read_eeprom_specific_bytes(0, offset) - sfpi_obj = sff8472InterfaceId(eeprom_ifraw) - cal_type = sfpi_obj.get_calibration_type() - sfpd_obj._calibration_type = cal_type - - 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_mod_th_data = sfpd_obj.parse_alarm_warning_threshold( - dom_module_threshold_raw, 0) - - xcvr_dom_threshold_info_dict['temphighalarm'] = dom_mod_th_data['data']['TempHighAlarm']['value'] - xcvr_dom_threshold_info_dict['templowalarm'] = dom_mod_th_data['data']['TempLowAlarm']['value'] - xcvr_dom_threshold_info_dict['temphighwarning'] = dom_mod_th_data['data']['TempHighWarning']['value'] - xcvr_dom_threshold_info_dict['templowwarning'] = dom_mod_th_data['data']['TempLowWarning']['value'] - xcvr_dom_threshold_info_dict['vcchighalarm'] = dom_mod_th_data['data']['VoltageHighAlarm']['value'] - xcvr_dom_threshold_info_dict['vcclowalarm'] = dom_mod_th_data['data']['VoltageLowAlarm']['value'] - xcvr_dom_threshold_info_dict['vcchighwarning'] = dom_mod_th_data[ - 'data']['VoltageHighWarning']['value'] - xcvr_dom_threshold_info_dict['vcclowwarning'] = dom_mod_th_data['data']['VoltageLowWarning']['value'] - xcvr_dom_threshold_info_dict['txbiashighalarm'] = dom_mod_th_data['data']['BiasHighAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiaslowalarm'] = dom_mod_th_data['data']['BiasLowAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiashighwarning'] = dom_mod_th_data['data']['BiasHighWarning']['value'] - xcvr_dom_threshold_info_dict['txbiaslowwarning'] = dom_mod_th_data['data']['BiasLowWarning']['value'] - xcvr_dom_threshold_info_dict['txpowerhighalarm'] = dom_mod_th_data['data']['TXPowerHighAlarm']['value'] - xcvr_dom_threshold_info_dict['txpowerlowalarm'] = dom_mod_th_data['data']['TXPowerLowAlarm']['value'] - xcvr_dom_threshold_info_dict['txpowerhighwarning'] = dom_mod_th_data['data']['TXPowerHighWarning'][ - 'value'] - xcvr_dom_threshold_info_dict['txpowerlowwarning'] = dom_mod_th_data['data']['TXPowerLowWarning'][ - 'value'] - xcvr_dom_threshold_info_dict['rxpowerhighalarm'] = dom_mod_th_data['data']['RXPowerHighAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerlowalarm'] = dom_mod_th_data['data']['RXPowerLowAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerhighwarning'] = dom_mod_th_data['data']['RXPowerHighWarning'][ - 'value'] - xcvr_dom_threshold_info_dict['rxpowerlowwarning'] = dom_mod_th_data['data']['RXPowerLowWarning'][ - 'value'] - - return xcvr_dom_threshold_info_dict + return False def get_reset_status(self): """ @@ -677,20 +91,16 @@ def get_reset_status(self): A Boolean, True if reset enabled, False if disabled """ reset_status = None - if not self.get_presence(): - return reset_status - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_reset') - if not output: - return False - status = int(output['status'].rstrip()) + if output: + status = int(output['status'].rstrip()) - if status == 1: - reset_status = True - else: - reset_status = False + if status == 1: + reset_status = True + else: + reset_status = False return reset_status @@ -702,42 +112,19 @@ def get_rx_los(self): Note : RX LOS status is latched until a call to get_rx_los or a reset. """ rx_los = None - if not self.get_presence(): - return rx_los - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_rxlos') - if not output: - # read the values from EEPROM - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - 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] - else: - # SFP ports - 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: + if output: status = int(output['status'].rstrip()) if status == 1: rx_los = True else: rx_los = False + else: + # Use common SfpOptoeBase implementation for get_rx_los + rx_los = super().get_rx_los() return rx_los @@ -749,42 +136,19 @@ def get_tx_fault(self): Note : TX fault status is lached until a call to get_tx_fault or a reset. """ tx_fault = None - if not self.get_presence(): - return tx_fault - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_txfault') - if not output: - # read the values from EEPROM - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - 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] - else: - # SFP - 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: + if output: status = int(output['status'].rstrip()) if status == 1: tx_fault = True else: tx_fault = False + else: + # Use common SfpOptoeBase implementation for get_tx_fault + tx_fault = super().get_tx_fault() return tx_fault @@ -795,86 +159,22 @@ def get_tx_disable(self): A Boolean, True if tx_disable is enabled, False if disabled """ tx_disable = False - if not self.get_presence(): - return tx_disable - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_txdisable') - if not output: - # read the values from EEPROM - if self.is_osfp_port: - return tx_disable - elif self.is_qsfp_port: - 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: - 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 - else: + if output: status = int(output['status'].rstrip()) if status == 1: tx_disable = True else: tx_disable = False + else: + # Use common SfpOptoeBase implementation for get_tx_disable + tx_disable = super().get_tx_disable() return tx_disable - 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 not self.get_presence(): - return 0 - - if self.is_osfp_port: - return 0 - elif self.is_qsfp_port: - 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 - else: - # SFP doesnt support this - return 0 - def get_lpmode(self): """ Retrieves the lpmode (low power mode) status of this SFP @@ -882,162 +182,21 @@ def get_lpmode(self): A Boolean, True if lpmode is enabled, False if disabled """ lpmode = False - if not self.get_presence(): - return lpmode - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_lpmode') - if not output: - # Read from EEPROM - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - try: - eeprom = None - ctype = self.get_connector_type() - if ctype in ['Copper pigtail', 'No separable connector']: - return False - - eeprom = open(self.eeprom_path, "rb") - eeprom.seek(93) - status = ord(eeprom.read(1)) - - if ((status & 0x3) == 0x3): - # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 - lpmode = True - 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 - lpmode = 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) - else: - # SFP - pass - else: + if output: status = int(output['status'].rstrip()) if status == 1: lpmode = True else: lpmode = False - - return lpmode - - 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 - if not self.get_presence(): - return power_override - - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - 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']) - else: - # SFP doesnt suppor this - pass - - 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() - if transceiver_dom_info_dict is not None: - # returns None if temperature is not found in the dictionary - return transceiver_dom_info_dict.get("temperature") - else: - return None - - 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() - # returns None if voltage is not found in the dictionary - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("voltage") else: - return None + # Use common SfpOptoeBase implementation for get_lpmode + lpmode = super().get_lpmode() - 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() - if transceiver_dom_info_dict is not None: - 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 [] - else: - return None - - 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() - if transceiver_dom_info_dict is not None: - 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 [] - else: - return None - - 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() - if transceiver_dom_info_dict is not None: - 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] - else: - return None + return lpmode def get_intr_status(self): """ @@ -1068,17 +227,10 @@ def reset(self): A boolean, True if successful, False if not """ status = False - if not self.get_presence(): - return status - device = 'PORT{}'.format(self.port_index) - # 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 - if path is None: - pass - else: + if path: try: f = open(path, 'r+') except IOError as e: @@ -1095,6 +247,9 @@ def reset(self): status = True except IOError as e: status = False + else: + # Use common SfpOptoeBase implementation for reset + status = super().reset() return status @@ -1109,61 +264,11 @@ def tx_disable(self, tx_disable): """ # find out a generic implementation of tx_disable for SFP, QSFP and OSFP status = False - if not self.get_presence(): - return tx_disable - device = 'PORT{}'.format(self.port_index) path = self.pddf_obj.get_path(device, 'xcvr_txdisable') # TODO: put the optic based reset logic using EEPROM - if path is None: - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - eeprom_f = None - try: - txdisable_ctl = 0xf if tx_disable else 0x0 - buf = create_string_buffer(1) - buf[0] = bytes([txdisable_ctl]) - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(QSFP_CONTROL_OFFSET) - eeprom_f.write(buf[0]) - except IOError as 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( - 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 - txdisable_bit = 64 if tx_disable else 191 - status_control = int(status_control_raw[0], 16) - txdisable_ctl = (status_control | txdisable_bit) if tx_disable else ( - status_control & txdisable_bit) - try: - eeprom_f = open(self.eeprom_path, mode="r+b", buffering=0) - buf = create_string_buffer(1) - buf[0] = bytes([txdisable_ctl]) - # Write to eeprom - 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))) - return False - finally: - if eeprom_f: - eeprom_f.close() - time.sleep(0.01) - status = True - else: + if path: try: f = open(path, 'r+') except IOError as e: @@ -1178,48 +283,10 @@ def tx_disable(self, tx_disable): status = True except IOError as e: status = False - - return status - - 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 - """ - # TODO: find a implementation - status = False - if not self.get_presence(): - return status - - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - eeprom_f = None - try: - channel_state = self.get_tx_disable_channel() - txdisable_ctl = (channel_state | channel) if disable else (channel_state & ~channel) - buf = create_string_buffer(1) - buf[0] = bytes([txdisable_ctl]) - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(QSFP_CONTROL_OFFSET) - eeprom_f.write(buf[0]) - except IOError as 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: - pass + # Use common SfpOptoeBase implementation for tx_disable + status = super().tx_disable(tx_disable) + return status @@ -1233,44 +300,10 @@ def set_lpmode(self, lpmode): A boolean, True if lpmode is set successfully, False if not """ status = False - if not self.get_presence(): - return status - device = 'PORT{}'.format(self.port_index) path = self.pddf_obj.get_path(device, 'xcvr_lpmode') - # TODO: put the optic based reset logic using EEPROM - if path is None: - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - try: - eeprom_f = None - ctype = self.get_connector_type() - if ctype in ['Copper pigtail', 'No separable connector']: - return False - - # Fill in write buffer - regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode - buffer = create_string_buffer(1) - buffer[0] = bytes([regval]) - - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(93) - eeprom_f.write(buffer[0]) - return True - except IOError as 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) - else: - pass - - else: + if path: try: f = open(path, 'r+') except IOError as e: @@ -1286,149 +319,11 @@ def set_lpmode(self, lpmode): status = True except IOError as e: status = False - - return status - - 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 - """ - status = False - if not self.get_presence(): - return status - - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - 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] = bytes([power_override_bit | power_set_bit]) - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(QSFP_POWEROVERRIDE_OFFSET) - eeprom_f.write(buffer[0]) - except IOError as 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) - return True else: - pass + # Use common SfpOptoeBase implementation for set_lpmode + status = super().set_lpmode(lpmode) return status - def get_name(self): - """ - Retrieves the name of the device - Returns: - string: The name of the device - """ - # Name of the port/sfp ? - return 'PORT{}'.format(self.port_index) - - def get_presence(self): - """ - Retrieves the presence of the PSU - Returns: - bool: True if PSU is present, False if not - """ - output = self.pddf_obj.get_attr_name_output(self.device, 'xcvr_present') - if not output: - return False - - mode = output['mode'] - modpres = output['status'].rstrip() - if 'XCVR' in self.plugin_data: - if 'xcvr_present' in self.plugin_data['XCVR']: - ptype = self.sfp_type - vtype = 'valmap-'+ptype - if vtype in self.plugin_data['XCVR']['xcvr_present'][mode]: - vmap = self.plugin_data['XCVR']['xcvr_present'][mode][vtype] - if modpres in vmap: - return vmap[modpres] - else: - return False - # if self.plugin_data doesn't specify anything regarding Transceivers - if modpres == '1': - return True - 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() - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("model", "N/A") - else: - return None - - 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() - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("serial", "N/A") - else: - 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 - """ - return self.get_presence() and self.get_transceiver_bulk_status() - - def get_connector_type(self): - """ - Retrieves the device connector type - Returns: - enum: connector_code - """ - transceiver_dom_info_dict = self.get_transceiver_info() - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("connector", "N/A") - else: - return None - - 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 - def dump_sysfs(self): return self.pddf_obj.cli_dump_dsysfs('xcvr') From 5617b1ae3efc6cee52b875651135ada67898ebf0 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 15 Mar 2022 18:12:49 -0700 Subject: [PATCH 014/119] Image disk space reduction (#10172) # Why I did it Reduce the disk space taken up during bootup and runtime. # How I did it 1. Remove python package cache from the base image and from the containers. 2. During bootup, if logs are to be stored in memory, then don't create the `var-log.ext4` file just to delete it later during bootup. 3. For the partition containing `/host`, don't reserve any blocks for just the root user. This just makes sure all disk space is available for all users, if needed during upgrades (for example). * Remove pip2 and pip3 caches from some containers Only containers which appeared to have a significant pip cache size are included here. Signed-off-by: Saikrishna Arcot * Don't create var-log.ext4 if we're storing logs in memory Signed-off-by: Saikrishna Arcot * Run tune2fs on the device containing /host to not reserve any blocks for just the root user Signed-off-by: Saikrishna Arcot --- dockers/docker-base-bullseye/Dockerfile.j2 | 2 +- dockers/docker-base-buster/Dockerfile.j2 | 2 +- dockers/docker-config-engine-bullseye/Dockerfile.j2 | 2 +- dockers/docker-config-engine-buster/Dockerfile.j2 | 2 +- dockers/docker-orchagent/Dockerfile.j2 | 2 +- dockers/docker-sonic-mgmt-framework/Dockerfile.j2 | 2 +- files/Aboot/boot0.j2 | 7 ++++++- files/initramfs-tools/varlog | 10 ++++++++++ installer/arm64/install.sh | 5 +++++ installer/armhf/install.sh | 5 +++++ installer/x86_64/install.sh | 11 +++++++++++ 11 files changed, 43 insertions(+), 7 deletions(-) diff --git a/dockers/docker-base-bullseye/Dockerfile.j2 b/dockers/docker-base-bullseye/Dockerfile.j2 index 1b33003ce0a9..cae555174174 100644 --- a/dockers/docker-base-bullseye/Dockerfile.j2 +++ b/dockers/docker-base-bullseye/Dockerfile.j2 @@ -102,7 +102,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/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index e16a0f677b07..52c784e9a7fe 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -121,7 +121,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-config-engine-bullseye/Dockerfile.j2 b/dockers/docker-config-engine-bullseye/Dockerfile.j2 index 84785d0669f1..9d0ca97c7604 100644 --- a/dockers/docker-config-engine-bullseye/Dockerfile.j2 +++ b/dockers/docker-config-engine-bullseye/Dockerfile.j2 @@ -49,4 +49,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-config-engine-buster/Dockerfile.j2 b/dockers/docker-config-engine-buster/Dockerfile.j2 index 3022546a068c..1e7a64bfcd36 100644 --- a/dockers/docker-config-engine-buster/Dockerfile.j2 +++ b/dockers/docker-config-engine-buster/Dockerfile.j2 @@ -49,4 +49,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-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 5e403213c1d4..f71f31cfc0ac 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -64,7 +64,7 @@ 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/"] diff --git a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 index d727ac449d46..937c5368483a 100644 --- a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 @@ -34,6 +34,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] 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/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 38eb8b5fe78a..7306c36cfc0c 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -351,7 +351,12 @@ extract_image() { unzip -oq "$swipath" -x boot0 "$dockerfs" -d "$image_path" ## 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)" + + ## Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $rootdev info "Extracting $dockerfs from swi" ## Unpacking dockerfs delayed 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/installer/arm64/install.sh b/installer/arm64/install.sh index dee3ceec9038..249c5b521700 100755 --- a/installer/arm64/install.sh +++ b/installer/arm64/install.sh @@ -139,6 +139,11 @@ elif [ "$install_env" = "sonic" ]; then rm -rf $f fi done + + demo_dev=$(findmnt -n -o SOURCE --target /host) + + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev fi # Create target directory or clean it up if exists diff --git a/installer/armhf/install.sh b/installer/armhf/install.sh index 9ade40d5149e..8cffa755734f 100755 --- a/installer/armhf/install.sh +++ b/installer/armhf/install.sh @@ -139,6 +139,11 @@ elif [ "$install_env" = "sonic" ]; then rm -rf $f fi done + + demo_dev=$(findmnt -n -o SOURCE --target /host) + + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev fi # Create target directory or clean it up if exists diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index dbab4d54ab72..950d765d2418 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -477,6 +477,9 @@ if [ "$install_env" = "onie" ]; then # Make filesystem mkfs.ext4 -L $demo_volume_label $demo_dev + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev + # Mount demo filesystem demo_mnt=$(${onie_bin} mktemp -d) || { echo "Error: Unable to create file system mount point" @@ -509,12 +512,20 @@ elif [ "$install_env" = "sonic" ]; then rm -rf $f fi done + + demo_dev=$(findmnt -n -o SOURCE --target /host) + + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev else demo_mnt="build_raw_image_mnt" demo_dev=$cur_wd/"%%OUTPUT_RAW_IMAGE%%" mkfs.ext4 -L $demo_volume_label $demo_dev + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev + echo "Mounting $demo_dev on $demo_mnt..." mkdir $demo_mnt mount -t auto -o loop $demo_dev $demo_mnt From c5849c9650f099428f10207992b58623445db314 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozodoi Date: Wed, 16 Mar 2022 06:00:51 +0200 Subject: [PATCH 015/119] Add scapy support for python3 virtual environment in the sonic-mgmt docker container (#10234) Why I did it Migration of sonic-mgmt codebase from Python 2 to Python 3 How I did it Added scapy dependencies to the env-python3 virtual environment. How to verify it Run test case: py.test --testbed=testbed-t0 --inventory=../ansible/lab --testbed_file=../ansible/testbed.csv --host-pattern=testbed-t0 -- module-path=../ansible/library lldp Signed-off-by: Oleksandr Kozodoi --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index df26f2ccf38c..99ad9fa8fb80 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -245,7 +245,8 @@ RUN python3 -m pip install setuptools-rust \ allure-pytest==2.8.22 \ retry \ thrift==0.11.0 \ - ptf + ptf \ + scapy==2.4.5 # Deactivating a virtualenv. ENV PATH="$BACKUP_OF_PATH" From 5c7aa50463512e16fefe564c80eb8838a49a3ee2 Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Thu, 17 Mar 2022 02:46:26 +0530 Subject: [PATCH 016/119] DellEMC: Z9332f - Component API Fixes (#10187) --- .../common/ipmihelper.py | 5 ++- .../common/onie_stage_fwpkg | 2 +- .../common/sonic_platform/hwaccess.py | 5 ++- .../z9332f/sonic_platform/component.py | 38 +++++++++++++++---- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py b/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py index d95329c40de2..3908f90bdad4 100644 --- a/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py +++ b/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py @@ -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 diff --git a/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg b/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg index 1ceaf32fe8c1..dcc74a09a91e 100755 --- a/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg +++ b/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg @@ -45,7 +45,7 @@ function show_help_and_exit() echo " " echo " Available options:" echo " -h, -? : getting this help" - echo " -o [fwpkg] : stages the firmware update package" + echo " -a [fwpkg] : stages the firmware update package" 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 373f71bdd5bf..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 @@ -39,7 +39,10 @@ def pci_set_value(resource, val, offset): # 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) 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 f652c2eccf85..214467f8c35d 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 @@ -23,20 +23,36 @@ def get_bios_version(): - return subprocess.check_output( - ['dmidecode', '-s', 'bios-version']).decode('utf-8').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 >> 16) & 0xffff, val & 0xffff) def get_bmc_version(): - return subprocess.check_output( - ['cat', '/sys/class/ipmi/ipmi0/device/bmc/firmware_revision'] - ).decode('utf-8').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) @@ -69,7 +85,7 @@ def get_pciephy_version(): except (FileNotFoundError, subprocess.CalledProcessError): pass else: - version = re.search(r'PCIe FW loader version:\s(.*)', pcie_ver) + version = re.search(r'PCIe FW version:\s(.*)', pcie_ver) if version: val = version.group(1).strip() @@ -158,6 +174,14 @@ def _get_available_firmware_version(image_path): 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" From e1f57db81863ab1fc63b5204d3e75195eafbb7b7 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 18 Mar 2022 01:16:43 +0800 Subject: [PATCH 017/119] [Submodule]: Update sonic-restapi (#10257) #### Why I did it ``` Update submodule sonic-restapi bd97dfe Fix urllib3 CVE-2021-33503 issue (#104) f159bfa Upgrade the containers to be based on Debian Buster (#103) a1830c1 (origin/201911) Fix OpenAPI spec to be readable by autorest (#101) ``` --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index 94805a39ac07..bd97dfeb4b45 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit 94805a39ac0712219f7dc08faa2cfdbf371dd177 +Subproject commit bd97dfeb4b4564defbc10e521ee05bbfe0638315 From 52c2a3ad230ddef314418cd2906d889da375f5ec Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 17 Mar 2022 10:26:03 -0700 Subject: [PATCH 018/119] [yang] Fixing Ethertype field regex in acl rule yang to accept decimal values (#10108) #### Why I did it Fixing issue https://github.com/Azure/sonic-buildimage/issues/9991 The ACL RULE table field ETHER_TYPE can accept both hex as well as decimal values. However yang model didn't allow decimal values. Fixed it to allow decimal values (same pattern as in hex (1536-65535) #### How I did it Updated yang model to handle decimal values #### How to verify it Added UT to verify it. --- .../tests/files/sample_config_db.json | 3 +- .../tests/yang_model_tests/tests/acl.json | 9 ++- .../yang_model_tests/tests_config/acl.json | 60 ++++++++++++++++++- .../yang-templates/sonic-acl.yang.j2 | 2 +- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 920181646c46..ae0cc60da648 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -150,7 +150,8 @@ "V4-ACL-TABLE|DEFAULT_DENY": { "PACKET_ACTION": "DROP", "IP_TYPE": "IPv4ANY", - "PRIORITY": "0" + "PRIORITY": "0", + "ETHER_TYPE": "2048" }, "V4-ACL-TABLE|Rule_20": { "PACKET_ACTION": "FORWARD", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json index 980622cbd3e8..243554d60f9a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json @@ -100,7 +100,14 @@ "eStrKey" : "Pattern" }, "ACL_RULE_L2_INVALID_ETHER": { - "desc": "Configure invalid MAC address format.", + "desc": "Configure invalid ethertype.", + "eStrKey" : "Pattern" + }, + "ACL_RULE_L2_VALID_ETHER_IN_DECIMAL": { + "desc": "Configure valid ethertype in decimal format." + }, + "ACL_RULE_L2_INVALID_ETHER_IN_DECIMAL": { + "desc": "Configure invalid ethertype in decimal format.", "eStrKey" : "Pattern" }, "ACL_PACKET_ACTION_VALIDATE_VALUE_ACCEPT": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json index b2aa6b3fb15d..4829eb3971dc 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json @@ -768,8 +768,8 @@ "ACL_RULE_LIST": [ { "ACL_TABLE_NAME": "L2ACL_INVALID_ETHER", - "SRC_MAC": "00.00.AB.CD.EF.00/FF.FF.FF.00.00.00", - "DST_MAC": "00.00.AB.CD.EF.FF/FF.FF.FF.FF.FF.FF", + "SRC_MAC": "00:00:AB:CD:EF:00/FF:FF:FF:00:00:00", + "DST_MAC": "00:00:AB:CD:EF:FF/FF:FF:FF:FF:FF:FF", "ETHER_TYPE": "64", "PACKET_ACTION": "FORWARD", "PRIORITY": 999980, @@ -790,6 +790,62 @@ } } }, + "ACL_RULE_L2_VALID_ETHER_IN_DECIMAL": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "L2ACL_VALID_ETHER_DECIMAL", + "SRC_MAC": "00:00:AB:CD:EF:00/FF:FF:FF:00:00:00", + "DST_MAC": "00:00:AB:CD:EF:FF/FF:FF:FF:FF:FF:FF", + "ETHER_TYPE": "2048", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999980, + "RULE_NAME": "Rule_20" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "L2ACL_VALID_ETHER_DECIMAL", + "policy_desc": "L2ACL Test", + "ports": [ "" ], + "stage": "INGRESS", + "type": "L2" + } + ] + } + } + }, + "ACL_RULE_L2_INVALID_ETHER_IN_DECIMAL": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "L2ACL_INVALID_ETHER_DECIMAL", + "SRC_MAC": "00:00:AB:CD:EF:00/FF:FF:FF:00:00:00", + "DST_MAC": "00:00:AB:CD:EF:FF/FF:FF:FF:FF:FF:FF", + "ETHER_TYPE": "66789", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 999980, + "RULE_NAME": "Rule_20" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "L2ACL_INVALID_ETHER_DECIMAL", + "policy_desc": "L2ACL Test", + "ports": [ "" ], + "stage": "INGRESS", + "type": "L2" + } + ] + } + } + }, "ACL_PACKET_ACTION_VALIDATE_VALUE_ACCEPT": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_RULE": { diff --git a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 index d007f82e0964..9fd442297c9f 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -168,7 +168,7 @@ module sonic-acl { leaf ETHER_TYPE { type string { - pattern "0x0[6-9a-fA-F][0-9a-fA-F]{2}|0x[1-9a-fA-F][0-9a-fA-F]{3}"; + pattern "0x0[6-9a-fA-F][0-9a-fA-F]{2}|0x[1-9a-fA-F][0-9a-fA-F]{3}|153[6-9]|15[4-9][0-9]|1[6-9][0-9][0-9]|[2-9][0-9]{3}|[1-5][0-9]{4}|6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}"; } } From ad6200029f3176eef4d08d519aac7f5ef76f0ac8 Mon Sep 17 00:00:00 2001 From: Jeff Henning <94179951+jeffhtgt@users.noreply.github.com> Date: Thu, 17 Mar 2022 19:47:08 -0500 Subject: [PATCH 019/119] Edgecore 4630/5835/7326/7816 API2.0 platform support (#10053) * Initial pass of EdgeCore platform changes. * Remove libevent dependency from lldpd. * Remove python2 dependencies python3.7 force from platform install script. * Include usbmount support changes. * Add missing 4630 install file. * Update a few file permissions. Add umask line to Makefile. Specify python3.9 in install script. * Misc platform updates: - Add missing fan drawer component to sonic_platform - Remove kernel version specification from Makefile - Update to 4630 utility * - Fix file permissions on source files - Fix compile issue with 4630 driver modules (set_fs, get_fs, no longer supported in kernel 5.10) * Fix missing/extra parens in 4630 util script. * Fix indentation in fanutil.py. * Integrate deltas from Edgecore to ec_platform branch. * Installer update from Edgecore to resolve smbus serial console errors. * Update stable_size for warm boot. * Fix SFP dictionary key to match xcvrd. * - Add missing define in event.py files needed for xcvrd - Fix SFP info dict key for 7xxx switches * 5835 platform file updates including installer and 5835 utility. * 5835 fix for DMAR errors on serial console. * Don't skip starting thermalctld in the pmon container. * Revert several changes that were not related to platform. * Run thermalctld in pmon container. * Don't disable thermalctld in the pmon container. * Fix prints/parens in 7816 install utility. * - Incorporate 7816 changes from Edgecore - Fix 7326 driver file using old kernel function * Update kernel modules to use kernel_read(). * Fix compile errors with 7816 and 7326 driver modules. * Fix some indents preventing platform files from loading. * Update 7816 platform sfp dictionary to match field names in xcvrd. * Add missing service and util files for 7816. * Update file names, etc. based on full SKU for 7816. * Delete pddf files not needed. These were causing conflicts with API2.0 implementation. * Remove pddf files suggested by Edgecore that were preventing API2.0 support from starting. * Install API2.0 file instead of pddf. * Update 7326 mac service file to not use pddf. Fix syntax errors in 7326 utility script. * Fix sonic_platform setup file for 7326. * Fix syntax errors in python scripts. * Updates to 7326 platform files. * Fix some tab errors pulled down from master merge. * Remove pddf files that were added from previous merge. * Updates for 5835. * Fix missing command byte for 5835 psu status. * Fix permission bits on 4630 service files. * Update platforms to use new SFP refactoring. * Fix unused var warnings. --- .../hx5-as4630-48x1G+4x25G+2x100G.bcm | 2 +- .../pddf/pd-plugin.json | 66 - .../x86_64-accton_as4630_54pe-r0/pddf_support | 0 .../sonic_platform/__init__.py | 2 + .../sonic_platform/chassis.py | 255 ++ .../sonic_platform/component.py | 172 + .../sonic_platform/eeprom.py | 134 + .../sonic_platform/event.py | 63 + .../sonic_platform/fan.py | 284 ++ .../sonic_platform/fan_drawer.py | 90 + .../sonic_platform/helper.py | 117 + .../sonic_platform/platform.py | 21 + .../sonic_platform/psu.py | 269 ++ .../sonic_platform/sfp.py | 484 +++ .../sonic_platform/thermal.py | 236 ++ .../installer.conf | 1 - .../plugins/sfputil.py | 2 +- .../pmon_daemon_control.json | 2 +- .../sonic_platform/__init__.py | 2 +- .../sonic_platform/chassis.py | 94 +- .../sonic_platform/component.py | 58 +- .../sonic_platform/eeprom.py | 7 +- .../sonic_platform/event.py | 47 +- .../sonic_platform/fan.py | 95 +- .../sonic_platform/fan_drawer.py | 90 + .../sonic_platform/helper.py | 2 +- .../sonic_platform/psu.py | 23 +- .../sonic_platform/sfp.py | 730 +---- .../sonic_platform/thermal.py | 131 +- .../system_health_monitoring_config.json | 15 + .../pddf/pd-plugin.json | 67 - .../pddf/pddf-device.json | 2916 ----------------- .../x86_64-accton_as7326_56x-r0/pddf_support | 0 .../plugins/eeprom.py | 7 +- .../pmon_daemon_control.json | 2 +- .../sonic_platform/__init__.py | 2 + .../sonic_platform/chassis.py | 264 ++ .../sonic_platform/component.py | 161 + .../sonic_platform/eeprom.py | 139 + .../sonic_platform/event.py | 60 + .../sonic_platform/fan.py | 270 ++ .../sonic_platform/fan_drawer.py | 90 + .../sonic_platform/platform.py | 21 + .../sonic_platform/psu.py | 264 ++ .../sonic_platform/sfp.py | 626 ++++ .../sonic_platform/thermal.py | 232 ++ .../system_health_monitoring_config.json | 15 + .../pddf/pd-plugin.json | 64 - .../x86_64-accton_as7816_64x-r0/pddf_support | 0 .../pmon_daemon_control.json | 3 +- .../sonic_platform/__init__.py | 2 + .../sonic_platform/chassis.py | 250 ++ .../sonic_platform/component.py | 177 + .../sonic_platform/eeprom.py | 134 + .../sonic_platform/event.py | 62 + .../sonic_platform/fan.py | 263 ++ .../sonic_platform/fan_drawer.py | 90 + .../sonic_platform/helper.py | 117 + .../sonic_platform/platform.py | 21 + .../sonic_platform/psu.py | 283 ++ .../sonic_platform/sfp.py | 506 +++ .../sonic_platform/thermal.py | 236 ++ .../system_health_monitoring_config.json | 15 + .../as4630-54pe/modules/Makefile | 5 +- .../modules/x86-64-accton-as4630-54pe-cpld.c | 1 - .../modules/x86-64-accton-as4630-54pe-leds.c | 30 +- .../modules/x86-64-accton-as4630-54pe-psu.c | 0 .../as4630-54pe-pddf-platform-monitor.service | 16 - ...4pe-platform-handle-mgmt-interface.service | 11 + .../service/pddf-platform-init.service | 1 - .../as4630-54pe/sonic_platform_setup.py | 13 +- .../utils/accton_as4630_54pe_util.py | 70 +- .../utils/handle_mgmt_interface.sh | 9 + .../as5835-54x/classes/fanutil.py | 15 +- .../as5835-54x/classes/thermalutil.py | 89 +- .../utils/accton_as5835_54x_monitor.py | 4 +- .../utils/accton_as5835_54x_util.py | 40 +- .../as7326-56x/classes/fanutil.py | 4 +- .../modules/accton_as7326_56x_leds.c | 2 +- .../as7326-56x-pddf-platform-monitor.service | 16 - .../as7326-platform-handle_mac.service | 2 +- .../service/pddf-platform-init.service | 1 - .../as7326-56x/sonic_platform_setup.py | 9 +- .../as7326-56x/utils/accton_as7326_monitor.py | 12 +- .../as7326-56x/utils/accton_as7326_util.py | 339 +- .../as7816-64x/classes/fanutil.py | 4 +- .../as7816-64x/classes/thermalutil.py | 4 +- .../service/as7816-64x-platform-init.service | 17 + ...ce => as7816-64x-platform-monitor.service} | 5 +- .../service/as7816-platform-init.service | 13 - .../service/pddf-platform-init.service | 1 - .../as7816-64x/sonic_platform_setup.py | 11 +- ...onitor.py => accton_as7816_64x_monitor.py} | 2 +- ...7816_util.py => accton_as7816_64x_util.py} | 74 +- .../common/modules/ym2651y.c | 90 +- .../sonic-platform-accton-as4630-54pe.install | 2 +- ...sonic-platform-accton-as4630-54pe.postinst | 8 - .../sonic-platform-accton-as7326-56x.install | 3 +- .../sonic-platform-accton-as7816-64x.install | 3 +- 99 files changed, 7422 insertions(+), 4357 deletions(-) delete mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json delete mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf_support create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/__init__.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/chassis.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/component.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/eeprom.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/event.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/fan.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/fan_drawer.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/helper.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/platform.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/psu.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/sfp.py create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/thermal.py create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan_drawer.py create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json delete mode 100644 device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json delete mode 100644 device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json delete mode 100644 device/accton/x86_64-accton_as7326_56x-r0/pddf_support create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/__init__.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/chassis.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/component.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/eeprom.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/event.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/fan.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/fan_drawer.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/platform.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/psu.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/sfp.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/thermal.py create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/system_health_monitoring_config.json delete mode 100644 device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json delete mode 100644 device/accton/x86_64-accton_as7816_64x-r0/pddf_support create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/__init__.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/chassis.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/component.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/eeprom.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/event.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/fan.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/fan_drawer.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/helper.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/platform.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/psu.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/sfp.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/thermal.py create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/system_health_monitoring_config.json mode change 100755 => 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/Makefile mode change 100755 => 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-cpld.c mode change 100755 => 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-psu.c delete mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-platform-handle-mgmt-interface.service delete mode 120000 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service create mode 100755 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/handle_mgmt_interface.sh delete mode 100644 platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service delete mode 120000 platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-init.service rename platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/{as7816-pddf-platform-monitor.service => as7816-64x-platform-monitor.service} (64%) delete mode 100755 platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-platform-init.service delete mode 120000 platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service rename platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/{accton_as7816_monitor.py => accton_as7816_64x_monitor.py} (99%) rename platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/{accton_as7816_util.py => accton_as7816_64x_util.py} (80%) delete mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/Accton-AS4630-54PE/hx5-as4630-48x1G+4x25G+2x100G.bcm b/device/accton/x86_64-accton_as4630_54pe-r0/Accton-AS4630-54PE/hx5-as4630-48x1G+4x25G+2x100G.bcm index 331f6d002647..a5e7903abf24 100755 --- a/device/accton/x86_64-accton_as4630_54pe-r0/Accton-AS4630-54PE/hx5-as4630-48x1G+4x25G+2x100G.bcm +++ b/device/accton/x86_64-accton_as4630_54pe-r0/Accton-AS4630-54PE/hx5-as4630-48x1G+4x25G+2x100G.bcm @@ -1,4 +1,4 @@ -stable_size=71303168 +stable_size=76303168 #polarity/lanemap is using TH2 style. core_clock_frequency=893 diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json deleted file mode 100644 index 0abf66aab7a5..000000000000 --- a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "XCVR": - { - "xcvr_present": - { - "i2c": - { - "valmap-SFP28": {"1":true, "0":false }, - "valmap-QSFP28": {"1":true, "0":false} - } - } - }, - - "PSU": - { - "psu_present": - { - "i2c": - { - "valmap": { "1":true, "0":false } - } - }, - - "psu_power_good": - { - "i2c": - { - "valmap": { "1": true, "0":false } - } - }, - - "psu_fan_dir": - { - "i2c": - { - "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } - } - }, - - "PSU_FAN_MAX_SPEED":"18000" - }, - - "FAN": - { - "direction": - { - "i2c": - { - "valmap": {"1":"EXHAUST", "0":"INTAKE"} - } - }, - - "present": - { - "i2c": - { - "valmap": {"1":true, "0":false} - } - }, - - "duty_cycle_to_pwm": "lambda dc: ((dc*100.0)/625)", - - "pwm_to_duty_cycle": "lambda pwm: ((pwm*625.0)/100)" - } - -} diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf_support b/device/accton/x86_64-accton_as4630_54pe-r0/pddf_support deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..73a7720e8979 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-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_as4630_54pe-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..310d0433d8bc --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/chassis.py @@ -0,0 +1,255 @@ +############################################################################# +# 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 = 3 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 3 +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 = "which systemctl > /dev/null 2>&1" +SYSLED_FNODE = "/sys/class/leds/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.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._sfpevent = SfpEvent(self._sfp_list) + 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._eeprom.get_product_name() + + 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() + + return self._sfpevent.get_sfp_event(timeout) + + 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_as4630_54pe-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/component.py new file mode 100644 index 000000000000..53a01c1f1475 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/component.py @@ -0,0 +1,172 @@ +############################################################################# +# 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" +} +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 + + 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_as4630_54pe-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..64a484faf5cf --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/eeprom.py @@ -0,0 +1,134 @@ +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/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 _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) + + def get_product_name(self): + return self._eeprom.get('0x21', NULL) diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/event.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/event.py new file mode 100644 index 000000000000..96f853402abb --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/event.py @@ -0,0 +1,63 @@ +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") + +POLL_INTERVAL_IN_SEC = 1 + +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() + self._sfp_change_event_data = {'present': 0} + + def get_presence_bitmap(self): + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.port_num-1 + if modpres: + bitmap = bitmap | (1 << i) + return bitmap + + def get_sfp_event(self, timeout=2000): + #now = time.time() + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: + 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 + return True, change_dict + else: + return True, change_dict diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..eb9d526217bb --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/fan.py @@ -0,0 +1,284 @@ +############################################################################# +# 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-0060/fan_" +I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +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" + }, +} + + +FAN_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", + "FAN-3F", "FAN-3R"] + +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, 'direction_', self.fan_tray_index+1) + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if int(val, 10)==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_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, 'present_', self.fan_tray_index+1) + + 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, 'fault_', self.fan_tray_index+1) + 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_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_as4630_54pe-r0/sonic_platform/fan_drawer.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..17d339ee55f6 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-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_as4630_54pe-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..b124ca29f0df --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-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_as4630_54pe-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-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_54pe-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..6f21de491b38 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/psu.py @@ -0,0 +1,269 @@ +############################################################################# +# 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": 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() + + 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 + + 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_as4630_54pe-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..c421761025cf --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/sfp.py @@ -0,0 +1,484 @@ +############################################################################# +# 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.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + 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/" + +class Sfp(SfpOptoeBase): + """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 = "which systemctl > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as4630_54pe-r0" + HWSKU = "Accton-AS4630-54PE" + + _port_to_i2c_mapping = { + 49: 18, + 50: 19, + 51: 20, + 52: 21, + 53: 22, + 54: 23, + } + + def __init__(self, sfp_index=0): + SfpOptoeBase.__init__(self) + 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]) + + def get_eeprom_path(self): + return self.port_to_eeprom_mapping[self.port_num] + + 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_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.port_num < 53: #Copper port and sfp ports are suported. + 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 + + 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 + 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 + 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) + + 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 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 < 53: #Copper port and sfp ports are not supported. + 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 < 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._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 < 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 IOError as e: + 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 + """ + name = None + 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_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() + + 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_as4630_54pe-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..938afca80e9e --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/sonic_platform/thermal.py @@ -0,0 +1,236 @@ +############################################################################# +# 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_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 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_I2C_MAPPING[psu_index]["num"] + psu_i2c_addr = PSU_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: "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): + 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") + + + 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 self.index+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/installer.conf b/device/accton/x86_64-accton_as5835_54x-r0/installer.conf index a0944fd0e30f..735fa7992dbc 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/installer.conf +++ b/device/accton/x86_64-accton_as5835_54x-r0/installer.conf @@ -2,4 +2,3 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off modprobe.blacklist=i2c-ismt,i2c_ismt,i2c-i801,i2c_i801" - diff --git a/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py index b18b15f3e68c..0c815452a7a4 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py @@ -148,7 +148,7 @@ def get_cage_num(self, port_num): cage_num = port_num if (port_num >= self.QSFP_PORT_START): cage_num = (port_num - self.QSFP_PORT_START)/4 - cage_num = cage_num + self.QSFP_PORT_START + cage_num = int(cage_num + self.QSFP_PORT_START) return cage_num 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/sonic_platform/__init__.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/__init__.py index 43435472a423..73a7720e8979 100644 --- 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 @@ -1,2 +1,2 @@ -__all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp', 'thermal', 'fan'] +__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 index 49805d6d7858..dce9f3c150cd 100644 --- 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 @@ -28,7 +28,14 @@ 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" +HOST_CHK_CMD = "which systemctl > /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", + "3" : "STATUS_LED_COLOR_AMBER" +} class Chassis(ChassisBase): @@ -37,7 +44,6 @@ class Chassis(ChassisBase): 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 = {} @@ -54,15 +60,16 @@ def __initialize_sfp(self): for index in range(0, PORT_END): sfp = Sfp(index) self._sfp_list.append(sfp) + self._sfpevent = SfpEvent(self._sfp_list) 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) - + 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): @@ -84,12 +91,12 @@ def __initialize_components(self): 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 @@ -101,23 +108,14 @@ def __read_txt_file(self, file_path): except IOError: pass return None - - 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_name(self): """ Retrieves the name of the device Returns: string: The name of the device """ - - return self._api_helper.hwsku + return self._eeprom.get_product_name() def get_presence(self): """ @@ -144,7 +142,15 @@ def get_base_mac(self): """ return self._eeprom.get_mac() - def get_serial_number(self): + 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: @@ -173,7 +179,7 @@ def get_reboot_cause(self): 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" @@ -185,10 +191,7 @@ 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 + return self._sfpevent.get_sfp_event(timeout) def get_sfp(self, index): """ @@ -212,3 +215,40 @@ def get_sfp(self, index): 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 index deebd5936d0d..f3c9b3cee754 100644 --- 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 @@ -1,5 +1,5 @@ ############################################################################# -# Celestica +# Edgecore # # Component contains an implementation of SONiC Platform Base API and # provides the components firmware management function @@ -67,14 +67,14 @@ def __get_bios_version(self): with open(BIOS_VERSION_PATH, 'r') as fd: bios_version = fd.read() return bios_version.strip() - except Exception as e: + 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: + 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) @@ -126,3 +126,55 @@ def install_firmware(self, image_path): 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 index f3bdcbccad3f..bc9041d56b53 100644 --- 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 @@ -20,7 +20,7 @@ class Tlv(eeprom_tlvinfo.TlvInfoDecoder): EEPROM_DECODE_HEADLINES = 6 def __init__(self): - self._eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom" + self._eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom" super(Tlv, self).__init__(self._eeprom_path, 0, '', True) self._eeprom = self._load_eeprom() @@ -123,9 +123,12 @@ def get_eeprom(self): 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) + + def get_product_name(self): + return self._eeprom.get('0x21', 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 index d77ee8c29dc5..7ce2598732e2 100644 --- 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 @@ -1,42 +1,49 @@ 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") +POLL_INTERVAL_IN_SEC = 1 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() + self._sfp_change_event_data = {'present': 0} - 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 - + def get_presence_bitmap(self): bitmap = 0 for sfp in self._sfp_list: modpres = sfp.get_presence() i=sfp.port_num-1 if modpres: bitmap = bitmap | (1 << i) + return bitmap - changed_ports = self.sfp_change_event_data['present'] ^ bitmap - if changed_ports: + def get_sfp_event(self, timeout=2000): + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: for sfp in self._sfp_list: i=sfp.port_num-1 if (changed_ports & (1 << i)): @@ -47,9 +54,7 @@ def get_sfp_event(self, timeout=2000): # 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 + self._sfp_change_event_data['present'] = bitmap 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 index cf698bf6d014..8cb1c17fdf72 100644 --- 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 @@ -15,9 +15,10 @@ raise ImportError(str(e) + "- required module not found") PSU_FAN_MAX_RPM = 26688 -CPLD_I2C_PATH = "/sys/bus/i2c/devices/3-0063/fan" -PSU_HWMON_I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" -PSU_I2C_MAPPING = { +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" @@ -28,6 +29,20 @@ }, } + +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"] @@ -42,13 +57,18 @@ def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): 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 = 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): """ @@ -60,9 +80,9 @@ def get_direction(self): if not self.is_psu_fan: - dir_str = "{}{}{}".format(CPLD_I2C_PATH, self.fan_tray_index+1, '_direction') + 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 val is not None: if int(val, 10)==0: direction=self.FAN_DIRECTION_EXHAUST else: @@ -90,26 +110,26 @@ def get_speed(self): 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 + 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_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 @@ -123,7 +143,7 @@ def get_target_speed(self): 0 : when PWM mode is use pwm : when pwm mode is not use """ - return False #Not supported + return self.get_speed() def get_speed_tolerance(self): """ @@ -132,7 +152,7 @@ def get_speed_tolerance(self): An integer, the percentage of variance from target speed which is considered tolerable """ - return False #Not supported + return SPEED_TOLERANCE def set_speed(self, speed): """ @@ -146,7 +166,7 @@ def set_speed(self, speed): """ if not self.is_psu_fan and self.get_presence(): - speed_path = "{}{}".format(CPLD_I2C_PATH, '_duty_cycle_percentage') + speed_path = "{}{}".format(CPLD_FAN_I2C_PATH, '_duty_cycle_percentage') return self._api_helper.write_txt_file(speed_path, int(speed)) return False @@ -195,17 +215,18 @@ def get_presence(self): Returns: bool: True if FAN is present, False if not """ - present_path = "{}{}{}".format(CPLD_I2C_PATH, self.fan_tray_index+1, '_present') + + + 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 not self.is_psu_fan: - if val is not None: - return int(val, 10)==1 - else: - return False - + if val is not None: + return int(val, 10)==1 else: - return True + return False def get_status(self): """ @@ -221,7 +242,7 @@ def get_status(self): else: return False else: - path = "{}{}{}".format(CPLD_I2C_PATH, self.fan_index+1, '_fault') + 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 @@ -245,3 +266,25 @@ def get_serial(self): 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_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 index 4cd60ac90611..b124ca29f0df 100644 --- 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 @@ -51,7 +51,7 @@ def run_interactive_command(self, cmd): def read_txt_file(self, file_path): try: - with open(file_path, 'r') as fd: + with open(file_path, 'r', errors='replace') as fd: data = fd.read() return data.strip() except IOError: 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 index dd6058920667..c2baa2ebf26a 100644 --- 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 @@ -10,7 +10,7 @@ try: from sonic_platform_base.psu_base import PsuBase - #from sonic_platform.fan import Fan + from sonic_platform.thermal import Thermal from .helper import APIHelper except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -64,6 +64,8 @@ def __initialize_fan(self): 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) + + self._thermal_list.append(Thermal(is_psu=True, psu_index=self.index)) def get_voltage(self): """ @@ -154,7 +156,7 @@ def get_temperature(self): return float(val)/1000 else: return 0 - + def get_temperature_high_threshold(self): """ Retrieves the high threshold temperature of PSU @@ -251,3 +253,20 @@ def get_serial(self): 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 index f8f87532f085..ec16e80568f4 100644 --- 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 @@ -13,108 +13,14 @@ 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 sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase 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): +class Sfp(SfpOptoeBase): """Platform-specific Sfp class""" # Port number @@ -125,7 +31,7 @@ class Sfp(SfpBase): # 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" + HOST_CHK_CMD = "which systemctl > /dev/null 2>&1" PLATFORM = "x86_64-accton_as5835_54x-r0" HWSKU = "Accton-AS5835-54X" @@ -194,6 +100,7 @@ class Sfp(SfpBase): } def __init__(self, sfp_index=0): + SfpOptoeBase.__init__(self) self._api_helper=APIHelper() # Init index self.index = sfp_index @@ -204,44 +111,15 @@ def __init__(self, sfp_index=0): 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', 'vendor_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 get_eeprom_path(self): + return self.port_to_eeprom_mapping[self.port_num] + # 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 @@ -277,422 +155,6 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes): 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 - vendor_rev |1*255VCHAR |vendor revision 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) - - 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['vendor_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 @@ -725,8 +187,10 @@ def get_rx_los(self): 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 + 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: @@ -743,15 +207,18 @@ def get_rx_los(self): 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 + return rx_los_list + else: + return [False]*4 def get_tx_fault(self): """ Retrieves the TX fault status of SFP Returns: - A Boolean, True if SFP has TX fault, False if not + 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 @@ -761,8 +228,10 @@ def get_tx_fault(self): 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 + 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: @@ -778,15 +247,19 @@ def get_tx_fault(self): 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 + else: + return [False]*4 - 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 + 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 @@ -806,10 +279,11 @@ def get_tx_disable(self): # 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 + if int(tx_disable, 10)==0: + return [False] else: - return False + return [True] + else: tx_disable_list = [] @@ -829,8 +303,9 @@ def get_tx_disable(self): 'On' == dom_control_data['data']['TX3Disable']['value']) tx_disable_list.append( 'On' == dom_control_data['data']['TX4Disable']['value']) - - return tx_disable_list + return tx_disable_list + else: + return [False]*4 def get_tx_disable_channel(self): """ @@ -841,18 +316,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. """ - 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 + 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): """ @@ -915,78 +386,6 @@ def get_power_override(self): 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. @@ -1000,15 +399,15 @@ def reset(self): 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: - time.sleep(0.01) - ret = self.self._api_helper.write_txt_file(reset_path, 0) - time.sleep(0.2) return ret - else: - return False + 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): """ @@ -1120,7 +519,7 @@ def set_lpmode(self, lpmode): if self.port_num < 49: return False # SFP doesn't support this feature else: - if lpmode is True: + if lpmode: self.set_power_override(True, True) else: self.set_power_override(False, False) @@ -1195,28 +594,27 @@ def get_presence(self): else: return False - def get_model(self): + def get_status(self): """ - Retrieves the model number (or part number) of the device + Retrieves the operational status of the device Returns: - string: Model/part number of device + A boolean value, True if device is operating properly, False if not """ - transceiver_dom_info_dict = self.get_transceiver_info() - return transceiver_dom_info_dict.get("model", "N/A") + return self.get_presence() - def get_serial(self): + def get_position_in_parent(self): """ - Retrieves the serial number of the device + 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: - string: Serial number of device + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position """ - transceiver_dom_info_dict = self.get_transceiver_info() - return transceiver_dom_info_dict.get("serial", "N/A") + return self.port_num - def get_status(self): + def is_replaceable(self): """ - Retrieves the operational status of the device + Indicate whether this device is replaceable. Returns: - A boolean value, True if device is operating properly, False if not + bool: True if it is replaceable. """ - return self.get_presence() and self.get_transceiver_bulk_status() + 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 index 46458d02a118..4d06ad170cba 100644 --- 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 @@ -15,22 +15,53 @@ 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" + }, +} + +THERMAL_NAME_LIST = ["Temp sensor 1", "Temp sensor 2", + "Temp sensor 3", "Temp sensor 4"] + +PSU_THERMAL_NAME_LIST = ["PSU-1 temp sensor 1", "PSU-2 temp sensor 2"] + +SYSFS_PATH = "/sys/bus/i2c/devices" class Thermal(ThermalBase): """Platform-specific Thermal class""" - THERMAL_NAME_LIST = [] - SYSFS_PATH = "/sys/bus/i2c/devices" - - def __init__(self, thermal_index=0): + def __init__(self, thermal_index=0, is_psu=False, psu_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.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) + # Set hwmon path i2c_path = { 0: "18-004b/hwmon/hwmon*/", @@ -38,9 +69,9 @@ def __init__(self, thermal_index=0): 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.hwmon_path = "{}/{}".format(SYSFS_PATH, i2c_path) + self.ss_key = THERMAL_NAME_LIST[self.index] self.ss_index = 1 def __read_txt_file(self, file_path): @@ -51,20 +82,23 @@ def __read_txt_file(self, file_path): 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) + 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 - + 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: @@ -73,6 +107,8 @@ def __set_threshold(self, file_name, temperature): return True except IOError as e: print("IOError") + return False + def get_temperature(self): @@ -82,7 +118,11 @@ 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) + 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): @@ -92,6 +132,9 @@ 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 """ + if self.is_psu: + return 80 + temp_file = "temp{}_max".format(self.ss_index) return self.__get_temp(temp_file) @@ -116,7 +159,10 @@ def get_name(self): Returns: string: The name of the thermal device """ - return self.THERMAL_NAME_LIST[self.index] + if self.is_psu: + return PSU_THERMAL_NAME_LIST[self.psu_index] + else: + return THERMAL_NAME_LIST[self.index] def get_presence(self): """ @@ -124,6 +170,9 @@ def get_presence(self): 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) @@ -138,11 +187,49 @@ def get_status(self): 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: + 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 self.index+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_as7326_56x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json deleted file mode 100644 index 317cf23b7362..000000000000 --- a/device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - - "XCVR": - { - "xcvr_present": - { - "i2c": - { - "valmap-SFP": {"1":true, "0":false }, - "valmap-SFP28": {"1":true, "0":false }, - "valmap-QSFP28": {"1":true, "0":false} - } - } - }, - "PSU": - { - "psu_present": - { - "i2c": - { - "valmap": { "1":true, "0":false } - } - }, - - "psu_power_good": - { - "i2c": - { - "valmap": { "1": true, "0":false } - } - }, - - "psu_fan_dir": - { - "i2c": - { - "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } - } - }, - - "PSU_FAN_MAX_SPEED":"18000" - }, - - "FAN": - { - "direction": - { - "i2c": - { - "valmap": {"1":"INTAKE", "0":"EXHAUST"} - } - }, - - "present": - { - "i2c": - { - "valmap": {"1":true, "0":false} - } - }, - - "duty_cycle_to_pwm": "lambda dc: ((dc*100)/625 -1)", - - "pwm_to_duty_cycle": "lambda pwm: (((pwm+1)*625+75)/100)" - } - -} diff --git a/device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json deleted file mode 100644 index 78be7f2b61c9..000000000000 --- a/device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json +++ /dev/null @@ -1,2916 +0,0 @@ -{ - "PLATFORM": - { - "num_psus":2, - "num_fantrays":6, - "num_fans_pertray":2, - "num_ports":58, - "num_temps": 4, - "pddf_dev_types": - { - "description":"AS7326-56X - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", - "CPLD": - [ - "i2c_cpld" - ], - "PSU": - [ - "psu_eeprom", - "psu_pmbus" - ], - "FAN": - [ - "fan_ctrl", - "fan_eeprom" - ], - "PORT_MODULE": - [ - "pddf_xcvr" - ] - }, - "std_kos": - [ - "i2c-i801", - "i2c_dev", - "i2c_mux_pca954x", - "optoe" - ], - "pddf_kos": - [ - "pddf_client_module", - "pddf_cpld_module", - "pddf_cpld_driver", - "pddf_mux_module", - "pddf_xcvr_module", - "pddf_xcvr_driver_module", - "pddf_psu_driver_module", - "pddf_psu_module", - "pddf_fan_driver_module", - "pddf_fan_module", - "pddf_led_module", - "pddf_sysstatus_module" - ] - }, - - "SYSTEM": - { - "dev_info": {"device_type":"CPU", "device_name":"ROOT_COMPLEX", "device_parent":null}, - "i2c": - { - "CONTROLLERS": - [ - { "dev_name":"i2c-0", "dev":"SMBUS0" } - ] - } - }, - - "SMBUS0": - { - "dev_info": {"device_type": "SMBUS", "device_name": "SMBUS0", "device_parent": "SYSTEM"}, - "i2c": - { - "topo_info": {"dev_addr": "0x0"}, - "DEVICES": - [ - {"dev": "EEPROM1"}, - {"dev": "CPU_CPLD"}, - {"dev": "MUX1"} - ] - } - }, - - "EEPROM1": - { - "dev_info": {"device_type": "EEPROM", "device_name": "EEPROM1", "device_parent": "SMBUS0"}, - "i2c": - { - "topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c04"}, - "dev_attr": {"access_mode": "BLOCK"}, - "attr_list": [ - {"attr_name": "eeprom"} - ] - } - }, - - "CPU_CPLD": - { - "dev_info": { "device_type":"CPLD", "device_name":"CPU_CPLD", "device_parent":"SMBUS0"}, - "i2c": - { - "topo_info": { "parent_bus":"0x0", "dev_addr":"0x65", "dev_type":"i2c_cpld"}, - "dev_attr": { } - } - }, - - "MUX1": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX1", "device_parent":"SMBUS0"}, - "i2c": - { - "topo_info": { "parent_bus":"0x0", "dev_addr":"0x77", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x1"}, - "channel": - [ - { "chn":"0", "dev":"MUX2" }, - { "chn":"0", "dev":"MUX3" }, - { "chn":"1", "dev":"MUX4" } - - ] - } - }, - "MUX2": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX2", "device_parent":"MUX1"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1", "dev_addr":"0x70", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x9"}, - "channel": - [ - { "chn":"2", "dev":"FAN-CTRL" }, - { "chn":"3", "dev":"CPLD2" }, - { "chn":"4", "dev":"PSU2" } , - { "chn":"6", "dev":"TEMP1" }, - { "chn":"6", "dev":"TEMP2" }, - { "chn":"6", "dev":"TEMP3" }, - { "chn":"6", "dev":"TEMP4" } - ] - } - }, - "MUX3": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX3", "device_parent":"MUX1"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1", "dev_addr":"0x71", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x11"}, - "channel": - [ - { "chn":"0", "dev":"PSU1" }, - { "chn":"1", "dev":"CPLD1" }, - { "chn":"2", "dev":"CPLD3" }, - { "chn":"5", "dev":"PORT57" }, - { "chn":"6", "dev":"PORT58" }, - { "chn":"7", "dev":"MUX11" } - ] - } - }, - "MUX4": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX4", "device_parent":"MUX1"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2", "dev_addr":"0x70", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x21"}, - "channel": - [ - { "chn":"0", "dev":"MUX5" }, - { "chn":"1", "dev":"MUX6" }, - { "chn":"2", "dev":"MUX7" }, - { "chn":"3", "dev":"MUX8" }, - { "chn":"4", "dev":"MUX9" }, - { "chn":"5", "dev":"MUX10" } - ] - } - }, - "PSU2": - { - "dev_info": { "device_type":"PSU", "device_name":"PSU2", "device_parent":"MUX2" }, - "dev_attr": { "dev_idx":"2", "num_psu_fans":"1"}, - "i2c": - { - "interface": - [ - { "itf":"pmbus", "dev":"PSU2-PMBUS"} - ] - } - }, - - "PSU2-PMBUS": - { - "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU2-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xd", "dev_addr":"0x5b", "dev_type":"psu_pmbus"}, - "attr_list": - [ - { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, - { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, - { "attr_name":"psu_serial_num", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"20" }, - { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, - { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} - ] - } - }, - - "PSU1": - { - "dev_info": { "device_type":"PSU", "device_name":"PSU1", "device_parent":"MUX3" }, - "dev_attr": { "dev_idx":"1", "num_psu_fans":"1"}, - "i2c": - { - "interface": - [ - { "itf":"pmbus", "dev":"PSU1-PMBUS"} - ] - } - }, - - "PSU1-PMBUS": - { - "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU1-PMBUS", "device_parent":"MUX3", "virt_parent":"PSU1"}, - "i2c": - { - "topo_info": { "parent_bus":"0x11", "dev_addr":"0x59", "dev_type":"psu_pmbus"}, - "attr_list": - [ - { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"psu_model_name", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, - { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"psu_mfr_id", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, - { "attr_name":"psu_serial_num", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x9e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"20" }, - { "attr_name":"psu_fan_dir", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, - { "attr_name":"psu_v_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_i_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_p_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} - ] - } - }, - - "CPLD1": - { - "dev_info": { "device_type":"CPLD", "device_name":"CPLD1", "device_parent":"MUX3"}, - "i2c": - { - "topo_info": { "parent_bus":"0x12", "dev_addr":"0x60", "dev_type":"i2c_cpld"}, - "dev_attr":{} - } - }, - "CPLD2": - { - "dev_info": { "device_type":"CPLD", "device_name":"CPLD2", "device_parent":"MUX2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xc", "dev_addr":"0x62", "dev_type":"i2c_cpld"}, - "dev_attr":{} - } - }, - "CPLD3": - { - "dev_info": { "device_type":"CPLD", "device_name":"CPLD3", "device_parent":"MUX3"}, - "i2c": - { - "topo_info": { "parent_bus":"0x13", "dev_addr":"0x64", "dev_type":"i2c_cpld"}, - "dev_attr":{} - } - }, - "TEMP1" : - { - "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xf", "dev_addr":"0x48", "dev_type":"lm75"}, - "attr_list": - [ - { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, - { "attr_name": "temp1_max_hyst"}, - { "attr_name": "temp1_input"} - ] - } - }, - "TEMP2" : - { - "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xf", "dev_addr":"0x49", "dev_type":"lm75"}, - "attr_list": - [ - { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, - { "attr_name": "temp1_max_hyst"}, - { "attr_name": "temp1_input"} - ] - } - }, - "TEMP3" : - { - "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xf", "dev_addr":"0x4A", "dev_type":"lm75"}, - "attr_list": - [ - { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, - { "attr_name": "temp1_max_hyst"}, - { "attr_name": "temp1_input"} - ] - } - }, - "TEMP4" : - { - "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xf", "dev_addr":"0x4B", "dev_type":"lm75"}, - "attr_list": - [ - { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, - { "attr_name": "temp1_max_hyst"}, - { "attr_name": "temp1_input"} - ] - } - }, - "FAN-CTRL": - { - "dev_info": { "device_type":"FAN", "device_name":"FAN-CTRL", "device_parent":"MUX2"}, - "i2c": - { - "topo_info": { "parent_bus":"0xb", "dev_addr":"0x66", "dev_type":"fan_ctrl"}, - "dev_attr": { "num_fantrays":"5"}, - "attr_list": - [ - { "attr_name":"fan1_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan2_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan3_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan4_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan5_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan6_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan7_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan8_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan9_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan10_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan11_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan12_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"fan1_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"fan2_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"fan3_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"fan4_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"fan5_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"fan6_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"fan7_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"fan8_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"fan9_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"fan10_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"fan11_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"fan12_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"fan1_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x12", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, - { "attr_name":"fan2_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x22", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, - { "attr_name":"fan3_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x13", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, - { "attr_name":"fan4_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x23", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, - { "attr_name":"fan5_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x14", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, - { "attr_name":"fan6_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x24", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, - { "attr_name":"fan7_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x15", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, - { "attr_name":"fan8_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x25", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, - { "attr_name":"fan9_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x16", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, - { "attr_name":"fan10_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x26", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, - { "attr_name":"fan11_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x17", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, - { "attr_name":"fan12_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x27", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, - { "attr_name":"fan1_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan2_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan3_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan4_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan5_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan6_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan7_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan8_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan9_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan10_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan11_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, - { "attr_name":"fan12_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" } - ] - } - }, - "PORT57": - { - "dev_info": { "device_type":"SFP", "device_name":"PORT57", "device_parent":"MUX3"}, - "dev_attr": { "dev_idx":"57"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT57-EEPROM" }, - { "itf":"control", "dev":"PORT57-CTRL" } - ] - } - }, - "PORT57-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT57-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT57"}, - "i2c": - { - "topo_info": { "parent_bus":"0x16", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT57-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT57-CTRL", "device_parent":"MUX3", "virt_parent":"PORT57"}, - "i2c": - { - "topo_info": { "parent_bus":"0x16", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1c", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - "PORT58": - { - "dev_info": { "device_type":"SFP", "device_name":"PORT58", "device_parent":"MUX3"}, - "dev_attr": { "dev_idx":"58"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT58-EEPROM" }, - { "itf":"control", "dev":"PORT58-CTRL" } - ] - } - }, - "PORT58-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT58-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT58"}, - "i2c": - { - "topo_info": { "parent_bus":"0x17", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT58-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT58-CTRL", "device_parent":"MUX3", "virt_parent":"PORT58"}, - "i2c": - { - "topo_info": { "parent_bus":"0x17", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1c", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - "MUX5": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX5", "device_parent":"MUX4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x21", "dev_addr":"0x71", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x29"}, - "channel": - [ - { "chn":"0", "dev":"PORT2" }, - { "chn":"1", "dev":"PORT1" }, - { "chn":"2", "dev":"PORT4" }, - { "chn":"3", "dev":"PORT3" }, - { "chn":"4", "dev":"PORT6" }, - { "chn":"5", "dev":"PORT7" }, - { "chn":"6", "dev":"PORT5" }, - { "chn":"7", "dev":"PORT9" } - ] - } - }, - "MUX6": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX6", "device_parent":"MUX4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x22", "dev_addr":"0x72", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x31"}, - "channel": - [ - { "chn":"0", "dev":"PORT10" }, - { "chn":"1", "dev":"PORT8" }, - { "chn":"2", "dev":"PORT12" }, - { "chn":"3", "dev":"PORT11" }, - { "chn":"4", "dev":"PORT13" }, - { "chn":"5", "dev":"PORT16" }, - { "chn":"6", "dev":"PORT15" }, - { "chn":"7", "dev":"PORT14" } - ] - } - }, - "MUX7": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX7", "device_parent":"MUX4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x23", "dev_addr":"0x73", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x39"}, - "channel": - [ - { "chn":"0", "dev":"PORT18" }, - { "chn":"1", "dev":"PORT17" }, - { "chn":"2", "dev":"PORT20" }, - { "chn":"3", "dev":"PORT19" }, - { "chn":"4", "dev":"PORT21" }, - { "chn":"5", "dev":"PORT23" }, - { "chn":"6", "dev":"PORT22" }, - { "chn":"7", "dev":"PORT24" } - ] - } - }, - "MUX8": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX8", "device_parent":"MUX4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x24", "dev_addr":"0x74", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x41"}, - "channel": - [ - { "chn":"0", "dev":"PORT27" }, - { "chn":"1", "dev":"PORT25" }, - { "chn":"2", "dev":"PORT28" }, - { "chn":"3", "dev":"PORT26" }, - { "chn":"4", "dev":"PORT29" }, - { "chn":"5", "dev":"PORT32" }, - { "chn":"6", "dev":"PORT30" }, - { "chn":"7", "dev":"PORT31" } - ] - } - }, - "MUX9": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX9", "device_parent":"MUX4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x25", "dev_addr":"0x75", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x49"}, - "channel": - [ - { "chn":"0", "dev":"PORT34" }, - { "chn":"1", "dev":"PORT33" }, - { "chn":"2", "dev":"PORT36" }, - { "chn":"3", "dev":"PORT35" }, - { "chn":"4", "dev":"PORT37" }, - { "chn":"5", "dev":"PORT39" }, - { "chn":"6", "dev":"PORT38" }, - { "chn":"7", "dev":"PORT40" } - ] - } - }, - "MUX10": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX10", "device_parent":"MUX4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x26", "dev_addr":"0x76", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x51"}, - "channel": - [ - { "chn":"0", "dev":"PORT41" }, - { "chn":"1", "dev":"PORT42" }, - { "chn":"2", "dev":"PORT45" }, - { "chn":"3", "dev":"PORT43" }, - { "chn":"4", "dev":"PORT44" }, - { "chn":"5", "dev":"PORT48" }, - { "chn":"6", "dev":"PORT46" }, - { "chn":"7", "dev":"PORT47" } - ] - } - }, - "MUX11": - { - "dev_info": { "device_type":"MUX", "device_name":"MUX11", "device_parent":"MUX3"}, - "i2c": - { - "topo_info": { "parent_bus":"0x18", "dev_addr":"0x72", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x19"}, - "channel": - [ - { "chn":"0", "dev":"PORT49" }, - { "chn":"1", "dev":"PORT50" }, - { "chn":"2", "dev":"PORT51" }, - { "chn":"3", "dev":"PORT52" }, - { "chn":"4", "dev":"PORT53" }, - { "chn":"5", "dev":"PORT54" }, - { "chn":"6", "dev":"PORT55" }, - { "chn":"7", "dev":"PORT56" } - ] - } - }, - - - - "PORT2": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT2", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"2"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT2-EEPROM" }, - { "itf":"control", "dev":"PORT2-CTRL" } - ] - } - }, - "PORT2-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT2-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT2"}, - "i2c": - { - "topo_info": { "parent_bus":"0x29", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT2-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT2-CTRL", "device_parent":"MUX5", "virt_parent":"PORT2"}, - "i2c": - { - "topo_info": { "parent_bus":"0x29", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xb", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - "PORT1": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT1", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"1"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT1-EEPROM" }, - { "itf":"control", "dev":"PORT1-CTRL" } - ] - } - }, - "PORT1-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT1-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT1"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT1-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT1-CTRL", "device_parent":"MUX5", "virt_parent":"PORT1"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xb", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - "PORT4": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT4", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"4"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT4-EEPROM" }, - { "itf":"control", "dev":"PORT4-CTRL" } - ] - } - }, - "PORT4-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT4-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT4-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT4-CTRL", "device_parent":"MUX5", "virt_parent":"PORT4"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - "PORT3": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT3", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"3"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT3-EEPROM" }, - { "itf":"control", "dev":"PORT3-CTRL" } - ] - } - }, - "PORT3-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT3-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT3"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT3-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT3-CTRL", "device_parent":"MUX5", "virt_parent":"PORT3"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - "PORT6": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT6", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"6"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT6-EEPROM" }, - { "itf":"control", "dev":"PORT6-CTRL" } - ] - } - }, - "PORT6-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT6-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT6"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT6-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT6-CTRL", "device_parent":"MUX5", "virt_parent":"PORT6"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} - ] - } - }, - "PORT7": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT7", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"7"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT7-EEPROM" }, - { "itf":"control", "dev":"PORT7-CTRL" } - ] - } - }, - "PORT7-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT7-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT7"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT7-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT7-CTRL", "device_parent":"MUX5", "virt_parent":"PORT7"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} - ] - } - }, - "PORT5": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT5", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"5"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT5-EEPROM" }, - { "itf":"control", "dev":"PORT5-CTRL" } - ] - } - }, - "PORT5-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT5-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT5"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT5-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT5-CTRL", "device_parent":"MUX5", "virt_parent":"PORT5"}, - "i2c": - { - "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_offset":"0xB", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} - ] - } - }, - "PORT9": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT9", "device_parent":"MUX5"}, - "dev_attr": { "dev_idx":"9"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT9-EEPROM" }, - { "itf":"control", "dev":"PORT9-CTRL" } - ] - } - }, - "PORT9-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT9-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT9"}, - "i2c": - { - "topo_info": { "parent_bus":"0x30", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT9-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT9-CTRL", "device_parent":"MUX5", "virt_parent":"PORT9"}, - "i2c": - { - "topo_info": { "parent_bus":"0x30", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_offset":"0xC", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - "PORT10": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT10", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"10"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT10-EEPROM" }, - { "itf":"control", "dev":"PORT10-CTRL" } - ] - } - }, - "PORT10-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT10-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT10"}, - "i2c": - { - "topo_info": { "parent_bus":"0x31", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT10-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT10-CTRL", "device_parent":"MUX6", "virt_parent":"PORT10"}, - "i2c": - { - "topo_info": { "parent_bus":"0x31", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - "PORT8": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT8", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"8"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT8-EEPROM" }, - { "itf":"control", "dev":"PORT8-CTRL" } - ] - } - }, - "PORT8-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT8-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT8"}, - "i2c": - { - "topo_info": { "parent_bus":"0x32", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT8-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT8-CTRL", "device_parent":"MUX6", "virt_parent":"PORT8"}, - "i2c": - { - "topo_info": { "parent_bus":"0x32", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} - ] - } - }, - "PORT12": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT12", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"12"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT12-EEPROM" }, - { "itf":"control", "dev":"PORT12-CTRL" } - ] - } - }, - "PORT12-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT12-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT12"}, - "i2c": - { - "topo_info": { "parent_bus":"0x33", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT12-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT12-CTRL", "device_parent":"MUX6", "virt_parent":"PORT12"}, - "i2c": - { - "topo_info": { "parent_bus":"0x33", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - "PORT11": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT11", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"11"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT11-EEPROM" }, - { "itf":"control", "dev":"PORT11-CTRL" } - ] - } - }, - "PORT11-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT11-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT11"}, - "i2c": - { - "topo_info": { "parent_bus":"0x34", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT11-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT11-CTRL", "device_parent":"MUX6", "virt_parent":"PORT11"}, - "i2c": - { - "topo_info": { "parent_bus":"0x34", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - "PORT13": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT13", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"13"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT13-EEPROM" }, - { "itf":"control", "dev":"PORT13-CTRL" } - ] - } - }, - "PORT13-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT13-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT13"}, - "i2c": - { - "topo_info": { "parent_bus":"0x35", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT13-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT13-CTRL", "device_parent":"MUX6", "virt_parent":"PORT13"}, - "i2c": - { - "topo_info": { "parent_bus":"0x35", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} - ] - } - }, - "PORT16": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT16", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"16"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT16-EEPROM" }, - { "itf":"control", "dev":"PORT16-CTRL" } - ] - } - }, - "PORT16-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT16-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT16"}, - "i2c": - { - "topo_info": { "parent_bus":"0x36", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT16-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT16-CTRL", "device_parent":"MUX6", "virt_parent":"PORT16"}, - "i2c": - { - "topo_info": { "parent_bus":"0x36", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} - ] - } - }, - "PORT15": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT15", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"15"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT15-EEPROM" }, - { "itf":"control", "dev":"PORT15-CTRL" } - ] - } - }, - "PORT15-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT15-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT15"}, - "i2c": - { - "topo_info": { "parent_bus":"0x37", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT15-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT15-CTRL", "device_parent":"MUX6", "virt_parent":"PORT15"}, - "i2c": - { - "topo_info": { "parent_bus":"0x37", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} - ] - } - }, - "PORT14": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT14", "device_parent":"MUX6"}, - "dev_attr": { "dev_idx":"14"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT14-EEPROM" }, - { "itf":"control", "dev":"PORT14-CTRL" } - ] - } - }, - "PORT14-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT14-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT14"}, - "i2c": - { - "topo_info": { "parent_bus":"0x38", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT14-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT14-CTRL", "device_parent":"MUX6", "virt_parent":"PORT14"}, - "i2c": - { - "topo_info": { "parent_bus":"0x38", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} - ] - } - }, - "PORT18": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT18", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"18"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT18-EEPROM" }, - { "itf":"control", "dev":"PORT18-CTRL" } - ] - } - }, - "PORT18-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT18-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT18"}, - "i2c": - { - "topo_info": { "parent_bus":"0x39", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT18-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT18-CTRL", "device_parent":"MUX7", "virt_parent":"PORT18"}, - "i2c": - { - "topo_info": { "parent_bus":"0x39", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - - "PORT17": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT17", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"17"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT17-EEPROM" }, - { "itf":"control", "dev":"PORT17-CTRL" } - ] - } - }, - "PORT17-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT17-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT17"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3a", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT17-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT17-CTRL", "device_parent":"MUX7", "virt_parent":"PORT17"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - - "PORT20": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT20", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"20"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT20-EEPROM" }, - { "itf":"control", "dev":"PORT20-CTRL" } - ] - } - }, - "PORT20-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT20-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT20"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3b", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT20-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT20-CTRL", "device_parent":"MUX7", "virt_parent":"PORT20"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - - "PORT19": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT19", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"19"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT19-EEPROM" }, - { "itf":"control", "dev":"PORT19-CTRL" } - ] - } - }, - "PORT19-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT19-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT19"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3c", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT19-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT19-CTRL", "device_parent":"MUX7", "virt_parent":"PORT19"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - - "PORT21": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT21", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"21"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT21-EEPROM" }, - { "itf":"control", "dev":"PORT21-CTRL" } - ] - } - }, - "PORT21-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT21-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT21"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3d", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT21-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT21-CTRL", "device_parent":"MUX7", "virt_parent":"PORT21"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} - ] - } - }, - - "PORT23": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT23", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"23"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT23-EEPROM" }, - { "itf":"control", "dev":"PORT23-CTRL" } - ] - } - }, - "PORT23-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT23-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT23"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3e", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT23-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT23-CTRL", "device_parent":"MUX7", "virt_parent":"PORT23"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} - ] - } - }, - - "PORT22": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT22", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"22"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT22-EEPROM" }, - { "itf":"control", "dev":"PORT22-CTRL" } - ] - } - }, - "PORT22-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT22-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT22"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3f", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT22-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT22-CTRL", "device_parent":"MUX7", "virt_parent":"PORT22"}, - "i2c": - { - "topo_info": { "parent_bus":"0x3f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} - ] - } - }, - "PORT24": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT24", "device_parent":"MUX7"}, - "dev_attr": { "dev_idx":"24"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT24-EEPROM" }, - { "itf":"control", "dev":"PORT24-CTRL" } - ] - } - }, - "PORT24-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT24-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT24"}, - "i2c": - { - "topo_info": { "parent_bus":"0x40", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT24-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT24-CTRL", "device_parent":"MUX7", "virt_parent":"PORT24"}, - "i2c": - { - "topo_info": { "parent_bus":"0x40", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} - ] - } - }, - "PORT27": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT27", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"27"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT27-EEPROM" }, - { "itf":"control", "dev":"PORT27-CTRL" } - ] - } - }, - "PORT27-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT27-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT27"}, - "i2c": - { - "topo_info": { "parent_bus":"0x41", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT27-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT27-CTRL", "device_parent":"MUX8", "virt_parent":"PORT27"}, - "i2c": - { - "topo_info": { "parent_bus":"0x41", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - "PORT25": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT25", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"25"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT25-EEPROM" }, - { "itf":"control", "dev":"PORT25-CTRL" } - ] - } - }, - "PORT25-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT25-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT25"}, - "i2c": - { - "topo_info": { "parent_bus":"0x42", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT25-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT25-CTRL", "device_parent":"MUX8", "virt_parent":"PORT25"}, - "i2c": - { - "topo_info": { "parent_bus":"0x42", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - - "PORT28": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT28", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"28"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT28-EEPROM" }, - { "itf":"control", "dev":"PORT28-CTRL" } - ] - } - }, - "PORT28-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT28-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT28"}, - "i2c": - { - "topo_info": { "parent_bus":"0x43", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT28-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT28-CTRL", "device_parent":"MUX8", "virt_parent":"PORT28"}, - "i2c": - { - "topo_info": { "parent_bus":"0x43", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - "PORT26": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT26", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"26"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT26-EEPROM" }, - { "itf":"control", "dev":"PORT26-CTRL" } - ] - } - }, - "PORT26-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT26-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT26"}, - "i2c": - { - "topo_info": { "parent_bus":"0x44", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT26-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT26-CTRL", "device_parent":"MUX8", "virt_parent":"PORT26"}, - "i2c": - { - "topo_info": { "parent_bus":"0x44", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - "PORT29": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT29", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"29"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT29-EEPROM" }, - { "itf":"control", "dev":"PORT29-CTRL" } - ] - } - }, - "PORT29-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT29-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT29"}, - "i2c": - { - "topo_info": { "parent_bus":"0x45", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT29-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT29-CTRL", "device_parent":"MUX8", "virt_parent":"PORT29"}, - "i2c": - { - "topo_info": { "parent_bus":"0x45", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} - ] - } - }, - - "PORT32": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT32", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"32"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT32-EEPROM" }, - { "itf":"control", "dev":"PORT32-CTRL" } - ] - } - }, - "PORT32-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT32-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT32"}, - "i2c": - { - "topo_info": { "parent_bus":"0x46", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT32-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT32-CTRL", "device_parent":"MUX8", "virt_parent":"PORT32"}, - "i2c": - { - "topo_info": { "parent_bus":"0x46", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - "PORT30": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT30", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"30"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT30-EEPROM" }, - { "itf":"control", "dev":"PORT30-CTRL" } - ] - } - }, - "PORT30-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT30-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT30"}, - "i2c": - { - "topo_info": { "parent_bus":"0x47", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT30-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT30-CTRL", "device_parent":"MUX8", "virt_parent":"PORT30"}, - "i2c": - { - "topo_info": { "parent_bus":"0x47", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} - ] - } - }, - - "PORT31": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT31", "device_parent":"MUX8"}, - "dev_attr": { "dev_idx":"31"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT31-EEPROM" }, - { "itf":"control", "dev":"PORT31-CTRL" } - ] - } - }, - "PORT31-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT31-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT31"}, - "i2c": - { - "topo_info": { "parent_bus":"0x48", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT31-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT31-CTRL", "device_parent":"MUX8", "virt_parent":"PORT31"}, - "i2c": - { - "topo_info": { "parent_bus":"0x48", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - - "PORT34": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT34", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"34"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT34-EEPROM" }, - { "itf":"control", "dev":"PORT34-CTRL" } - ] - } - }, - "PORT34-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT34-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT34"}, - "i2c": - { - "topo_info": { "parent_bus":"0x49", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT34-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT34-CTRL", "device_parent":"MUX9", "virt_parent":"PORT34"}, - "i2c": - { - "topo_info": { "parent_bus":"0x49", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - - "PORT33": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT33", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"33"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT33-EEPROM" }, - { "itf":"control", "dev":"PORT33-CTRL" } - ] - } - }, - "PORT33-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT33-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT33"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4a", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT33-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT33-CTRL", "device_parent":"MUX9", "virt_parent":"PORT33"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - - "PORT36": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT36", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"36"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT36-EEPROM" }, - { "itf":"control", "dev":"PORT36-CTRL" } - ] - } - }, - "PORT36-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT36-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT36"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4b", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT36-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT36-CTRL", "device_parent":"MUX9", "virt_parent":"PORT36"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} - ] - } - }, - - "PORT35": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT35", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"35"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT35-EEPROM" }, - { "itf":"control", "dev":"PORT35-CTRL" } - ] - } - }, - "PORT35-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT35-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT35"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4c", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT35-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT35-CTRL", "device_parent":"MUX9", "virt_parent":"PORT35"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} - ] - } - }, - - "PORT37": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT37", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"37"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT37-EEPROM" }, - { "itf":"control", "dev":"PORT37-CTRL" } - ] - } - }, - "PORT37-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT37-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT37"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4d", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT37-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT37-CTRL", "device_parent":"MUX9", "virt_parent":"PORT37"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} - ] - } - }, - - "PORT39": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT39", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"39"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT39-EEPROM" }, - { "itf":"control", "dev":"PORT39-CTRL" } - ] - } - }, - "PORT39-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT39-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT39"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4e", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT39-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT39-CTRL", "device_parent":"MUX9", "virt_parent":"PORT39"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - - "PORT38": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT38", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"38"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT38-EEPROM" }, - { "itf":"control", "dev":"PORT38-CTRL" } - ] - } - }, - "PORT38-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT38-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT38"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4f", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT38-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT38-CTRL", "device_parent":"MUX9", "virt_parent":"PORT38"}, - "i2c": - { - "topo_info": { "parent_bus":"0x4f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} - ] - } - }, - - "PORT40": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT40", "device_parent":"MUX9"}, - "dev_attr": { "dev_idx":"40"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT40-EEPROM" }, - { "itf":"control", "dev":"PORT40-CTRL" } - ] - } - }, - "PORT40-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT40-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT40"}, - "i2c": - { - "topo_info": { "parent_bus":"0x50", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT40-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT40-CTRL", "device_parent":"MUX9", "virt_parent":"PORT40"}, - "i2c": - { - "topo_info": { "parent_bus":"0x50", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - "PORT41": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT41", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"41"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT41-EEPROM" }, - { "itf":"control", "dev":"PORT41-CTRL" } - ] - } - }, - "PORT41-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT41-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT41"}, - "i2c": - { - "topo_info": { "parent_bus":"0x51", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT41-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT41-CTRL", "device_parent":"MUX10", "virt_parent":"PORT41"}, - "i2c": - { - "topo_info": { "parent_bus":"0x51", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} - ] - } - }, - "PORT42": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT42", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"42"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT42-EEPROM" }, - { "itf":"control", "dev":"PORT42-CTRL" } - ] - } - }, - "PORT42-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT42-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT42"}, - "i2c": - { - "topo_info": { "parent_bus":"0x52", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT42-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT42-CTRL", "device_parent":"MUX10", "virt_parent":"PORT42"}, - "i2c": - { - "topo_info": { "parent_bus":"0x52", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} - ] - } - }, - "PORT45": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT45", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"45"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT45-EEPROM" }, - { "itf":"control", "dev":"PORT45-CTRL" } - ] - } - }, - "PORT45-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT45-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT45"}, - "i2c": - { - "topo_info": { "parent_bus":"0x53", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT45-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT45-CTRL", "device_parent":"MUX10", "virt_parent":"PORT45"}, - "i2c": - { - "topo_info": { "parent_bus":"0x53", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} - ] - } - }, - "PORT43": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT43", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"43"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT43-EEPROM" }, - { "itf":"control", "dev":"PORT43-CTRL" } - ] - } - }, - "PORT43-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT43-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT43"}, - "i2c": - { - "topo_info": { "parent_bus":"0x54", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT43-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT43-CTRL", "device_parent":"MUX10", "virt_parent":"PORT43"}, - "i2c": - { - "topo_info": { "parent_bus":"0x54", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_devname":"CPLD1", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B","attr_devname":"CPLD1", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_devname":"CPLD1", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_devname":"CPLD1","attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} - ] - } - }, - "PORT44": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT44", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"44"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT44-EEPROM" }, - { "itf":"control", "dev":"PORT44-CTRL" } - ] - } - }, - "PORT44-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT44-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT44"}, - "i2c": - { - "topo_info": { "parent_bus":"0x55", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT44-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT44-CTRL", "device_parent":"MUX10", "virt_parent":"PORT44"}, - "i2c": - { - "topo_info": { "parent_bus":"0x55", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} - ] - } - }, - "PORT48": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT48", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"48"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT48-EEPROM" }, - { "itf":"control", "dev":"PORT48-CTRL" } - ] - } - }, - "PORT48-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT48-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT48"}, - "i2c": - { - "topo_info": { "parent_bus":"0x56", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT48-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT48-CTRL", "device_parent":"MUX10", "virt_parent":"PORT48"}, - "i2c": - { - "topo_info": { "parent_bus":"0x56", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_devname":"CPLD1","attr_offset":"0x1C", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} - ] - } - }, - "PORT46": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT46", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"46"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT46-EEPROM" }, - { "itf":"control", "dev":"PORT46-CTRL" } - ] - } - }, - "PORT46-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT46-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT46"}, - "i2c": - { - "topo_info": { "parent_bus":"0x57", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT46-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT46-CTRL", "device_parent":"MUX10", "virt_parent":"PORT46"}, - "i2c": - { - "topo_info": { "parent_bus":"0x57", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1","attr_offset":"0x1B", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1","attr_offset":"0x18", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} - ] - } - }, - "PORT47": - { - "dev_info": { "device_type":"SFP28", "device_name":"PORT47", "device_parent":"MUX10"}, - "dev_attr": { "dev_idx":"47"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT47-EEPROM" }, - { "itf":"control", "dev":"PORT47-CTRL" } - ] - } - }, - "PORT47-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT47-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT47"}, - "i2c": - { - "topo_info": { "parent_bus":"0x58", "dev_addr":"0x50", "dev_type":"optoe2"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT47-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT47-CTRL", "device_parent":"MUX10", "virt_parent":"PORT47"}, - "i2c": - { - "topo_info": { "parent_bus":"0x58", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1C", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, - { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} - ] - } - }, - - "PORT49": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT49", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"49"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT49-EEPROM" }, - { "itf":"control", "dev":"PORT49-CTRL" } - ] - } - }, - "PORT49-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT49-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT49"}, - "i2c": - { - "topo_info": { "parent_bus":"0x19", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT49-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT49-CTRL", "device_parent":"MUX11", "virt_parent":"PORT49"}, - "i2c": - { - "topo_info": { "parent_bus":"0x19", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT50": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT50", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"50"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT50-EEPROM" }, - { "itf":"control", "dev":"PORT50-CTRL" } - ] - } - }, - "PORT50-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT50-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT50"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT50-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT50-CTRL", "device_parent":"MUX11", "virt_parent":"PORT50"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT51": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT51", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"51"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT51-EEPROM" }, - { "itf":"control", "dev":"PORT51-CTRL" } - ] - } - }, - "PORT51-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT51-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT51"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT51-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT51-CTRL", "device_parent":"MUX11", "virt_parent":"PORT51"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT52": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT52", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"52"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT52-EEPROM" }, - { "itf":"control", "dev":"PORT52-CTRL" } - ] - } - }, - "PORT52-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT52-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT52"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT52-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT52-CTRL", "device_parent":"MUX11", "virt_parent":"PORT52"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT53": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT53", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"53"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT53-EEPROM" }, - { "itf":"control", "dev":"PORT53-CTRL" } - ] - } - }, - "PORT53-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT53-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT53"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT53-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT53-CTRL", "device_parent":"MUX11", "virt_parent":"PORT53"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT54": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT54", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"54"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT54-EEPROM" }, - { "itf":"control", "dev":"PORT54-CTRL" } - ] - } - }, - "PORT54-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT54-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT54"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1e", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT54-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT54-CTRL", "device_parent":"MUX11", "virt_parent":"PORT54"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT55": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT55", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"55"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT55-EEPROM" }, - { "itf":"control", "dev":"PORT55-CTRL" } - ] - } - }, - "PORT55-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT55-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT55"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1f", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT55-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT55-CTRL", "device_parent":"MUX11", "virt_parent":"PORT55"}, - "i2c": - { - "topo_info": { "parent_bus":"0x1f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - - "PORT56": - { - "dev_info": { "device_type":"QSFP28", "device_name":"PORT56", "device_parent":"MUX11"}, - "dev_attr": { "dev_idx":"56"}, - "i2c": - { - "interface": - [ - { "itf":"eeprom", "dev":"PORT56-EEPROM" }, - { "itf":"control", "dev":"PORT56-CTRL" } - ] - } - }, - "PORT56-EEPROM": - { - "dev_info": { "device_type":"", "device_name":"PORT56-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT56"}, - "i2c": - { - "topo_info": { "parent_bus":"0x20", "dev_addr":"0x50", "dev_type":"optoe1"}, - "attr_list": - [ - { "attr_name":"eeprom"} - ] - } - }, - "PORT56-CTRL": - { - "dev_info": { "device_type":"", "device_name":"PORT56-CTRL", "device_parent":"MUX11", "virt_parent":"PORT56"}, - "i2c": - { - "topo_info": { "parent_bus":"0x20", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, - "attr_list": - [ - { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"} - - ] - } - }, - "LOC_LED": - { - "dev_info": { "device_type":"LED", "device_name":"LOC_LED"}, - "dev_attr": { "index":"0"}, - "i2c" : - { - "attr_list": - [ - {"attr_name":"STATUS_LED_COLOR_BLUE_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x27", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, - {"attr_name":"STATUS_LED_COLOR_GREEN_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x17", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, - {"attr_name":"STATUS_LED_COLOR_AMBER_BLINK", "descr": "" , "bits" : "5:0", "value" : "0xf", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, - {"attr_name":"STATUS_LED_COLOR_BLUE", "descr": "" , "bits" : "5:0", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, - {"attr_name":"STATUS_LED_COLOR_GREEN", "descr": "" , "bits" : "5:0", "value" : "0x5", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, - {"attr_name":"STATUS_LED_COLOR_AMBER", "descr": "" , "bits" : "5:0", "value" : "0x6", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, - {"attr_name":"STATUS_LED_COLOR_OFF", "descr": "" , "bits" : "5:0", "value" : "0xf", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"} - ] - } - }, - "DIAG_LED": - { - "dev_info": { "device_type":"LED", "device_name":"DIAG_LED"}, - "dev_attr": { "index":"0"}, - "i2c" : - { - "attr_list": - [ - {"attr_name":"STATUS_LED_COLOR_BLUE_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x27", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, - {"attr_name":"STATUS_LED_COLOR_GREEN_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x17", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, - {"attr_name":"STATUS_LED_COLOR_AMBER_BLINK", "descr": "" , "bits" : "5:0", "value" : "0xf", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, - {"attr_name":"STATUS_LED_COLOR_BLUE", "descr": "" , "bits" : "5:0", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, - {"attr_name":"STATUS_LED_COLOR_GREEN", "descr": "" , "bits" : "5:0", "value" : "0x5", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, - {"attr_name":"STATUS_LED_COLOR_AMBER", "descr": "" , "bits" : "5:0", "value" : "0x6", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, - {"attr_name":"STATUS_LED_COLOR_OFF", "descr": "" , "bits" : "5:0", "value" : "0x7", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"} - - ] - } - } -} diff --git a/device/accton/x86_64-accton_as7326_56x-r0/pddf_support b/device/accton/x86_64-accton_as7326_56x-r0/pddf_support deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/device/accton/x86_64-accton_as7326_56x-r0/plugins/eeprom.py b/device/accton/x86_64-accton_as7326_56x-r0/plugins/eeprom.py index 4241483d68eb..8139f856f973 100644 --- a/device/accton/x86_64-accton_as7326_56x-r0/plugins/eeprom.py +++ b/device/accton/x86_64-accton_as7326_56x-r0/plugins/eeprom.py @@ -16,5 +16,10 @@ 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/0-0056/eeprom" + exists = os.path.isfile('/sys/bus/i2c/devices/0-0056/eeprom') + if (exists is True): + self.eeprom_path = "/sys/bus/i2c/devices/0-0056/eeprom" + else: + self.eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/accton/x86_64-accton_as7326_56x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as7326_56x-r0/pmon_daemon_control.json index 584a14b9d942..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as7326_56x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as7326_56x-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_as7326_56x-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..73a7720e8979 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-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_as7326_56x-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..f32f381b7c21 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/chassis.py @@ -0,0 +1,264 @@ +############################################################################# +# 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 .event import SfpEvent + from sonic_py_common import device_info + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 6 +NUM_PSU = 2 +NUM_THERMAL = 4 +NUM_PORT = 58 +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 = "which systemctl > /dev/null 2>&1" +SYSLED_FNODE= "/sys/class/leds/accton_as7326_56x_led::diag/brightness" +SYSLED_MODES = { + "0" : "STATUS_LED_COLOR_OFF", + "1" : "STATUS_LED_COLOR_GREEN", + "3" : "STATUS_LED_COLOR_RED", + "5" : "STATUS_LED_COLOR_GREEN_BLINK" +} + + +class Chassis(ChassisBase): + """Platform-specific Chassis class""" + + def __init__(self): + ChassisBase.__init__(self) + self.config_data = {} + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + 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(NUM_PORT): + sfp = Sfp(index) + self._sfp_list.append(sfp) + self._sfpevent = SfpEvent(self._sfp_list) + 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(NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + + def __initialize_thermals(self): + from sonic_platform.thermal import Thermal + for index in range(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(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + def __initialize_watchdog(self): + 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: + return fd.read().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 Exception: + return False + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return self._eeprom.get_product_name() + + 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. + """ + description = 'None' + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) if self.__is_host( + ) else (PMON_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + prev_reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + PREV_REBOOT_CAUSE_FILE) if self.__is_host( + ) else (PMON_REBOOT_CAUSE_PATH + PREV_REBOOT_CAUSE_FILE) + + sw_reboot_cause = self.__read_txt_file(reboot_cause_path) or "Unknown" + prev_sw_reboot_cause = self.__read_txt_file(prev_reboot_cause_path) or "Unknown" + + if sw_reboot_cause != "Unknown": + reboot_cause = self.REBOOT_CAUSE_NON_HARDWARE + description = sw_reboot_cause + elif prev_reboot_cause_path != "Unknown": + reboot_cause = self.REBOOT_CAUSE_NON_HARDWARE + description = prev_sw_reboot_cause + + return (reboot_cause, description) + + def get_change_event(self, timeout=0): + # SFP event + if not self.sfp_module_initialized: + self.__initialize_sfp() + return self._sfpevent.get_sfp_event(timeout) + + 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.__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.__write_txt_file(SYSLED_FNODE, mode) diff --git a/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/component.py new file mode 100644 index 000000000000..75c2d3b918d4 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/component.py @@ -0,0 +1,161 @@ +############################################################################# +# Edgecore +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +try: + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD-1": "18-0060", + "CPLD-2": "12-0062", + "CPLD-3": "19-0064", +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_NAME_LIST = ["CPLD-1", "CPLD-2", "CPLD-3", "BIOS"] +COMPONENT_DES_LIST = [ + "CPLD-1", "CPLD-2", "CPLD-3", "Basic Input/Output System" +] + + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + ComponentBase.__init__(self) + self.index = component_index + self.name = self.get_name() + + 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_sysfs_value(self, addr, name): + # Retrieves the cpld register value + try: + with open(SYSFS_PATH + addr + '/' + name, 'r') as fd: + return fd.read().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_addr = CPLD_ADDR_MAPPING[cpld_name] + cpld_version_raw = self.__get_sysfs_value(cpld_addr, "version") + cpld_version[cpld_name] = "{}".format( + int(cpld_version_raw, 16)) + except Exception as e: + 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_NAME_LIST[self.index] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_DES_LIST[self.index] + + 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_as7326_56x-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..d0bffe53a279 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/eeprom.py @@ -0,0 +1,139 @@ +try: + import os + import sys + import re + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo + if sys.version_info[0] >= 3: + from io import StringIO + else: + from cStringIO import StringIO +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" + exists = os.path.isfile('/sys/bus/i2c/devices/0-0056/eeprom') + if (exists is True): + self._eeprom_path = "/sys/bus/i2c/devices/0-0056/eeprom" + else: + 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) + + def get_product_name(self): + return self._eeprom.get('0x21', NULL) diff --git a/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/event.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/event.py new file mode 100644 index 000000000000..3d6f81518a26 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/event.py @@ -0,0 +1,60 @@ +try: + import time + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + +POLL_INTERVAL_IN_SEC = 1 + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + def __init__(self, sfp_list): + self._sfp_list = sfp_list + self._logger = Logger() + self._sfp_change_event_data = {'present': 0} + + def get_presence_bitmap(self): + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.port_num-1 + if modpres: + bitmap = bitmap | (1 << i) + return bitmap + + def get_sfp_event(self, timeout=2000): + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: + 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 + return True, change_dict + else: + return True, change_dict diff --git a/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..c64d953b758b --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/fan.py @@ -0,0 +1,270 @@ +############################################################################# +# 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 +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +FAN_MAX_RPM = 25500 +PSU_FAN_MAX_RPM = 25500 +SPEED_TOLERANCE = 15 +CPLD_I2C_PATH = "/sys/bus/i2c/devices/11-0066/fan" +PSU_I2C_PATH = "/sys/bus/i2c/devices/{}-00{}/" +PSU_HWMON_I2C_MAPPING = { + 0: { + "bus": 17, + "addr": "59" + }, + 1: { + "bus": 13, + "addr": "5b" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "bus": 17, + "addr": "51" + }, + 1: { + "bus": 13, + "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", "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.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.is_psu_fan = is_psu_fan + self.psu_index = psu_index + + if self.is_psu_fan: + psu_i2c_bus = PSU_HWMON_I2C_MAPPING[psu_index]["bus"] + 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]["bus"] + psu_i2c_addr = PSU_CPLD_I2C_MAPPING[psu_index]["addr"] + self.cpld_path = PSU_I2C_PATH.format(psu_i2c_bus, psu_i2c_addr) + + FanBase.__init__(self) + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + return fd.read().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 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: + val = self.__read_txt_file( + CPLD_I2C_PATH + str(self.fan_tray_index+1) + "_direction") + direction = self.FAN_DIRECTION_EXHAUST if ( + val == "0") else self.FAN_DIRECTION_INTAKE + else: + val = self.__read_txt_file(self.psu_hwmon_path + "psu_fan_dir") + direction = self.FAN_DIRECTION_EXHAUST if ( + val == "F2B") else self.FAN_DIRECTION_INTAKE + 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: + speed = self.__read_txt_file( + self.psu_hwmon_path + "psu_fan1_speed_rpm") + speed = (int(speed, 10)) * 100 / PSU_FAN_MAX_RPM + speed = 100 if (speed > 100) else speed + elif self.get_presence(): + speed = self.__read_txt_file(CPLD_I2C_PATH + str( + self.fan_index * 10 + self.fan_tray_index + 1) + "_input") + speed = (int(speed, 10)) * 100 / FAN_MAX_RPM + speed = 100 if (speed > 100) else speed + 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(): + return self.__write_txt_file( + CPLD_I2C_PATH + "_duty_cycle_percentage", 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 PSU + Returns: + bool: True if PSU is present, False if not + """ + if self.is_psu_fan: + val = self.__read_txt_file(self.cpld_path + "psu_present") + return int(val, 10) == 1 + + val = self.__read_txt_file( + CPLD_I2C_PATH + str(self.fan_tray_index + 1) + "_present") + return int(val, 10)==1 + + 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.__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_tray_index+1, '_fault') + val=self.__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_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_as7326_56x-r0/sonic_platform/fan_drawer.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..e21163c106c1 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-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_as7326_56x-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-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_as7326_56x-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..44566aba1f3c --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/psu.py @@ -0,0 +1,264 @@ +############################################################################# +# 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.thermal import Thermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +I2C_PATH = "/sys/bus/i2c/devices/{}-00{}/" + +PSU_NAME_LIST = ["PSU-1", "PSU-2"] +PSU_NUM_FAN = [1, 1] +PSU_HWMON_I2C_MAPPING = { + 0: { + "bus": 17, + "addr": "59" + }, + 1: { + "bus": 13, + "addr": "5b" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "bus": 17, + "addr": "51" + }, + 1: { + "bus": 13, + "addr": "53" + }, +} + +NUM_FAN_TRAY = 6 + + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, psu_index=0): + PsuBase.__init__(self) + self.index = psu_index + + bus = PSU_HWMON_I2C_MAPPING[self.index]["bus"] + addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] + self.hwmon_path = I2C_PATH.format(bus, addr) + + bus = PSU_CPLD_I2C_MAPPING[self.index]["bus"] + addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] + self.cpld_path = I2C_PATH.format(bus, addr) + self.__initialize_fan() + + def __initialize_fan(self): + from sonic_platform.fan import Fan + self._fan_list.append( + Fan(NUM_FAN_TRAY + self.index, + is_psu_fan=True, + psu_index=self.index)) + self._thermal_list.append(Thermal(is_psu=True, psu_index=self.index)) + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + return fd.read().strip() + except IOError: + pass + return None + + def get_voltage(self): + """ + Retrieves current PSU voltage output + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + val = self.__read_txt_file(self.hwmon_path + "psu_v_out") + if val is not None: + return float(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 + """ + val = self.__read_txt_file(self.hwmon_path + "psu_i_out") + 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 + """ + val = self.__read_txt_file(self.hwmon_path + "psu_p_out") + 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 + """ + return self._thermal_list[0].get_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 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 + """ + val = self.__read_txt_file(self.hwmon_path + "psu_mfr_vout_max") + if val is not None: + return float(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 + """ + val = self.__read_txt_file(self.hwmon_path + "psu_mfr_vout_min") + if val is not None: + return float(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 + """ + val = self.__read_txt_file(self.cpld_path + "psu_present") + 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 + """ + val = self.__read_txt_file(self.cpld_path + "psu_power_good") + 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 = self.__read_txt_file(self.cpld_path + "psu_model_name") + 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 = self.__read_txt_file(self.cpld_path + "psu_serial_number") + 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_as7326_56x-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..95a54e554a01 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/sfp.py @@ -0,0 +1,626 @@ +############################################################################# +# 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.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + 0: { + "bus": 18, + "addr": "60" + }, # port 31-56 + 1: { + "bus": 12, + "addr": "62" + }, # port 1-30 +} +CPLD_I2C_PATH = "/sys/bus/i2c/devices/{}-00{}/" + +class Sfp(SfpOptoeBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 58 + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "which systemctl > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as7326_56x-r0" + HWSKU = "Accton-AS7326-56X" + + _port_to_i2c_mapping = { + 1: [42], + 2: [41], + 3: [44], + 4: [43], + 5: [47], + 6: [45], + 7: [46], + 8: [50], + 9: [48], + 10: [49], + 11: [52], + 12: [51], + 13: [53], + 14: [56], + 15: [55], + 16: [54], + 17: [58], + 18: [57], + 19: [60], + 20: [59], + 21: [61], + 22: [63], + 23: [62], + 24: [64], + 25: [66], + 26: [68], + 27: [65], + 28: [67], + 29: [69], + 30: [71], + 31: [72], + 32: [70], + 33: [74], + 34: [73], + 35: [76], + 36: [75], + 37: [77], + 38: [79], + 39: [78], + 40: [80], + 41: [81], + 42: [82], + 43: [84], + 44: [85], + 45: [83], + 46: [87], + 47: [88], + 48: [86], + 49: [25], + 50: [26], + 51: [27], + 52: [28], + 53: [29], + 54: [30], + 55: [31], + 56: [32], + 57: [22], + 58: [23] + } + + def __init__(self, sfp_index=0): + SfpOptoeBase.__init__(self) + # Init index + self.index = sfp_index + self.port_num = self.index + 1 + + cpld_idx = 0 if self.port_num > 30 else 1 + bus = CPLD_ADDR_MAPPING[cpld_idx]["bus"] + addr = CPLD_ADDR_MAPPING[cpld_idx]["addr"] + self.cpld_path = CPLD_I2C_PATH.format(bus, addr) + + # 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][0]) + + def get_eeprom_path(self): + return self.port_to_eeprom_mapping[self.port_num] + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + return fd.read().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 __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) + for n in range(0, num_bytes): + if sys.version_info[0] >= 3: + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + else: + 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_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.port_num <= 48 or self.port_num >=57: + return False # SPF port doesn't support this feature + + val = self.__read_txt_file( + self.cpld_path + "module_reset_" + str(self.port_num)) + 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. + """ + if self.port_num <= 48 or self.port_num >=57: + rx_los = self.__read_txt_file( + self.cpld_path + "module_rx_los_" + str(self.port_num)) + 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 <= 48 or self.port_num >=57: + tx_fault = self.__read_txt_file( + self.cpld_path + "module_tx_fault_" + str(self.port_num)) + 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 <= 48 or self.port_num >=57: + tx_disable = False + + status_control_raw = self.__read_eeprom_specific_bytes( + SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + if status_control_raw: + cpld_val = self.__read_txt_file( + self.cpld_path + "module_tx_disable_" + str(self.port_num)) + tx_disable_hard = (int(cpld_val, 10) == 1) + 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==0: + return [False] + else: + return [True] + + 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 + 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 <= 48 or self.port_num >= 57: + # SFP doesn't support this feature + 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): + + if self.port_num <= 48 or self.port_num >= 57: + # 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 <= 48 or self.port_num >= 57: + 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 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 <= 48 or self.port_num >=57: + return False # SFP doesn't support this feature + + ret = self.__write_txt_file( + self.cpld_path + "module_reset_" + str(self.port_num), 1) + if ret is not True: + return ret + + time.sleep(0.01) + ret = self.__write_txt_file( + self.cpld_path + "module_reset_" + str(self.port_num), 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 <= 48 or self.port_num >=57: + ret = self.__write_txt_file( + self.cpld_path + "module_tx_disable_" + str(self.port_num), 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: %s" % 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 <= 48 or self.port_num >=57: + 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: %s" % 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 <= 48 or self.port_num >=57: + return False # SFP doesn't support this feature + + if lpmode: + return self.set_power_override(True, True) + else: + return self.set_power_override(True, False) + + 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 <= 48 or self.port_num >=57: + 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: %s" % 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 + """ + val = self.__read_txt_file( + self.cpld_path + "module_present_" + str(self.port_num)) + return val == '1' + + 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() + + 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_as7326_56x-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..b2233e7b5a72 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sonic_platform/thermal.py @@ -0,0 +1,232 @@ +############################################################################# +# 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: { + "bus": 17, + "addr": "59" + }, + 1: { + "bus": 13, + "addr": "5b" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "bus": 17, + "addr": "51" + }, + 1: { + "bus": 13, + "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]["bus"] + 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]["bus"] + 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.THERMAL_NAME_LIST.append("Temp sensor 4") + 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: "15-0048/hwmon/hwmon*/", + 1: "15-0049/hwmon/hwmon*/", + 2: "15-004a/hwmon/hwmon*/", + 3: "15-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: + return fd.readline().rstrip() + except IOError as e: + pass + + 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) + return float(raw_temp) / 1000 + + def __set_threshold(self, file_name, temperature): + if self.is_psu: + return True + + 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 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 PSU + Returns: + bool: True if PSU 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) + return raw_txt != 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.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 self.index+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_as7326_56x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as7326_56x-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..18d47b22a9d3 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-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_RED", + "normal": "STATUS_LED_COLOR_GREEN", + "booting": "STATUS_LED_COLOR_GREEN_BLINK" + } +} diff --git a/device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json deleted file mode 100644 index eae22f99e394..000000000000 --- a/device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - - "XCVR": - { - "xcvr_present": - { - "i2c": - { - "valmap-QSFP28": {"1":true, "0":false} - } - } - }, - "PSU": - { - "psu_present": - { - "i2c": - { - "valmap": { "1":true, "0":false } - } - }, - - "psu_power_good": - { - "i2c": - { - "valmap": { "1": true, "0":false } - } - }, - - "psu_fan_dir": - { - "i2c": - { - "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } - } - }, - - "PSU_FAN_MAX_SPEED":"18000" - }, - - "FAN": - { - "direction": - { - "i2c": - { - "valmap": {"1":"INTAKE", "0":"EXHAUST"} - } - }, - - "present": - { - "i2c": - { - "valmap": {"1":true, "0":false} - } - }, - - "duty_cycle_to_pwm": "lambda dc: ((dc - 10) / 6)", - "pwm_to_duty_cycle": "lambda pwm: ( (pwm * 6) + 10)" - } - -} diff --git a/device/accton/x86_64-accton_as7816_64x-r0/pddf_support b/device/accton/x86_64-accton_as7816_64x-r0/pddf_support deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/device/accton/x86_64-accton_as7816_64x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as7816_64x-r0/pmon_daemon_control.json index 0d3f1fb4561d..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as7816_64x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as7816_64x-r0/pmon_daemon_control.json @@ -1,6 +1,5 @@ { "skip_ledd": true, - "skip_pcied": true, - "skip_thermalctld": true + "skip_pcied": true } diff --git a/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..73a7720e8979 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-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_as7816_64x-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..44a759045b6b --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/chassis.py @@ -0,0 +1,250 @@ +############################################################################# +# 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 = 4 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 6 +NUM_PORT = 64 +NUM_COMPONENT = 5 +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 = "which systemctl > /dev/null 2>&1" +SYSLED_FNODE = "/sys/class/leds/as7816_64x_led::diag/brightness" +SYSLED_MODES = { + "0" : "STATUS_LED_COLOR_OFF", + "16" : "STATUS_LED_COLOR_GREEN", + "10" : "STATUS_LED_COLOR_RED" + +} + + +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 + for index in range(0, NUM_PORT): + sfp = Sfp(index) + self._sfp_list.append(sfp) + self._sfpevent = SfpEvent(self._sfp_list) + 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._eeprom.get_product_name() + + 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() + return self._sfpevent.get_sfp_event(timeout) + + 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_as7816_64x-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/component.py new file mode 100644 index 000000000000..6af2f6008e72 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/component.py @@ -0,0 +1,177 @@ +############################################################################# +# 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": "19-0060", + "CPLD2": "20-0062", + "CPLD3": "21-0064", + "CPLD4": "22-0066", +} +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"), + ("CPLD4", "CPLD 4"), + ("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 + + 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_as7816_64x-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..c87f01c50a52 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/eeprom.py @@ -0,0 +1,134 @@ +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) + + def get_product_name(self): + return self._eeprom.get('0x21', NULL) diff --git a/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/event.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/event.py new file mode 100644 index 000000000000..eb845c7e4aad --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/event.py @@ -0,0 +1,62 @@ +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") + +POLL_INTERVAL_IN_SEC = 1 + +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() + self._sfp_change_event_data = {'present': 0} + + def get_presence_bitmap(self): + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.port_num-1 + if modpres: + bitmap = bitmap | (1 << i) + return bitmap + + def get_sfp_event(self, timeout=2000): + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: + 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 + return True, change_dict + else: + return True, change_dict diff --git a/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..0ec1fc3962f9 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/fan.py @@ -0,0 +1,263 @@ +############################################################################# +# 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") + +SPEED_TOLERANCE = 15 +CPLD_FAN_I2C_PATH = "/sys/bus/i2c/devices/17-0068/fan" +I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "5b" + }, + 1: { + "num": 9, + "addr": "58" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "53" + }, + 1: { + "num": 9, + "addr": "50" + }, +} + +FAN_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", + "FAN-3F", "FAN-3R", "FAN-4F", "FAN-4R"] + +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: #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 + 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 + """ + present_path = "{}{}{}".format(CPLD_FAN_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 + + 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_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_as7816_64x-r0/sonic_platform/fan_drawer.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..17d339ee55f6 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-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_as7816_64x-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..b124ca29f0df --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-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_as7816_64x-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-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_as7816_64x-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..53dd058bbac7 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/psu.py @@ -0,0 +1,283 @@ +############################################################################# +# Edgecore +# +# 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.thermal import Thermal + 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": 10, + "addr": "53" + }, + 1: { + "num": 9, + "addr": "50" + }, +} + +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "5b" + }, + 1: { + "num": 9, + "addr": "58" + }, +} + +NUM_FAN_TRAY = 4 + +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 + self._fan_list.append( + Fan(NUM_FAN_TRAY + self.index, + is_psu_fan=True, + psu_index=self.index)) + self._thermal_list.append(Thermal(is_psu=True, psu_index=self.index)) + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + return fd.read().strip() + except IOError: + pass + return None + + 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.hwmon_path, 'psu_mfr_model') + val=self._api_helper.read_txt_file(model_path) + if val is None: + return "N/A" + model=val[1:] + + return model + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + serial_path="{}{}".format(self.hwmon_path, 'psu_mfr_serial') + val=self._api_helper.read_txt_file(serial_path) + if val is None: + return "N/A" + serial=val[1:] + + 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_as7816_64x-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..01e568ef3e78 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/sfp.py @@ -0,0 +1,506 @@ +############################################################################# +# 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.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/19-0060/" + + +class Sfp(SfpOptoeBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 64 + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "which systemctl > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as7816_64x-r0" + HWSKU = "Accton-AS7816-64X" + + _port_to_i2c_mapping = { + 61: 25, + 62: 26, + 63: 27, + 64: 28, + 55: 29, + 56: 30, + 53: 31, + 54: 32, + 9: 33, + 10: 34, + 11: 35, + 12: 36, + 1: 37, + 2: 38, + 3: 39, + 4: 40, + 6: 41, + 5: 42, + 8: 43, + 7: 44, + 13: 45, + 14: 46, + 15: 47, + 16: 48, + 17: 49, + 18: 50, + 19: 51, + 20: 52, + 25: 53, + 26: 54, + 27: 55, + 28: 56, + 29: 57, + 30: 58, + 31: 59, + 32: 60, + 21: 61, + 22: 62, + 23: 63, + 24: 64, + 41: 65, + 42: 66, + 43: 67, + 44: 68, + 33: 69, + 34: 70, + 35: 71, + 36: 72, + 45: 73, + 46: 74, + 47: 75, + 48: 76, + 37: 77, + 38: 78, + 39: 79, + 40: 80, + 57: 81, + 58: 82, + 59: 83, + 60: 84, + 49: 85, + 50: 86, + 51: 87, + 52: 88 + } + + def __init__(self, sfp_index=0): + SfpOptoeBase.__init__(self) + 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]) + + def get_eeprom_path(self): + return self.port_to_eeprom_mapping[self.port_num] + + 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_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + 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_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 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 = [] + 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 Boolean, True if tx_disable is enabled, False if disabled + """ + + 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 + """ + + 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 reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + 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 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 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 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 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_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() + + 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_as7816_64x-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..34256bf8c244 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sonic_platform/thermal.py @@ -0,0 +1,236 @@ +############################################################################# +# 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": 10, + "addr": "5b" + }, + 1: { + "num": 9, + "addr": "58" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "53" + }, + 1: { + "num": 9, + "addr": "50" + }, +} + +THERMAL_NAME_LIST = ["Temp sensor 1", "Temp sensor 2", "Temp sensor 3", + "Temp sensor 4", "Temp sensor 5", "Temp sensor 6"] + +PSU_THERMAL_NAME_LIST = ["PSU-1 temp sensor 1", "PSU-2 temp sensor 2"] + +SYSFS_PATH = "/sys/bus/i2c/devices" + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + 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) + + # Set hwmon path + i2c_path = { + 0: "18-0048/hwmon/hwmon*/", + 1: "18-0049/hwmon/hwmon*/", + 2: "18-004a/hwmon/hwmon*/", + 3: "18-004b/hwmon/hwmon*/", + 4: "17-004d/hwmon/hwmon*/", + 5: "17-004d/hwmon/hwmon*/" + }.get(self.index, None) + + self.hwmon_path = "{}/{}".format(SYSFS_PATH, i2c_path) + self.ss_key = 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 80 + + 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 PSU_THERMAL_NAME_LIST[self.psu_index] + else: + return 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 self.index+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_as7816_64x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as7816_64x-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..92be29dfdea6 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-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_RED", + "normal": "STATUS_LED_COLOR_GREEN", + "booting": "STATUS_LED_COLOR_GREEN" + } +} diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/Makefile old mode 100755 new mode 100644 index f845f2e17d86..41953f866b6c --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/Makefile @@ -4,10 +4,7 @@ obj-m:= x86-64-accton-as4630-54pe-cpld.o x86-64-accton-as4630-54pe-psu.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) +$(error KERNEL_SRC is not defined) else KERNELDIR:=$(KERNEL_SRC) endif diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-cpld.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-cpld.c old mode 100755 new mode 100644 index 3a3c594f9fa8..0e9fc11aca81 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-cpld.c +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-cpld.c @@ -598,7 +598,6 @@ static u8 is_fan_fault(struct as4630_54pe_cpld_data *data, enum fan_id id) return ret; } - static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, char *buf) { diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c index 34c22fd82aa1..e758dd5cc47b 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c @@ -64,7 +64,7 @@ static struct accton_as4630_54pe_led_data *ledctl = NULL; #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_MODE_POE_OFF_VALUE 0x3 #define LED_TYPE_STK1_REG_MASK 0x20 #define LED_MODE_STK1_GREEN_VALUE 0x0 @@ -74,20 +74,20 @@ static struct accton_as4630_54pe_led_data *ledctl = NULL; #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_FAN_REG_MASK (0x8|0x4) +#define LED_MODE_FAN_AMBER_VALUE 0x8 +#define LED_MODE_FAN_GREEN_VALUE 0x4 +#define LED_MODE_FAN_OFF_VALUE (0xC) -#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_PSU2_REG_MASK (0x80|0x40) +#define LED_MODE_PSU2_AMBER_VALUE 0x80 +#define LED_MODE_PSU2_GREEN_VALUE 0x40 +#define LED_MODE_PSU2_OFF_VALUE (0xC0) #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) +#define LED_MODE_PSU1_OFF_VALUE (0x3) enum led_type { LED_TYPE_DIAG, @@ -106,8 +106,8 @@ struct led_reg { }; static const struct led_reg led_reg_map[] = { - {(1<reg_val[0]); + return led_reg_val_to_light_mode(LED_TYPE_FAN, ledctl->reg_val[1]); } static void accton_as4630_54pe_led_psu1_set(struct led_classdev *led_cdev, @@ -395,7 +395,7 @@ static void accton_as4630_54pe_led_psu2_set(struct led_classdev *led_cdev, static enum led_brightness accton_as4630_54pe_led_psu2_get(struct led_classdev *cdev) { accton_as4630_54pe_led_update(); - return led_reg_val_to_light_mode(LED_TYPE_PSU2, ledctl->reg_val[0]); + return led_reg_val_to_light_mode(LED_TYPE_PSU2, ledctl->reg_val[1]); } static struct led_classdev accton_as4630_54pe_leds[] = { @@ -405,7 +405,7 @@ static struct led_classdev accton_as4630_54pe_leds[] = { .brightness_set = accton_as4630_54pe_led_diag_set, .brightness_get = accton_as4630_54pe_led_diag_get, .flags = LED_CORE_SUSPENDRESUME, - .max_brightness = LED_MODE_GREEN, + .max_brightness = LED_MODE_GREEN_BLINK, }, [LED_TYPE_PRI] = { .name = "pri", diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-psu.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-psu.c old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service deleted file mode 100644 index 99bca2684f4d..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Accton AS4630-54PE Platform Monitoring service -Before=pmon.service -After=pddf-platform-init.service -DefaultDependencies=no - -[Service] -ExecStart=/usr/local/bin/accton_as4630_54pe_pddf_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-54pe/service/as4630-54pe-platform-handle-mgmt-interface.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-platform-handle-mgmt-interface.service new file mode 100644 index 000000000000..d978b1fe6845 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-platform-handle-mgmt-interface.service @@ -0,0 +1,11 @@ +[Unit] +Description=Accton AS4630-54PE 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-54pe/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service deleted file mode 120000 index 0fd9f25b6c5e..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service +++ /dev/null @@ -1 +0,0 @@ -../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py index 59dad237f3b4..553325484a92 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py @@ -1,14 +1,23 @@ from setuptools import setup +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as4630_54pe-r0' + setup( name='sonic-platform', version='1.0', - description='SONiC platform API implementation on Accton Platforms using PDDF', + 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', - packages=['sonic_platform'], + 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', 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 66599ad88ad6..b954da8726d2 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 @@ -30,6 +30,7 @@ import sys import logging import time +import os PROJECT_NAME = 'as4630_54pe' version = '0.0.1' @@ -88,8 +89,8 @@ if DEBUG == True: - print((sys.argv[0])) - print(('ARGV :', sys.argv[1:])) + print(sys.argv[0]) + print('ARGV :', sys.argv[1:]) def main(): @@ -107,7 +108,7 @@ def main(): if DEBUG == True: print(options) print(args) - print((len(sys.argv))) + print(len(sys.argv)) for opt, arg in options: if opt in ('-h', '--help'): @@ -124,6 +125,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() else: show_help() @@ -131,12 +136,12 @@ def main(): return 0 def show_help(): - print(( __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]})) + print( __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]}) sys.exit(0) def my_log(txt): if DEBUG == True: - print(("[ACCTON DBG]: ",txt)) + print("[ACCTON DBG]: ",txt) return def log_os_system(cmd, show): @@ -150,7 +155,7 @@ def log_os_system(cmd, show): if status: logging.info('Failed :'+cmd) if show: - print(('Failed :'+cmd)) + print('Failed :'+cmd) return status, output def driver_inserted(): @@ -168,7 +173,7 @@ def driver_inserted(): 'modprobe i2c_dev', 'modprobe i2c_i801', 'modprobe i2c_ismt', -'modprobe i2c_mux_pca954x', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe ym2651y', 'modprobe x86_64_accton_as4630_54pe_cpld', 'modprobe x86_64_accton_as4630_54pe_leds', @@ -285,6 +290,44 @@ 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_PY2)) + + 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() @@ -292,25 +335,28 @@ def do_install(): if FORCE == 0: return status else: - print((PROJECT_NAME.upper()+" drivers detected....")) + 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....")) + 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....")) + print(PROJECT_NAME.upper()+" has no device installed....") else: print("Removing device....") status = device_uninstall() @@ -319,7 +365,7 @@ def do_uninstall(): return status if driver_inserted()== False : - print((PROJECT_NAME.upper()+" has no driver installed....")) + print(PROJECT_NAME.upper()+" has no driver installed....") else: print("Removing installed driver....") status = driver_uninstall() @@ -327,6 +373,8 @@ def do_uninstall(): if FORCE == 0: return status + do_sonic_platform_clean() + return def device_exist(): diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/handle_mgmt_interface.sh b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/handle_mgmt_interface.sh new file mode 100755 index 000000000000..e1acd16a0161 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/handle_mgmt_interface.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#Due to the hardware design, as4630-54pe 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/as5835-54x/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py index e60236c9c781..b8b4820f9e4a 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py @@ -104,7 +104,7 @@ def _get_fan_node_val(self, fan_num, node_num): return None try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None @@ -135,7 +135,7 @@ def _set_fan_node_val(self, fan_num, node_num, val): val_file.write(content) try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None @@ -224,14 +224,3 @@ def get_fan_status(self, fan_num): return True -#def main(): -# fan = FanUtil() -# -# print 'get_size_node_map : %d' % fan.get_size_node_map() -# print 'get_size_path_map : %d' % fan.get_size_path_map() -# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1): -# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1): -# print fan.get_fan_to_device_path(x, y) -# -#if __name__ == '__main__': -# main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py index ceb9ab464026..4e8ef9adcbe7 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py @@ -22,7 +22,6 @@ # ------------------------------------------------------------------ try: - import os import time import logging import glob @@ -34,7 +33,7 @@ class ThermalUtil(object): """Platform-specific ThermalUtil class""" THERMAL_NUM_MAX = 4 - THERMAL_NUM_1_IDX = 1 # 1_ON_CPU_BROAD. LM75 + THERMAL_NUM_1_IDX = 1 # 1_ON_CPU_BROAD. LM75 THERMAL_NUM_2_IDX = 2 # 2_ON_MAIN_BROAD. LM75 THERMAL_NUM_3_IDX = 3 # 3_ON_MAIN_BROAD. LM75 THERMAL_NUM_4_IDX = 4 # 4_ON_MAIN_BROAD. LM75 @@ -42,88 +41,52 @@ class ThermalUtil(object): """ Dictionary where key1 = thermal id index (integer) starting from 1 value = path to fan device file (string) """ - #_thermal_to_device_path_mapping = {} - - _thermal_to_device_node_mapping = { - THERMAL_NUM_1_IDX: ['18', '4b'], - THERMAL_NUM_2_IDX: ['19', '4c'], - THERMAL_NUM_3_IDX: ['20', '49'], - THERMAL_NUM_4_IDX: ['21', '4a'], - } + thermal_sysfspath ={ - THERMAL_NUM_1_IDX: ["/sys/bus/i2c/devices/18-004b/hwmon/hwmon3/temp1_input"], - THERMAL_NUM_2_IDX: ["/sys/bus/i2c/devices/19-004c/hwmon/hwmon4/temp1_input"], - THERMAL_NUM_3_IDX: ["/sys/bus/i2c/devices/20-0049/hwmon/hwmon5/temp1_input"], - THERMAL_NUM_4_IDX: ["/sys/bus/i2c/devices/21-004a/hwmon/hwmon6/temp1_input"], + THERMAL_NUM_1_IDX: ["/sys/bus/i2c/devices/18-004b/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_2_IDX: ["/sys/bus/i2c/devices/19-004c/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_3_IDX: ["/sys/bus/i2c/devices/20-0049/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_4_IDX: ["/sys/bus/i2c/devices/21-004a/hwmon/hwmon*/temp1_input"], } - #def __init__(self): - def _get_thermal_val(self, thermal_num): + 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_to_device_path(thermal_num) - if(os.path.isfile(device_path)): - 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 + 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() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None return int(content) - - else: - print("No such device_path=%s"%device_path) - return 0 + + return 0 def get_num_thermals(self): return self.THERMAL_NUM_MAX - - def get_idx_thermal_start(self): - return self.THERMAL_NUM_1_IDX - - def get_size_node_map(self): - return len(self._thermal_to_device_node_mapping) - - def get_size_path_map(self): - return len(self.thermal_sysfspath) - - def get_thermal_to_device_path(self, thermal_num): + + def get_thermal_path(self, thermal_num): return self.thermal_sysfspath[thermal_num][0] - def get_thermal_1_val(self): - return self._get_thermal_val(self.THERMAL_NUM_1_IDX) - - def get_thermal_2_val(self): - return self._get_thermal_val(self.THERMAL_NUM_2_IDX) - - def get_thermal_3_val(self): - return self._get_thermal_val(self.THERMAL_NUM_3_IDX) - - def get_thermal_temp(self): - return (self._get_thermal_val(self.THERMAL_NUM_1_IDX) + self._get_thermal_val(self.THERMAL_NUM_2_IDX) +self._get_thermal_val(self.THERMAL_NUM_3_IDX)) - def main(): thermal = ThermalUtil() - print("termal1=%d" %thermal._get_thermal_val(1)) - print("termal2=%d" %thermal._get_thermal_val(2)) - print("termal3=%d" %thermal._get_thermal_val(3)) - print("termal4=%d" %thermal._get_thermal_val(4)) -# -# print 'get_size_node_map : %d' % thermal.get_size_node_map() -# print 'get_size_path_map : %d' % thermal.get_size_path_map() -# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1): -# print thermal.get_thermal_to_device_path(x) -# + logging.basicConfig(level=logging.DEBUG) + logging.debug('thermal1=%d', thermal.get_thermal_val(1)) + logging.debug('thermal2=%d', thermal.get_thermal_val(2)) + logging.debug('thermal3=%d', thermal.get_thermal_val(3)) + logging.debug('thermal4=%d', thermal.get_thermal_val(4)) + if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py index e3b3fe742db9..49a12cd51ece 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py @@ -91,11 +91,11 @@ def manage_fans(self): thermal = ThermalUtil() fan = FanUtil() - temp2 = thermal.get_thermal_2_val() + temp2 = thermal.get_thermal_val(2) if temp2 is None: return False - temp3 = thermal.get_thermal_3_val() + temp3 = thermal.get_thermal_val(3) if temp3 is None: return False 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 79b1e730ee9e..5292d1ec3b18 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 @@ -48,8 +48,8 @@ if DEBUG == True: - print((sys.argv[0])) - print(("ARGV :", sys.argv[1:])) + print(sys.argv[0]) + print("ARGV :", sys.argv[1:]) def main(): @@ -67,7 +67,7 @@ def main(): if DEBUG == True: print(options) print(args) - print((len(sys.argv))) + print(len(sys.argv)) for opt, arg in options: if opt in ('-h', '--help'): @@ -96,13 +96,13 @@ def main(): return 0 def show_help(): - print((__doc__ % {'scriptName' : sys.argv[0].split("/")[-1]})) + print(__doc__ % {'scriptName' : sys.argv[0].split("/")[-1]}) sys.exit(0) def my_log(txt): if DEBUG == True: - print(("[Debug]"+txt)) + print("[Debug]"+txt) return def log_os_system(cmd, show): @@ -113,7 +113,7 @@ def log_os_system(cmd, show): if status: logging.info('Failed :'+cmd) if show: - print(('Failed :'+cmd)) + print('Failed :'+cmd) return status, output def driver_check(): @@ -295,6 +295,10 @@ def device_install(): for i in range(49, 55): #Set qsfp port to normal state log_os_system("echo 0 > /sys/bus/i2c/devices/3-0062/module_reset_" + str(i), 1) + for i in range(1, 39): #Set disable tx_disable to sfp port + log_os_system("echo 0 > /sys/bus/i2c/devices/3-0061/module_tx_disable_" + str(i), 1) + for i in range(39, 49): #Set disable tx_disable to sfp port + log_os_system("echo 0 > /sys/bus/i2c/devices/3-0062/module_tx_disable_" + str(i), 1) for i in range(0,len(sfp_map)): if i < qsfp_start: @@ -358,31 +362,29 @@ def do_sonic_platform_install(): 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) )) + print("Error: Failed to install {}".format(PLATFORM_API2_WHL_FILE_PY3) ) return status else: - print(("Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) )) + print("Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) ) else: - print(('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3))) + print('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3)) else: - print(('{} has installed'.format(PLATFORM_API2_WHL_FILE_PY3))) + 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))) + 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))) + print('Error: Failed to uninstall {}'.format(PLATFORM_API2_WHL_FILE_PY3)) return status else: - print(('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3))) - - return + print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) def do_install(): print("Checking system....") @@ -393,7 +395,7 @@ def do_install(): 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....") status = device_install() @@ -401,7 +403,7 @@ def do_install(): if FORCE == 0: return status else: - print((PROJECT_NAME.upper()+" devices detected....")) + print(PROJECT_NAME.upper()+" devices detected....") do_sonic_platform_install() @@ -410,7 +412,7 @@ def do_install(): def do_uninstall(): 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....") status = device_uninstall() @@ -419,7 +421,7 @@ def do_uninstall(): 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....") status = driver_uninstall() diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/classes/fanutil.py index affed9ad804d..7c994864318c 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/classes/fanutil.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/classes/fanutil.py @@ -112,7 +112,7 @@ def _get_fan_node_val(self, fan_num, node_num): return None try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None @@ -143,7 +143,7 @@ def _set_fan_node_val(self, fan_num, node_num, val): val_file.write(content) try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c index ed98daf2011a..035f9ad82ec8 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c @@ -146,7 +146,7 @@ static int accton_getLedReg(enum led_type type, u8 *reg) int i; for (i = 0; i < ARRAY_SIZE(led_reg_map); i++) { - if(led_reg_map[i].types ==type) { + if (led_reg_map[i].types ==type) { *reg = led_reg_map[i].reg_addr; return 0; } diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service deleted file mode 100644 index 03351824b7b4..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Accton AS7326-56X Platform Monitoring service -Before=pmon.service -After=pddf-platform-init.service -DefaultDependencies=no - -[Service] -ExecStart=/usr/local/bin/accton_as7326_pddf_monitor.py -KillSignal=SIGKILL -SuccessExitStatus=SIGKILL - -# Resource Limitations -LimitCORE=infinity - -[Install] -WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-platform-handle_mac.service b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-platform-handle_mac.service index ac196c219b91..3d03ec4f1540 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-platform-handle_mac.service +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-platform-handle_mac.service @@ -1,6 +1,6 @@ [Unit] Description=Accton AS7326-56X Platform MAC handle service -Before=opennsl-modules.service pddf-platform-init.service +Before=opennsl-modules.service After=local-fs.target [Service] diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service deleted file mode 120000 index 0fd9f25b6c5e..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service +++ /dev/null @@ -1 +0,0 @@ -../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py index 22bd354ea686..15806d24fff0 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py @@ -1,5 +1,8 @@ from setuptools import setup +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as7326_56x-r0' + setup( name='sonic-platform', version='1.0', @@ -8,7 +11,11 @@ author='SONiC Team', author_email='linuxnetdev@microsoft.com', url='https://github.com/Azure/sonic-buildimage', - packages=['sonic_platform'], + packages=[ + 'sonic_platform' + ], + package_dir={ + 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_monitor.py index 56f1bd585428..ec3a4c133cdd 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_monitor.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_monitor.py @@ -166,14 +166,14 @@ def manage_fans(self): thermal = ThermalUtil() fan = FanUtil() - fan_dir=fan.get_fan_dir(1) - if fan_dir > 1: - fan_dri=1 #something wrong, set fan_dir to default val - if fan_dir < 0: - fan_dri=1 #something wrong, set fan_dir to default val + #fan_dir=fan.get_fan_dir(1) + #if fan_dir > 1: + # fan_dri=1 #something wrong, set fan_dir to default val + #if fan_dir < 0: + # fan_dri=1 #something wrong, set fan_dir to default val ori_pwm=fan.get_fan_duty_cycle() new_pwm=0 - logging.debug('fan_dir=%d, ori_pwm=%d', fan_dir, ori_pwm) + #logging.debug('fan_dir=%d, ori_pwm=%d', fan_dir, ori_pwm) logging.debug('test_temp=%d', test_temp) if test_temp==0: temp1 = thermal._get_thermal_val(1) 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 997f8a64359d..c3e1c50366b7 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 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2016 Accton Networks, Inc. # @@ -14,15 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# -# -# Description: -# Due to adoption of optoe drivers, sideband signals of SFPs are moved -# into cpld drivers. Add a new dict, cpld_of_module, for mapping this -# attributes to corresponding cpld nodes. -# - - """ Usage: %(scriptName)s [options] command object @@ -34,18 +25,14 @@ 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 subprocess import getopt import sys import logging import re import time - +import os @@ -96,41 +83,21 @@ def main(): for arg in args: if arg == 'install': do_install() + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() 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 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-56 {0|1}\" to set sfp# tx_disable") - sys.exit(0) + def dis_i2c_ir3570a(addr): cmd = "i2cset -y 0 0x%x 0xE5 0x01" % addr @@ -156,11 +123,6 @@ def ir3570_check(): return ret -def show_eeprom_help(): - cmd = sys.argv[0].split("/")[-1]+ " " + args[0] - print(" use \""+ cmd + " 1-56 \" to dump sfp# eeprom") - sys.exit(0) - def my_log(txt): if DEBUG == True: print("[ROY]"+txt) @@ -174,7 +136,7 @@ def log_os_system(cmd, show): if status: logging.info('Failed :'+cmd) if show: - print(('Failed :'+cmd)) + print('Failed :'+cmd) return status, output def driver_check(): @@ -189,7 +151,7 @@ def driver_check(): kos = [ 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x force_deselect_on_exit=1', +'modprobe i2c_mux_pca954x', 'modprobe accton_i2c_cpld' , 'modprobe ym2651y' , 'modprobe accton_as7326_56x_fan' , @@ -207,6 +169,8 @@ def driver_install(): if status: if FORCE == 0: return status + print("Done driver_install") + return 0 def driver_uninstall(): @@ -224,12 +188,8 @@ def driver_uninstall(): return status return 0 -led_prefix ='/sys/class/leds/accton_'+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': ['11-0066'] , 'thermal': ['15-0048','15-0049', '15-004a', '15-004b'] , 'psu': ['17-0051','13-0053'], @@ -238,7 +198,7 @@ def driver_uninstall(): 'thermal': ['hwmon/hwmon*/temp1_input'] , 'psu': ['psu_present ', 'psu_power_good'] , 'sfp': ['module_present_', 'module_tx_disable_']} - +''' sfp_map = [ 42,41,44,43,47,45,46,50, 48,49,52,51,53,56,55,54, @@ -268,7 +228,6 @@ def driver_uninstall(): 'echo pca9548 0x74 > /sys/bus/i2c/devices/i2c-36/new_device', 'echo pca9548 0x75 > /sys/bus/i2c/devices/i2c-37/new_device', 'echo pca9548 0x76 > /sys/bus/i2c/devices/i2c-38/new_device', -'echo 24c04 0x56 > /sys/bus/i2c/devices/i2c-0/new_device', 'echo as7326_56x_fan 0x66 > /sys/bus/i2c/devices/i2c-11/new_device ', 'echo lm75 0x48 > /sys/bus/i2c/devices/i2c-15/new_device', @@ -286,12 +245,22 @@ def driver_uninstall(): mknod2 =[ ] +#EERPOM +eeprom_mknod =[ +'echo 24c04 0x56 > /sys/bus/i2c/devices/i2c-0/new_device', +'echo 24c02 0x57 > /sys/bus/i2c/devices/i2c-0/new_device' +] def i2c_order_check(): # This project has only 1 i2c bus. return 0 +def eeprom_check(): + cmd = "i2cget -y -f 0 0x56" + status, output = subprocess.getstatusoutput(cmd) + return status + def device_install(): global FORCE @@ -320,6 +289,30 @@ def device_install(): print(output) if FORCE == 0: return status + + # set all pca954x idle_disconnect + cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state' + status, output = log_os_system(cmd, 1) + if status: + print(output) + if FORCE == 0: + return status + + # initiate IDPROM + # Close 0x77 mux to make sure if the I2C address of IDPROM is 0x56 or 0x57 + log_os_system("i2cset -f -y 0 0x77 0 ", 1) + ret=eeprom_check() + if ret==0: + log_os_system(eeprom_mknod[0], 1) #old board, 0x56 eeprom + time.sleep(0.2) + exists = os.path.isfile('/sys/bus/i2c/devices/0-0056/eeprom') + if (exists is False): + subprocess.call('echo 0x56 > /sys/bus/i2c/devices/i2c-0/delete_device', shell=True) + log_os_system(eeprom_mknod[1], 1) + else: + log_os_system(eeprom_mknod[1], 1) #new board, 0x57 eeprom + + for i in range(0,len(sfp_map)): if i < qsfp_start or i >= qsfp_end: status, output =log_os_system("echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device", 1) @@ -329,6 +322,7 @@ def device_install(): print(output) if FORCE == 0: return status + print("Done device_install") return def device_uninstall(): @@ -364,6 +358,23 @@ def device_uninstall(): if FORCE == 0: return status + #Deal with for del 0x56 or 0x57 sysfs device + exists = os.path.isfile('/sys/bus/i2c/devices/0-0056/eeprom') + + if (exists is True): + target = eeprom_mknod[0] #0x56 + else: + target = eeprom_mknod[1] #0x57 + + 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(): @@ -372,6 +383,44 @@ def system_ready(): if 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(): print("Checking system....") @@ -394,6 +443,9 @@ def do_install(): return status else: print(PROJECT_NAME.upper()+" devices detected....") + + do_sonic_platform_install() + return def do_uninstall(): @@ -416,185 +468,8 @@ def do_uninstall(): 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]: - cpld_str = 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], '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 + ":") - 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['fan'] ['fan1'][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])==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 + do_sonic_platform_clean() -#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(list(ALL_DEVICE[i].keys()), key=get_value): - print(" "+j+":", end=' ') - 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+" ", end=' ') - else: - print(func+"="+"X"+" ", end=' ') - print() - print("----------------------------------------------------------------") - - print() return def device_exist(): diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/fanutil.py index f4807487bf38..519aaa76749d 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/fanutil.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/fanutil.py @@ -104,7 +104,7 @@ def _get_fan_node_val(self, fan_num, node_num): return None try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None @@ -135,7 +135,7 @@ def _set_fan_node_val(self, fan_num, node_num, val): val_file.write(content) try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/thermalutil.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/thermalutil.py index 65e872c6beb8..2a4afca9b7e0 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/thermalutil.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/classes/thermalutil.py @@ -81,11 +81,11 @@ def _get_thermal_node_val(self, thermal_num): return None try: - val_file.close() + val_file.close() except: logging.debug('GET. unable to close file. device_path:%s', device_path) return None - + return int(content) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-init.service new file mode 100644 index 000000000000..7f3b7d87f99f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-init.service @@ -0,0 +1,17 @@ +[Unit] +Description=Accton AS7816-64X Platform initialization service +Before=pmon.service determine-reboot-cause.service +After=sysinit.target +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/local/bin/accton_as7816_64x_util.py install +ExecStop=/usr/local/bin/accton_as7816_64x_util.py clean + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-monitor.service similarity index 64% rename from platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service rename to platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-monitor.service index 7b6db7ddac01..f361642e69fc 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-64x-platform-monitor.service @@ -1,11 +1,12 @@ [Unit] Description=Accton AS7816-64X Platform Monitoring service Before=pmon.service -After=pddf-platform-init.service +After=as7816-64x-platform-init.service +Requires=as7816-64x-platform-init.service DefaultDependencies=no [Service] -ExecStart=/usr/local/bin/accton_as7816_pddf_monitor.py +ExecStart=/usr/local/bin/accton_as7816_64x_monitor.py KillSignal=SIGKILL SuccessExitStatus=SIGKILL diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-platform-init.service deleted file mode 100755 index 486ed74f8243..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-platform-init.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Accton AS7816-64X Platform initialization service -Before=pmon.service -After=sysinit.target -DefaultDependencies=no - -[Service] -ExecStartPre=/usr/local/bin/accton_as7816_util.py install -ExecStart=/usr/local/bin/accton_as7816_monitor.py -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service deleted file mode 120000 index 0fd9f25b6c5e..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service +++ /dev/null @@ -1 +0,0 @@ -../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py index 22bd354ea686..607a9ef78dd9 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py @@ -1,5 +1,8 @@ from setuptools import setup +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as7816_64x-r0' + setup( name='sonic-platform', version='1.0', @@ -8,7 +11,13 @@ author='SONiC Team', author_email='linuxnetdev@microsoft.com', url='https://github.com/Azure/sonic-buildimage', - packages=['sonic_platform'], + 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', 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_64x_monitor.py similarity index 99% rename from platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_monitor.py rename to platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_64x_monitor.py index d98cec58d2e5..f3ed87398bc1 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_64x_monitor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2017 Accton Technology Corporation # 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_64x_util.py similarity index 80% rename from platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py rename to platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_64x_util.py index 525f2786647e..1e9314fb824e 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_64x_util.py @@ -48,8 +48,8 @@ if DEBUG == True: - print((sys.argv[0])) - print(('ARGV :', sys.argv[1:] )) + print(sys.argv[0]) + print('ARGV :', sys.argv[1:] ) def main(): @@ -67,7 +67,7 @@ def main(): if DEBUG == True: print(options) print(args) - print((len(sys.argv))) + print(len(sys.argv)) for opt, arg in options: if opt in ('-h', '--help'): @@ -81,9 +81,14 @@ def main(): logging.info('no option') for arg in args: if arg == 'install': - do_install() + do_install() elif arg == 'clean': - do_uninstall() + do_uninstall() + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() + else: show_help() @@ -91,7 +96,7 @@ def main(): return 0 def show_help(): - print(( __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]})) + print( __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]}) sys.exit(0) @@ -114,13 +119,13 @@ def ir3570_check(): else: ret = 0 except Exception as e: - print(("Error on ir3570_check() e:" + str(e))) + print("Error on ir3570_check() e:" + str(e)) return -1 return ret def my_log(txt): if DEBUG == True: - print(("[ROY]"+txt)) + print("[ROY]"+txt) return def log_os_system(cmd, show): @@ -131,7 +136,7 @@ def log_os_system(cmd, show): if status: logging.info('Failed :'+cmd) if show: - print(('Failed :'+cmd)) + print('Failed :'+cmd) return status, output def driver_check(): @@ -298,7 +303,44 @@ def system_ready(): if 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(): print("Checking system....") if driver_check() == False: @@ -308,7 +350,7 @@ def do_install(): if FORCE == 0: return status else: - print((PROJECT_NAME.upper()+" drivers detected....")) + print(PROJECT_NAME.upper()+" drivers detected....") ir3570_check() @@ -319,13 +361,15 @@ def do_install(): 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....") if not device_exist(): - print((PROJECT_NAME.upper() +" has no device installed....")) + print(PROJECT_NAME.upper() +" has no device installed....") else: print("Removing device....") status = device_uninstall() @@ -334,7 +378,7 @@ def do_uninstall(): 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....") status = driver_uninstall() @@ -342,6 +386,8 @@ def do_uninstall(): if FORCE == 0: return status + do_sonic_platform_clean() + return def device_exist(): diff --git a/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c b/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c index 5834b1d4ef8b..20cef5d61a38 100755 --- a/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c +++ b/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c @@ -42,7 +42,8 @@ enum chips { YM2651, YM2401, YM2851, - YPEB1200AM + YM1401A, + YPEB1200AM }; /* Each client has this additional data @@ -66,8 +67,9 @@ struct ym2651y_data { u16 fan_duty_cycle[2]; /* Register value */ u8 fan_dir[4]; /* Register value */ u8 pmbus_revision; /* Register value */ + u8 mfr_serial[21]; /* Register value */ u8 mfr_id[10]; /* Register value */ - u8 mfr_model[10]; /* Register value */ + u8 mfr_model[16]; /* Register value */ u8 mfr_revsion[3]; /* Register value */ u16 mfr_vin_min; /* Register value */ u16 mfr_vin_max; /* Register value */ @@ -113,9 +115,11 @@ enum ym2651y_sysfs_attributes { PSU_FAN1_SPEED, PSU_FAN1_DUTY_CYCLE, PSU_PMBUS_REVISION, + PSU_SERIAL_NUM, PSU_MFR_ID, PSU_MFR_MODEL, PSU_MFR_REVISION, + PSU_MFR_SERIAL, PSU_MFR_VIN_MIN, PSU_MFR_VIN_MAX, PSU_MFR_VOUT_MIN, @@ -141,9 +145,11 @@ static SENSOR_DEVICE_ATTR(psu_fan1_speed_rpm, S_IRUGO, show_linear, NULL, PSU_FA 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_serial_num, S_IRUGO, show_ascii, NULL, PSU_SERIAL_NUM); 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_serial, S_IRUGO, show_ascii, NULL, PSU_MFR_SERIAL); 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); @@ -175,9 +181,11 @@ static struct attribute *ym2651y_attributes[] = { &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_serial_num.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_serial.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, @@ -362,14 +370,17 @@ static ssize_t show_ascii(struct device *dev, struct device_attribute *da, } ptr = data->fan_dir; break; + case PSU_MFR_SERIAL: /* psu_mfr_serial */ + ptr = data->mfr_serial+1; /* The first byte is the count byte of string. */ + break; case PSU_MFR_ID: /* psu_mfr_id */ - ptr = data->mfr_id; + ptr = data->mfr_id+1; /* The first byte is the count byte of string. */ break; case PSU_MFR_MODEL: /* psu_mfr_model */ - ptr = data->mfr_model; + ptr = data->mfr_model+1; /* The first byte is the count byte of string. */ break; case PSU_MFR_REVISION: /* psu_mfr_revision */ - ptr = data->mfr_revsion; + ptr = data->mfr_revsion+1; break; default: return 0; @@ -415,7 +426,7 @@ static ssize_t show_vout(struct device *dev, struct device_attribute *da, struct i2c_client *client = to_i2c_client(dev); struct ym2651y_data *data = i2c_get_clientdata(client); - if (data->chip == YM2401) { + if (data->chip == YM2401 || data->chip==YM1401A) { return show_vout_by_mode(dev, da, buf); } else { @@ -493,6 +504,7 @@ static const struct i2c_device_id ym2651y_id[] = { { "ym2651", YM2651 }, { "ym2401", YM2401 }, { "ym2851", YM2851 }, + { "ym1401a",YM1401A}, { "ype1200am", YPEB1200AM }, {} }; @@ -561,8 +573,8 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) if (time_after(jiffies, data->last_updated + HZ + HZ / 2) || !data->valid) { - int i, status; - u8 command; + int i, status, length; + u8 command, buf; u8 fan_dir[5] = {0}; struct reg_data_byte regs_byte[] = { {0x19, &data->capability}, {0x20, &data->vout_mode}, @@ -599,6 +611,7 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) dev_dbg(&client->dev, "reg %d, err %d\n", regs_byte[i].reg, status); *(regs_byte[i].value) = 0; + goto exit; } else { *(regs_byte[i].value) = status; @@ -614,6 +627,7 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) dev_dbg(&client->dev, "reg %d, err %d\n", regs_word[i].reg, status); *(regs_word[i].value) = 0; + goto exit; } else { *(regs_word[i].value) = status; @@ -626,6 +640,7 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) if (status < 0) { dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + goto exit; } strncpy(data->fan_dir, fan_dir+1, ARRAY_SIZE(data->fan_dir)-1); @@ -642,12 +657,61 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) /* 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'; + length = 1; + /* Read first byte to determine the length of data */ + status = ym2651y_read_block(client, command, &buf, length); + if (status < 0) { + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + goto exit; + } + status = ym2651y_read_block(client, command, data->mfr_model, buf+1); + + if ((buf+1) >= (ARRAY_SIZE(data->mfr_model)-1)) + { + data->mfr_model[ARRAY_SIZE(data->mfr_model)-1] = '\0'; + } + else + data->mfr_model[buf+1] = '\0'; if (status < 0) + { dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + goto exit; + } + + /*YM-1401A PSU doens't support to get serial_num, so ignore it. + *It's vout doesn't support linear, so let it use show_vout_by_mode(). + */ + if(!strncmp("YM-1401A", data->mfr_model+1, strlen("YM-1401A"))) + { + data->chip=YM1401A; + } + else + { + /* Read mfr_serial */ + command = 0x9e; + length = 1; + /* Read first byte to determine the length of data */ + status = ym2651y_read_block(client, command, &buf, length); + if (status < 0) { + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + goto exit; + } + status = ym2651y_read_block(client, command, data->mfr_serial, buf+1); + + if ((buf+1) >= (ARRAY_SIZE(data->mfr_serial)-1)) + { + data->mfr_serial[ARRAY_SIZE(data->mfr_serial)-1] = '\0'; + } + else + data->mfr_serial[buf+1] = '\0'; + + if (status < 0) + { + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + goto exit; + } + } /* Read mfr_revsion */ command = 0x9b; @@ -656,12 +720,16 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) data->mfr_revsion[ARRAY_SIZE(data->mfr_revsion)-1] = '\0'; if (status < 0) + { dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + goto exit; + } data->last_updated = jiffies; data->valid = 1; } + exit: mutex_unlock(&data->update_lock); return data; diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install index 4ba26bed2625..a87ebb5b046a 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install @@ -1 +1 @@ -as4630-54pe/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as4630_54pe-r0/pddf +as4630-54pe/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as4630_54pe-r0 diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst deleted file mode 100644 index 23bebd3b295c..000000000000 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst +++ /dev/null @@ -1,8 +0,0 @@ -# Special arrangement to make PDDF mode default -# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) -# Enable pddf-platform-monitor -depmod -a -systemctl enable pddf-platform-init.service -systemctl start pddf-platform-init.service -systemctl enable as4630-54pe-pddf-platform-monitor.service -systemctl start as4630-54pe-pddf-platform-monitor.service diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install index 1d9885d22d27..a6b7094e0e03 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install @@ -1 +1,2 @@ -as7326-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf +as7326-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7326_56x-r0 + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install index 01b33cc19e54..8f214208a6b8 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install @@ -1 +1,2 @@ -as7816-64x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf +as7816-64x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7816_64x-r0 + From d3f2da867952a429d29d115ca259249d0df8e6c1 Mon Sep 17 00:00:00 2001 From: FuzailBrcm <51665572+FuzailBrcm@users.noreply.github.com> Date: Fri, 18 Mar 2022 23:44:10 +0530 Subject: [PATCH 020/119] [pddf]: Adding support for fan_drawer class in PDDF common platform APIs (#10213) Why I did it fan_drawer support was missing in PDDF common platform APIs. This resulted in 'thermalctld' not working and 'show platform fan' and 'show platfomr temperature' commands not working. _thermal_list array inside PSU class was not initialized. Made changes to attach the PSU related thermal sensors in the PSU instance. How I did it Added a common class pddf_fan_drawer.py. This class uses the PDDF JSON to fetch the platform specific data. A platform which uses PDDF would follow the below hierarchy. fan_drawer_base.py ---> pddf_fan_drawer.py ---> fan_drawer.py How to verify it Run the 'show platform fan' and 'show platform temperature' commands and check the o/p. o/p on AS7326: root@sonic:/home/admin# show platform fan s Drawer LED FAN Speed Direction Presence Status Timestamp -------- ----- ---------- ------- ----------- ---------- -------- ----------------- Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 04:15:03 N/A off PSU1_FAN1 0% Present Not OK 20220311 04:15:05 N/A green PSU2_FAN1 34% EXHAUST Present OK 20220311 04:15:05 hroot@sonic:/home/admin# show platform temperature Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp ---------- ------------- --------- -------- -------------- ------------- --------- ----------------- PSU1_TEMP1 0 N/A N/A N/A N/A False 20220311 04:15:05 PSU2_TEMP1 37 N/A N/A N/A N/A False 20220311 04:15:05 TEMP1 37 80.0 N/A N/A N/A False 20220311 04:15:05 TEMP2 27 80.0 N/A N/A N/A False 20220311 04:15:05 TEMP3 28.5 80.0 N/A N/A N/A False 20220311 04:15:05 TEMP4 30.5 80.0 N/A N/A N/A False 20220311 04:15:05 root@sonic:/home/admin# root@sonic:/home/admin# root@sonic:/home/admin# o/p on AS7726: root@as7726-32x-2:~# show platform fan Drawer LED FAN Speed Direction Presence Status Timestamp -------- ----- ---------- ------- ----------- ---------- -------- ----------------- Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 08:13:04 N/A green PSU1_FAN1 23% EXHAUST Present OK 20220311 08:13:04 N/A green PSU2_FAN1 22% EXHAUST Present OK 20220311 08:13:04 root@as7726-32x-2:~# show platform temp Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp ---------- ------------- --------- -------- -------------- ------------- --------- ----------------- PSU1_TEMP1 28 N/A N/A N/A N/A False 20220311 08:13:04 PSU2_TEMP1 25 N/A N/A N/A N/A False 20220311 08:13:04 TEMP1 23.5 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP2 27 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP3 24 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP4 27 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP5 24 80.0 N/A N/A N/A False 20220311 08:13:04 --- .../sonic_platform_pddf_base/pddf_chassis.py | 8 +- .../sonic_platform_pddf_base/pddf_fan.py | 2 +- .../pddf_fan_drawer.py | 110 ++++++++++ .../sonic_platform_pddf_base/pddf_psu.py | 6 + .../sonic_platform_pddf_base/pddf_thermal.py | 198 +++++++++++------- 5 files changed, 248 insertions(+), 76 deletions(-) create mode 100755 platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan_drawer.py 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 0ba2e8902c9c..d90949184d5b 100644 --- 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 @@ -10,7 +10,7 @@ from sonic_platform_base.chassis_base import ChassisBase from sonic_platform.sfp import Sfp from sonic_platform.psu import Psu - from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer from sonic_platform.thermal import Thermal from sonic_platform.eeprom import Eeprom except ImportError as e: @@ -52,9 +52,9 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): # FANs for i in range(self.platform_inventory['num_fantrays']): - for j in range(self.platform_inventory['num_fans_pertray']): - fan = Fan(i, j, self.pddf_obj, self.plugin_data) - self._fan_list.append(fan) + fandrawer = FanDrawer(i, self.pddf_obj, self.plugin_data) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) # PSUs for i in range(self.platform_inventory['num_psus']): 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 d272d40e61a4..2a8ef46085c5 100644 --- 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 @@ -153,7 +153,7 @@ def get_speed(self): speed = int(output['status']) max_speed = int(self.plugin_data['PSU']['PSU_FAN_MAX_SPEED']) - speed_percentage = (speed*100)/max_speed + speed_percentage = round((speed*100)/max_speed) return speed_percentage else: # TODO This calculation should change based on MAX FAN SPEED diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan_drawer.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan_drawer.py new file mode 100755 index 000000000000..f88e833408dd --- /dev/null +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan_drawer.py @@ -0,0 +1,110 @@ +############################################################################# +# PDDF +# +# PDDF fan_drawer base class inherited from the common base class fan_drawer.py +# +############################################################################# + +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") + + +class PddfFanDrawer(FanDrawerBase): + """PDDF generic Fan Drawer class""" + + pddf_obj = {} + plugin_data = {} + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + FanDrawerBase.__init__(self) + if not pddf_data or not pddf_plugin_data: + raise ValueError('PDDF JSON data error') + + self.pddf_obj = pddf_data + 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) + return + + self.fantray_index = tray_idx+1 + for j in range(self.platform['num_fans_pertray']): + # Fan index is 0-based for the init call + self._fan_list.append(Fan(tray_idx, j, self.pddf_obj, self.plugin_data)) + + def get_name(self): + """ + Retrieves the fan drawer name + Returns: String containing fan-drawer name + """ + return "Fantray{0}".format(self.fantray_index) + + def get_presence(self): + status = False + # Usually if a tray is removed, all the fans inside it are absent + if self._fan_list: + status = self._fan_list[0].get_presence() + + return status + + def get_status(self): + status = False + # if all the fans are working fine, then tray status should be okay + if self._fan_list: + status = all(fan.get_status() == True for fan in self._fan_list) + + return status + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + # Usually Fantrays are 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 or -1 if cannot determine the position + """ + return self.fantray_index + + def get_status_led(self): + led_device_name = "FANTRAY{}".format(self.fantray_index) + "_LED" + + if led_device_name 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[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', str(self.fantray_index-1), 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() + return (color) + + def set_status_led(self, color): + result = False + led_device_name = "FANTRAY{}".format(self.fantray_index) + "_LED" + result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color) + if result == False: + print(msg) + return (False) + + 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', str(self.fantray_index-1), 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) 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 912333df8b57..bbe7dc0a1a44 100644 --- 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 @@ -20,6 +20,7 @@ try: from sonic_platform_base.psu_base import PsuBase from sonic_platform.fan import Fan + from sonic_platform.thermal import Thermal except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -45,6 +46,11 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None): psu_fan = Fan(0, psu_fan_idx, pddf_data, pddf_plugin_data, True, self.psu_index) self._fan_list.append(psu_fan) + self.num_psu_thermals = 1 # Fixing it 1 for now + for psu_thermal_idx in range(self.num_psu_thermals): + psu_thermal = Thermal(psu_thermal_idx, pddf_data, pddf_plugin_data, True, self.psu_index) + self._thermal_list.append(psu_thermal) + def get_num_fans(self): """ Retrieves the number of fan modules available on this PSU 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 644292eb17e5..a0fe6a28bf44 100644 --- 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 @@ -22,7 +22,7 @@ class PddfThermal(ThermalBase): pddf_obj = {} plugin_data = {} - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): if not pddf_data or not pddf_plugin_data: raise ValueError('PDDF JSON data error') @@ -35,78 +35,129 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None): self.thermal_obj_name = "TEMP{}".format(self.thermal_index) self.thermal_obj = self.pddf_obj.data[self.thermal_obj_name] + self.is_psu_thermal = is_psu_thermal + if self.is_psu_thermal: + self.thermals_psu_index = psu_index + def get_name(self): - if 'dev_attr' in self.thermal_obj.keys(): - 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) + if self.is_psu_thermal: + return "PSU{}_TEMP{}".format(self.thermals_psu_index, self.thermal_index) + else: + if 'dev_attr' in self.thermal_obj.keys(): + 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) + + def get_presence(self): + if self.is_psu_thermal: + # Temp sensor on the PSU + device = "PSU{}".format(self.thermals_psu_index) + output = self.pddf_obj.get_attr_name_output(device, "psu_present") + if not output: + return False + + mode = output['mode'] + status = output['status'] + + vmap = self.plugin_data['PSU']['psu_present'][mode]['valmap'] + + if status.rstrip('\n') in vmap: + return vmap[status.rstrip('\n')] + else: + return False + else: + # Temp sensor on the board + return True def get_temperature(self): - output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_input") - if not output: - return None + if self.is_psu_thermal: + device = "PSU{}".format(self.thermals_psu_index) + output = self.pddf_obj.get_attr_name_output(device, "psu_temp1_input") + if not output: + return None - if output['status'].isalpha(): - attr_value = None + temp1 = output['status'] + # temperature returned is in milli celcius + return float(temp1)/1000 else: - attr_value = float(output['status']) + output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_input") + if not output: + return None - if output['mode'] == 'bmc': - return attr_value - else: - return (attr_value/float(1000)) + if output['status'].isalpha(): + attr_value = None + else: + attr_value = float(output['status']) + + 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: - return None + if not self.is_psu_thermal: + output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_high_threshold") + if not output: + return None - if output['status'].isalpha(): - attr_value = None - else: - attr_value = float(output['status']) + 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)) else: - return (attr_value/float(1000)) + raise NotImplementedError + def get_low_threshold(self): - output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_low_threshold") - if not output: - return None + if not self.is_psu_thermal: + output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_low_threshold") + if not output: + return None - if output['status'].isalpha(): - attr_value = None - else: - attr_value = float(output['status']) + 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)) else: - return (attr_value/float(1000)) + raise NotImplementedError 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) - return None + if not self.is_psu_thermal: + node = self.pddf_obj.get_path(self.thermal_obj_name, "temp1_high_threshold") + if node is None: + print("ERROR %s does not exist" % node) + return None - cmd = "echo '%d' > %s" % (temperature * 1000, node) - os.system(cmd) + cmd = "echo '%d' > %s" % (temperature * 1000, node) + os.system(cmd) - return (True) + return (True) + else: + raise NotImplementedError 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) - return None - cmd = "echo '%d' > %s" % (temperature * 1000, node) - os.system(cmd) + if not self.is_psu_thermal: + node = self.pddf_obj.get_path(self.thermal_obj_name, "temp1_low_threshold") + if node is None: + print("ERROR %s does not exist" % node) + return None + cmd = "echo '%d' > %s" % (temperature * 1000, node) + os.system(cmd) - return (True) + return (True) + else: + raise NotImplementedError def get_high_critical_threshold(self): """ @@ -116,19 +167,22 @@ def get_high_critical_threshold(self): A float number, the high critical threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_high_crit_threshold") - if not output: - return None + if not self.is_psu_thermal: + output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_high_crit_threshold") + if not output: + return None - if output['status'].isalpha(): - attr_value = None - else: - attr_value = float(output['status']) + 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)) else: - return (attr_value/float(1000)) + raise NotImplementedError def get_low_critical_threshold(self): """ @@ -138,22 +192,24 @@ def get_low_critical_threshold(self): A float number, the low critical threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_low_crit_threshold") - if not output: - return None + if not self.is_psu_thermal: + output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_low_crit_threshold") + if not output: + return None - if output['status'].isalpha(): - attr_value = None - else: - attr_value = float(output['status']) + 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)) else: - return (attr_value/float(1000)) + raise NotImplementedError # Helper Functions - def get_temp_label(self): if 'bmc' in self.pddf_obj.data[self.thermal_obj_name].keys(): return None From 64822d80b1e12319639f302e7b29df18d1f38b41 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Fri, 18 Mar 2022 11:31:38 -0700 Subject: [PATCH 021/119] [sonic-linkmgrd][master] submodule update (#10271) f00efef Longxiang Lyu Wed Mar 16 09:12:46 2022 +0800 Add a command line option to store logs into a separate file (#41) ff2e67d Longxiang Lyu Tue Mar 15 09:10:59 2022 +0800 Add default port cable type (#39) ebbb4d8 Jing Zhang Mon Mar 14 15:41:11 2022 -0700 Prevent switching MUX to "Unknown" (#36) c779b8f Longxiang Lyu Thu Mar 10 21:35:11 2022 +0800 [nonfunctional] Use LinkProberStateMachineBase (#38) b9fedd0 Longxiang Lyu Wed Mar 9 13:03:58 2022 +0800 [NONFUNCTIONAL] Add LinkProberStateMachineBase (#37) bedd42b Longxiang Lyu Wed Mar 9 10:03:00 2022 +0800 Add .clang-format file to format code (#28) 9fe4fc6 Guohan Lu Thu Mar 3 17:51:43 2022 -0800 [doc]: add lgtm badge in README.md c1249d9 Longxiang Lyu Wed Mar 2 18:05:18 2022 +0800 Enable lgtm (#33) b8514c6 Longxiang Lyu Wed Mar 2 13:34:39 2022 +0800 Collect port cable type to use corresponding state machine (#31) 9b59ef9 Longxiang Lyu Wed Mar 2 07:19:33 2022 +0800 Improve make clean (#32) --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index ce72b0d2b8bb..f00efefd3099 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit ce72b0d2b8bb10c8734d841cf27614c2e3b197c8 +Subproject commit f00efefd30995de447fd6932369cb5be250ddf90 From 3a4ed995930ae0991797ff29ed92bb40e2090475 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Fri, 18 Mar 2022 12:10:30 -0700 Subject: [PATCH 022/119] [Arista] Update driver submodules (#10267) - Fix i2c bus on crow cpu - Fix exception handling in logs - Improve linecard mgmt interface configuration - Add new PSU models for chassis - Misc fixes --- platform/barefoot/sonic-platform-modules-arista | 2 +- platform/broadcom/sonic-platform-modules-arista | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index 516ece8126ed..da8370423b07 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 516ece8126ed8ad35b23c40782ec75dc836b4850 +Subproject commit da8370423b07c9271fad515c9ef1fd6149abbeed diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 516ece8126ed..da8370423b07 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 516ece8126ed8ad35b23c40782ec75dc836b4850 +Subproject commit da8370423b07c9271fad515c9ef1fd6149abbeed From 9d2078c446d2b56a49a55bee7e16c128ab8a6e5d Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sat, 19 Mar 2022 03:11:13 +0800 Subject: [PATCH 023/119] [Mellanox] Update Mellanox SN2201 device specific files (#10275) Update device-specific files for new platform SN2201, including: device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/buffers_defaults_objects.j2 device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/hwsku.json device/mellanox/x86_64-nvidia_sn2201-r0/default_sku device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml device/mellanox/x86_64-nvidia_sn2201-r0/platform.json device/mellanox/x86_64-nvidia_sn2201-r0/platform_components.json device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf Signed-off-by: Kebo Liu Co-authored-by: Stephen Sun --- .../ACS-SN2201/buffers_defaults_objects.j2 | 1 + .../ACS-SN2201/hwsku.json | 144 ++++++++++++------ .../x86_64-nvidia_sn2201-r0/default_sku | 2 +- .../x86_64-nvidia_sn2201-r0/pcie.yaml | 130 +++++++--------- .../x86_64-nvidia_sn2201-r0/platform.json | 134 +++++++++------- .../platform_components.json | 12 ++ .../x86_64-nvidia_sn2201-r0/sensors.conf | 133 ++++++++++++++-- 7 files changed, 373 insertions(+), 183 deletions(-) create mode 120000 device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/buffers_defaults_objects.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn2201-r0/platform_components.json diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/buffers_defaults_objects.j2 b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/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-nvidia_sn2201-r0/ACS-SN2201/hwsku.json b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/hwsku.json index fcd6343ca905..435135cef434 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/hwsku.json +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/hwsku.json @@ -1,148 +1,196 @@ { "interfaces": { "Ethernet0": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet1": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet2": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet3": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet4": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet5": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet6": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet7": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet8": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet9": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet10": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet11": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet12": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet13": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet14": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet15": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet16": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet17": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet18": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet19": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet20": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet21": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet22": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet23": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet24": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet25": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet26": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet27": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet28": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet29": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet30": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet31": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet32": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet33": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet34": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet35": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet36": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet37": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet38": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet39": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet40": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet41": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet42": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet43": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet44": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet45": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet46": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet47": { - "default_brkout_mode": "1x1G[100]" + "default_brkout_mode": "1x1000[100,10]", + "port_type": "RJ45" }, "Ethernet48": { "default_brkout_mode": "1x100G[50G,40G,25G,10G]" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/default_sku b/device/mellanox/x86_64-nvidia_sn2201-r0/default_sku index 46029c3e83e3..2ef2c5dd0d32 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/default_sku +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/default_sku @@ -1 +1 @@ -ACS-MSN2201 t1 +ACS-SN2201 t1 diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml index 49de6829aa70..51ffd949d54a 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml @@ -19,107 +19,114 @@ dev: '00' fn: '0' id: '1980' - name: 'Host bridge: Intel Corporation Device (rev 11)' + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series System Agent (rev + 11)' - bus: '00' dev: '04' fn: '0' - id: '19a1' - name: 'Host bridge: Intel Corporation Device (rev 11)' + id: 19a1 + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series Error Registers + (rev 11)' - bus: '00' dev: '05' fn: '0' - id: '19a2' - name: 'Generic system peripheral: Intel Corporation Device (rev 11)' + id: 19a2 + name: 'Generic system peripheral [0807]: Intel Corporation Atom Processor C3000 + Series Root Complex Event Collector (rev 11)' - bus: '00' dev: '06' fn: '0' - id: '19a3' - name: 'PCI bridge: Intel Corporation Device (rev 11)' + id: 19a3 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated QAT + Root Port (rev 11)' - bus: '00' - dev: '09' + dev: 09 fn: '0' - id: '19a4' - name: 'PCI bridge: Intel Corporation Device (rev 11)' + id: 19a4 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #0 (rev 11)' - bus: '00' - dev: '0b' + dev: 0b fn: '0' - id: '19a6' - name: 'PCI bridge: Intel Corporation Device (rev 11)' + id: 19a6 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #2 (rev 11)' - bus: '00' - dev: '0f' + dev: 0f fn: '0' - id: '19a9' - name: 'PCI bridge: Intel Corporation Device (rev 11)' + id: 19a9 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #5 (rev 11)' - bus: '00' dev: '10' fn: '0' - id: '19aa' - name: 'PCI bridge: Intel Corporation Device (rev 11)' + id: 19aa + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #6 (rev 11)' - bus: '00' - dev: 11 + dev: '11' fn: '0' - id: '19ab' - name: 'PCI bridge: Intel Corporation Device (rev 11)' + id: 19ab + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #7 (rev 11)' - bus: '00' - dev: 12 + dev: '12' fn: '0' id: 19ac - name: 'System peripheral: Intel Corporation DNV SMBus Contoller - Host (rev 11)' + name: 'System peripheral: Intel Corporation Atom Processor C3000 Series SMBus Contoller + - Host (rev 11)' - bus: '00' - dev: 15 + dev: '15' fn: '0' id: 19d0 - name: 'USB controller: Intel Corporation Device (rev 11)' + name: 'USB controller: Intel Corporation Atom Processor C3000 Series USB 3.0 xHCI + Controller (rev 11)' - bus: '00' - dev: 16 + dev: '18' fn: '0' - id: 19d1 - name: 'PCI bridge: Intel Corporation Device (rev 11)' -- bus: '00' - dev: 17 - fn: '0' - id: 19d2 - name: 'PCI bridge: Intel Corporation Device (rev 11)' -- bus: '00' - dev: 18 - fn: '0' - id: 1973 - name: 'Communication controller: Intel Corporation Device (rev 11)' + id: 19d3 + name: 'Communication controller: Intel Corporation Atom Processor C3000 Series ME + HECI 1 (rev 11)' - bus: '00' dev: 1c fn: '0' id: 19db - name: 'SD Host controller: Intel Corporation Device (rev 11)' + name: 'SD Host controller: Intel Corporation Device 19db (rev 11)' - bus: '00' dev: 1f fn: '0' id: 19dc - name: 'ISA bridge: Intel Corporation DNV LPC or eSPI (rev 11)' + name: 'ISA bridge: Intel Corporation Atom Processor C3000 Series LPC or eSPI (rev + 11)' - bus: '00' dev: 1f fn: '2' - id: 197e - name: 'Memory controller: Intel Corporation Device (rev 11)' + id: 19de + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Power Management + Controller (rev 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '4' id: 19df - name: 'SMBus: Intel Corporation DNV SMBus controller (rev 11)' + name: 'SMBus: Intel Corporation Atom Processor C3000 Series SMBus controller (rev + 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '5' id: 19e0 - name: 'Serial bus controller: Intel Corporation DNV SPI Controller (rev 11)' + name: 'Serial bus controller [0c80]: Intel Corporation Atom Processor C3000 Series + SPI Controller (rev 11)' - bus: '01' dev: '00' fn: '0' id: 19e2 - name: 'Co-processor: Intel Corporation Device (rev 11)' + name: 'Co-processor: Intel Corporation Atom Processor C3000 Series QuickAssist Technology + (rev 11)' - bus: '02' dev: '00' fn: '0' - id: 0026 - name: 'Non-Volatile memory controller: Device (rev 03)' + id: '0026' + name: 'Non-Volatile memory controller: Device 1dd4:0026 (rev 03)' - bus: '03' dev: '00' fn: '0' @@ -128,25 +135,6 @@ - bus: '06' dev: '00' fn: '0' - id: 1533 - name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)' -- bus: '07' - dev: '00' - fn: '0' - id: 15c3 - name: 'Ethernet controller: Intel Corporation Device (rev 11)' -- bus: '07' - dev: '00' - fn: '1' - id: 15c3 - name: 'Ethernet controller: Intel Corporation Device (rev 11)' -- bus: '08' - dev: '00' - fn: '0' - id: 15c3 - name: 'Ethernet controller: Intel Corporation Device (rev 11)' -- bus: '08' - dev: '00' - fn: '1' - id: 15c3 - name: 'Ethernet controller: Intel Corporation Device (rev 11)' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/platform.json b/device/mellanox/x86_64-nvidia_sn2201-r0/platform.json index d98a191d0ad7..f600f26293ce 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/platform.json @@ -17,17 +17,39 @@ "name": "CPLD2" } ], - "fans": [{ - "name": "fan1" + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + } + ] }, { - "name": "fan2" + "name": "drawer2", + "fans": [ + { + "name": "fan2" + } + ] }, { - "name": "fan3" + "name": "drawer3", + "fans": [ + { + "name": "fan3" + } + ] }, { - "name": "fan4" + "name": "drawer4", + "fans": [ + { + "name": "fan4" + } + ] } ], "psus": [ @@ -65,6 +87,12 @@ { "name": "Ambient Fan Side Temp" }, + { + "name": "Ambient CPU Board Temp" + }, + { + "name": "Ambient Switch Board Temp" + }, { "name": "CPU Pack Temp" }, @@ -109,56 +137,56 @@ "index": "1", "lanes": "0", "breakout_modes": { - "1x1G[100]": ["etp1"] + "1x1000[100,10]": ["etp1"] } }, "Ethernet1": { "index": "2", "lanes": "4", "breakout_modes": { - "1x1G[100]": ["etp2"] + "1x1000[100,10]": ["etp2"] } }, "Ethernet2": { "index": "3", "lanes": "8", "breakout_modes": { - "1x1G[100]": ["etp3"] + "1x1000[100,10]": ["etp3"] } }, "Ethernet3": { "index": "4", "lanes": "12", "breakout_modes": { - "1x1G[100]": ["etp4"] + "1x1000[100,10]": ["etp4"] } }, "Ethernet4": { "index": "5", "lanes": "16", "breakout_modes": { - "1x1G[100]": ["etp5"] + "1x1000[100,10]": ["etp5"] } }, "Ethernet5": { "index": "6", "lanes": "20", "breakout_modes": { - "1x1G[100]": ["etp6"] + "1x1000[100,10]": ["etp6"] } }, "Ethernet6": { "index": "7", "lanes": "24", "breakout_modes": { - "1x1G[100]": ["etp7"] + "1x1000[100,10]": ["etp7"] } }, "Ethernet7": { "index": "8", "lanes": "28", "breakout_modes": { - "1x1G[100]": ["etp8"] + "1x1000[100,10]": ["etp8"] } }, @@ -166,56 +194,56 @@ "index": "9", "lanes": "32", "breakout_modes": { - "1x1G[100]": ["etp9"] + "1x1000[100,10]": ["etp9"] } }, "Ethernet9": { "index": "10", "lanes": "36", "breakout_modes": { - "1x1G[100]": ["etp10"] + "1x1000[100,10]": ["etp10"] } }, "Ethernet10": { "index": "11", "lanes": "40", "breakout_modes": { - "1x1G[100]": ["etp11"] + "1x1000[100,10]": ["etp11"] } }, "Ethernet11": { "index": "12", "lanes": "44", "breakout_modes": { - "1x1G[100]": ["etp12"] + "1x1000[100,10]": ["etp12"] } }, "Ethernet12": { "index": "13", "lanes": "48", "breakout_modes": { - "1x1G[100]": ["etp13"] + "1x1000[100,10]": ["etp13"] } }, "Ethernet13": { "index": "14", "lanes": "52", "breakout_modes": { - "1x1G[100]": ["etp14"] + "1x1000[100,10]": ["etp14"] } }, "Ethernet14": { "index": "15", "lanes": "56", "breakout_modes": { - "1x1G[100]": ["etp15"] + "1x1000[100,10]": ["etp15"] } }, "Ethernet15": { "index": "16", "lanes": "60", "breakout_modes": { - "1x1G[100]": ["etp16"] + "1x1000[100,10]": ["etp16"] } }, @@ -223,224 +251,224 @@ "index": "17", "lanes": "64", "breakout_modes": { - "1x1G[100]": ["etp17"] + "1x1000[100,10]": ["etp17"] } }, "Ethernet17": { "index": "18", "lanes": "68", "breakout_modes": { - "1x1G[100]": ["etp18"] + "1x1000[100,10]": ["etp18"] } }, "Ethernet18": { "index": "19", "lanes": "72", "breakout_modes": { - "1x1G[100]": ["etp19"] + "1x1000[100,10]": ["etp19"] } }, "Ethernet19": { "index": "20", "lanes": "76", "breakout_modes": { - "1x1G[100]": ["etp20"] + "1x1000[100,10]": ["etp20"] } }, "Ethernet20": { "index": "21", "lanes": "80", "breakout_modes": { - "1x1G[100]": ["etp21"] + "1x1000[100,10]": ["etp21"] } }, "Ethernet21": { "index": "22", "lanes": "84", "breakout_modes": { - "1x1G[100]": ["etp22"] + "1x1000[100,10]": ["etp22"] } }, "Ethernet22": { "index": "23", "lanes": "88", "breakout_modes": { - "1x1G[100]": ["etp23"] + "1x1000[100,10]": ["etp23"] } }, "Ethernet23": { "index": "24", "lanes": "92", "breakout_modes": { - "1x1G[100]": ["etp24"] + "1x1000[100,10]": ["etp24"] } }, "Ethernet24": { "index": "25", "lanes": "96", "breakout_modes": { - "1x1G[100]": ["etp25"] + "1x1000[100,10]": ["etp25"] } }, "Ethernet25": { "index": "26", "lanes": "100", "breakout_modes": { - "1x1G[100]": ["etp26"] + "1x1000[100,10]": ["etp26"] } }, "Ethernet26": { "index": "27", "lanes": "104", "breakout_modes": { - "1x1G[100]": ["etp27"] + "1x1000[100,10]": ["etp27"] } }, "Ethernet27": { "index": "28", "lanes": "108", "breakout_modes": { - "1x1G[100]": ["etp28"] + "1x1000[100,10]": ["etp28"] } }, "Ethernet28": { "index": "29", "lanes": "112", "breakout_modes": { - "1x1G[100]": ["etp29"] + "1x1000[100,10]": ["etp29"] } }, "Ethernet29": { "index": "30", "lanes": "116", "breakout_modes": { - "1x1G[100]": ["etp30"] + "1x1000[100,10]": ["etp30"] } }, "Ethernet30": { "index": "31", "lanes": "120", "breakout_modes": { - "1x1G[100]": ["etp31"] + "1x1000[100,10]": ["etp31"] } }, "Ethernet31": { "index": "32", "lanes": "124", "breakout_modes": { - "1x1G[100]": ["etp32"] + "1x1000[100,10]": ["etp32"] } }, "Ethernet32": { "index": "33", "lanes": "128", "breakout_modes": { - "1x1G[100]": ["etp33"] + "1x1000[100,10]": ["etp33"] } }, "Ethernet33": { "index": "34", "lanes": "132", "breakout_modes": { - "1x1G[100]": ["etp34"] + "1x1000[100,10]": ["etp34"] } }, "Ethernet34": { "index": "35", "lanes": "136", "breakout_modes": { - "1x1G[100]": ["etp35"] + "1x1000[100,10]": ["etp35"] } }, "Ethernet35": { "index": "36", "lanes": "140", "breakout_modes": { - "1x1G[100]": ["etp36"] + "1x1000[100,10]": ["etp36"] } }, "Ethernet36": { "index": "37", "lanes": "144", "breakout_modes": { - "1x1G[100]": ["etp37"] + "1x1000[100,10]": ["etp37"] } }, "Ethernet37": { "index": "38", "lanes": "148", "breakout_modes": { - "1x1G[100]": ["etp38"] + "1x1000[100,10]": ["etp38"] } }, "Ethernet38": { "index": "39", "lanes": "152", "breakout_modes": { - "1x1G[100]": ["etp39"] + "1x1000[100,10]": ["etp39"] } }, "Ethernet39": { "index": "40", "lanes": "156", "breakout_modes": { - "1x1G[100]": ["etp40"] + "1x1000[100,10]": ["etp40"] } }, "Ethernet40": { "index": "41", "lanes": "160", "breakout_modes": { - "1x1G[100]": ["etp41"] + "1x1000[100,10]": ["etp41"] } }, "Ethernet41": { "index": "42", "lanes": "164", "breakout_modes": { - "1x1G[100]": ["etp42"] + "1x1000[100,10]": ["etp42"] } }, "Ethernet42": { "index": "43", "lanes": "168", "breakout_modes": { - "1x1G[100]": ["etp43"] + "1x1000[100,10]": ["etp43"] } }, "Ethernet43": { "index": "44", "lanes": "172", "breakout_modes": { - "1x1G[100]": ["etp44"] + "1x1000[100,10]": ["etp44"] } }, "Ethernet44": { "index": "45", "lanes": "176", "breakout_modes": { - "1x1G[100]": ["etp45"] + "1x1000[100,10]": ["etp45"] } }, "Ethernet45": { "index": "46", "lanes": "180", "breakout_modes": { - "1x1G[100]": ["etp46"] + "1x1000[100,10]": ["etp46"] } }, "Ethernet46": { "index": "47", "lanes": "184", "breakout_modes": { - "1x1G[100]": ["etp47"] + "1x1000[100,10]": ["etp47"] } }, "Ethernet47": { "index": "48", "lanes": "188", "breakout_modes": { - "1x1G[100]": ["etp48"] + "1x1000[100,10]": ["etp48"] } }, "Ethernet48": { diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/platform_components.json b/device/mellanox/x86_64-nvidia_sn2201-r0/platform_components.json new file mode 100644 index 000000000000..e28c19087875 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/platform_components.json @@ -0,0 +1,12 @@ +{ + "chassis": { + "SN2201": { + "component": { + "ONIE": { }, + "SSD": { }, + "CPLD1": { }, + "CPLD2": { } + } + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf index 176502c4731a..1c29cfd2d7b3 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf @@ -6,7 +6,11 @@ # Fan Controller emc2305. bus "i2c-7" "i2c-1-mux (chan_id 5)" - chip "emc2305-i2c-7-4d" + chip "emc2305-i2c-7-4d" + label fan1 "Chassis Fan Drawer-1" + label fan2 "Chassis Fan Drawer-2" + label fan3 "Chassis Fan Drawer-3" + label fan4 "Chassis Fan Drawer-4" ignore fan5 # Temperature sensors @@ -14,6 +18,59 @@ chip "coretemp-isa-0000" label temp8 "Core 0" label temp14 "Core 1" +bus "i2c-2" "i2c-1-mux (chan_id 4)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + bus "i2c-2" "i2c-1-mux (chan_id 0)" chip "lm75-i2c-*-4a" label temp1 "Ambient Switch Board Temp" @@ -33,15 +90,71 @@ bus "i2c-8" "i2c-1-mux (chan_id 6)" # Power controllers bus "i2c-9" "i2c-1-mux (chan_id 7)" chip "pmbus-i2c-*-40" - ignore curr3 - ignore in3 - ignore power3 + label curr1 "VR IC PSU 12V Rail Curr(in)" + label curr2 "ASIC 0.9V VCORE Rail Curr(out)" + label in1 "VR IC PSU 12V Rail" + label in2 "VR IC ASIC 0.9V VCORE Rail" + label power1 "VR IC PSU 12V Rail Pwr(in)" + label power2 "ASIC 0.9V VCORE Rail Pwr(out)" + ignore curr3 + ignore in3 + ignore power3 + label temp1 "VR IC Temp1" bus "i2c-2" "i2c-1-mux (chan_id 0)" chip "ads1015-i2c-*-49" - ignore in1 - ignore in2 - ignore in4 - ignore in5 - ignore in6 - ignore in7 + label in0 "ASIC 1.8V Rail" + label in3 "MONITOR MB 12V" + compute in3 (7.2)*@, @/(7.2) + ignore in1 + ignore in2 + ignore in4 + ignore in5 + ignore in6 + ignore in7 + +bus "i2c-8" "i2c-1-mux (chan_id 6)" + chip "powr1014-i2c-8-37" + label in0 "MONITOR CPU Board V3P3" + label in1 "MONITOR CPU Board VR_VCC_1V15" + label in2 "MONITOR CPU Board VR_VNN_1V05" + label in3 "MONITOR CPU Board VR_VCCRAM_1V15" + label in4 "MONITOR CPU Board VR_VDDQ_1V20" + label in5 "MONITOR CPU Board V1P05" + label in6 "MONITOR CPU Board P2V5_VPP" + label in7 "MONITOR CPU Board P0V6_VTT_DIMM" + label in8 "MONITOR CPU Board V1P8" + label in9 "MONITOR CPU Board V1P24" + +# PSU PMBus sensors +bus "i2c-3" "i2c-1-mux (chan_id 1)" + chip "pmbus-i2c-3-58" + label in1 "PSU-1 220V Rail(in)" + label in2 "PSU-1 12V Rail(out)" + ignore in3 + label fan1 "PSU-1 Fan1" + label temp1 "PSU-1 Temp1" + label temp2 "PSU-1 Temp2" + label temp3 "PSU-1 Temp3" + label curr1 "PSU-1 220V Rail Curr(in)" + label curr2 "PSU-1 12V Rail Curr(out)" + ignore curr3 + label power1 "PSU-1 220V Rail Pwr(in)" + label power2 "PSU-1 12V Rail Pwr(out)" + ignore power3 + +bus "i2c-4" "i2c-1-mux (chan_id 2)" + chip "pmbus-i2c-4-58" + label in1 "PSU-2 220V Rail(in)" + label in2 "PSU-2 12V Rail(out)" + ignore in3 + label fan1 "PSU-2 Fan1" + label temp1 "PSU-2 Temp1" + label temp2 "PSU-2 Temp2" + label temp3 "PSU-2 Temp3" + label curr1 "PSU-2 220V Rail Curr(in)" + label curr2 "PSU-2 12V Rail Curr(out)" + ignore curr3 + label power1 "PSU-2 220V Rail Pwr(in)" + label power2 "PSU-2 12V Rail Pwr(out)" + ignore power3 From fb7f046143bfe0356237352a412ac6cb52a4e341 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Sat, 19 Mar 2022 08:27:02 +0800 Subject: [PATCH 024/119] [yang] Update YANG model for mirror session to support decimal value for GRE type (#10140) #### Why I did it PR https://github.com/Azure/sonic-utilities/pull/1825 added validation for the input of `config mirror session add`, and only decimal value is accepted. An issue https://github.com/Azure/sonic-buildimage/issues/10096 was raised to suggest accepting HEX value as well, and the suggestion makes sense to me. To accept HEX value for GRE type, and keep backward compatibility as well, I updated the YANG model to support both decimal and hexadecimal input for GRE type. #### How I did it Update the regex for GRE type. #### How to verify it Verified by UT ``` platform linux -- Python 3.9.2, pytest-6.0.2, py-1.10.0, pluggy-0.13.0 rootdir: /sonic/src/sonic-yang-models plugins: pyfakefs-4.5.4, cov-2.10.1 collected 3 items tests/test_sonic_yang_models.py .. [ 66%] tests/yang_model_tests/test_yang_model.py . [100%] ========================================================================================== 3 passed in 2.53s ========================================================================================== ``` #### Description for the changelog Update YANG model for mirror session to support decimal value for GRE type. --- .../tests/mirror_session.json | 24 ++++- .../tests_config/mirror_session.json | 100 +++++++++++++++++- .../yang-models/sonic-mirror-session.yang | 2 +- 3 files changed, 121 insertions(+), 5 deletions(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json b/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json index 6d53b0e9cffb..c54ca3d9595a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json @@ -1,6 +1,18 @@ { - "MIRROR_ERSPAN_ENTRY_WITH_VALID_VALUES": { - "desc": "Configuring ERSPAN entry with valid values." + "MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES": { + "desc": "Configuring ERSPAN entry with valid heximal values." + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES_1": { + "desc": "Configuring ERSPAN entry with valid heximal values." + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES": { + "desc": "Configuring ERSPAN entry with valid decimal values." + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_1": { + "desc": "Configuring ERSPAN entry with valid decimal values." + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_2": { + "desc": "Configuring ERSPAN entry with valid decimal values." }, "MIRROR_ERSPAN_ENTRY_WRONG_TYPE": { "desc": "Configuring ERSPAN entry with invalid type", @@ -26,6 +38,14 @@ "desc": "Configuring ERSPAN entry with invalid GRE type", "eStrKey" : "Pattern" }, + "MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_1": { + "desc": "Configuring ERSPAN entry with invalid GRE type", + "eStrKey" : "Pattern" + }, + "MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_2": { + "desc": "Configuring ERSPAN entry with invalid GRE type", + "eStrKey" : "Pattern" + }, "MIRROR_ERSPAN_ENTRY_GRE_WRONG_TYPE": { "desc": "Configuring ERSPAN entry with invalid GRE type", "eStrKey" : "When" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json index ddf956c79f83..5e820b5f5fdf 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json @@ -1,5 +1,5 @@ { - "MIRROR_ERSPAN_ENTRY_WITH_VALID_VALUES": { + "MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES": { "sonic-mirror-session:sonic-mirror-session": { "MIRROR_SESSION": { "MIRROR_SESSION_LIST": [ @@ -15,6 +15,70 @@ } } }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES_1": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "0x0", + "dscp": "10" + } + ] + } + } + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "1234", + "dscp": "10" + } + ] + } + } + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_1": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "65535", + "dscp": "10" + } + ] + } + } + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_2": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "0", + "dscp": "10" + } + ] + } + } + }, "MIRROR_ERSPAN_ENTRY_WRONG_TYPE": { "sonic-mirror-session:sonic-mirror-session": { "MIRROR_SESSION": { @@ -104,7 +168,39 @@ "type": "ERSPAN", "dst_ip": "11.1.1.1", "src_ip": "10.1.1.1", - "gre_type": "0", + "gre_type": "100000", + "dscp": "10" + } + ] + } + } + }, + "MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_1": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "-1", + "dscp": "10" + } + ] + } + } + }, + "MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_2": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "65536", "dscp": "10" } ] diff --git a/src/sonic-yang-models/yang-models/sonic-mirror-session.yang b/src/sonic-yang-models/yang-models/sonic-mirror-session.yang index ba8a1e13c7d6..9ea1954d7a37 100644 --- a/src/sonic-yang-models/yang-models/sonic-mirror-session.yang +++ b/src/sonic-yang-models/yang-models/sonic-mirror-session.yang @@ -99,7 +99,7 @@ module sonic-mirror-session { leaf gre_type { when "current()/../type = 'ERSPAN'"; type string { - pattern "0[xX][0-9a-fA-F]*"; + pattern "0[xX][0-9a-fA-F]*|([0-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[0-5])"; length 1..6 { error-message "Invalid GRE type"; error-app-tag gre-type-invalid; From ed4f19fb28142a2221c9c5c27aede3ecdb9b83c8 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 19 Mar 2022 21:48:27 +0800 Subject: [PATCH 025/119] [Build][Bug]: fix the warning message not printed as expected issue (#10278) Fix the warning message not printed as expected issue --- src/sonic-build-hooks/hooks/apt-get | 4 ++-- src/sonic-build-hooks/scripts/buildinfo_base.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sonic-build-hooks/hooks/apt-get b/src/sonic-build-hooks/hooks/apt-get index f1f789542b7a..625b06843610 100755 --- a/src/sonic-build-hooks/hooks/apt-get +++ b/src/sonic-build-hooks/hooks/apt-get @@ -10,10 +10,10 @@ if [ -z "$REAL_COMMAND" ]; then exit 1 fi -INSTALL=$(check_apt_install) +INSTALL=$(check_apt_install "$@") COMMAND_INFO="Locked by command: $REAL_COMMAND $@" if [ "$INSTALL" == y ]; then - check_apt_version + check_apt_version "$@" lock_result=$(acquire_apt_installation_lock "$COMMAND_INFO" ) $REAL_COMMAND "$@" command_result=$? diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index 22ab3da4e9ae..3873d1362926 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -213,6 +213,10 @@ check_apt_version() continue fi + if [ "$para" == "install" ]; then + continue + fi + if [[ "$para" == *=* ]]; then continue else From dc04d64219cc1d207fc32eb3bf23841d358deb99 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Sun, 20 Mar 2022 16:34:04 +0800 Subject: [PATCH 026/119] [Mellanox] Fix issue: psu might use wrong voltage sysfs which causes invalid voltage value (#10231) - Why I did it Fix issue: psu might use wrong voltage sysfs which causes invalid voltage value. The flow is like: 1. User power off a PSU 2. All sysfs files related to this PSU are removed 3. User did a reboot/config reload 4. PSU will use wrong sysfs as voltage node - How I did it Always try find an existing sysfs. - How to verify it Manual test --- .../mlnx-platform-api/sonic_platform/psu.py | 57 +++++++++++++++---- .../mlnx-platform-api/tests/test_psu.py | 6 ++ 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py index 160fd8bd7469..64aa0166086f 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py @@ -200,16 +200,10 @@ class Psu(FixedPsu): def __init__(self, psu_index): super(Psu, self).__init__(psu_index) - psu_voltage_out2 = os.path.join(PSU_PATH, "power/psu{}_volt_out2".format(self.index)) - psu_voltage = os.path.join(PSU_PATH, "power/psu{}_volt".format(self.index)) - # Workaround for psu voltage sysfs file as the file name differs among platforms - if os.path.exists(psu_voltage_out2): - self.psu_voltage = psu_voltage_out2 - else: - self.psu_voltage = psu_voltage - self.psu_voltage_min = self.psu_voltage + "_min" - self.psu_voltage_max = self.psu_voltage + "_max" - self.psu_voltage_capability = self.psu_voltage + "_capability" + self._psu_voltage = None + self._psu_voltage_min = None + self._psu_voltage_max = None + self._psu_voltage_capability = None self.psu_current = os.path.join(PSU_PATH, self.PSU_CURRENT.format(self.index)) self.psu_power = os.path.join(PSU_PATH, self.PSU_POWER.format(self.index)) @@ -228,6 +222,47 @@ def __init__(self, psu_index): from .thermal import initialize_psu_thermal self._thermal_list = initialize_psu_thermal(psu_index, self.get_power_available_status) + @property + def psu_voltage(self): + if not self._psu_voltage: + psu_voltage_out = os.path.join(PSU_PATH, "power/psu{}_volt_out2".format(self.index)) + if os.path.exists(psu_voltage_out): + self._psu_voltage = psu_voltage_out + else: + psu_voltage_out = os.path.join(PSU_PATH, "power/psu{}_volt".format(self.index)) + if os.path.exists(psu_voltage_out): + self._psu_voltage = psu_voltage_out + + return self._psu_voltage + + @property + def psu_voltage_min(self): + if not self._psu_voltage_min: + psu_voltage = self.psu_voltage + if psu_voltage: + self._psu_voltage_min = psu_voltage + "_min" + + return self._psu_voltage_min + + @property + def psu_voltage_max(self): + if not self._psu_voltage_max: + psu_voltage = self.psu_voltage + if psu_voltage: + self._psu_voltage_max = psu_voltage + "_max" + + return self._psu_voltage_max + + @property + def psu_voltage_capability(self): + if not self._psu_voltage_capability: + psu_voltage = self.psu_voltage + if psu_voltage: + self._psu_voltage_capability = psu_voltage + "_capability" + + return self._psu_voltage_capability + + def get_model(self): """ Retrieves the model number (or part number) of the device @@ -272,7 +307,7 @@ def get_voltage(self): A float number, the output voltage in volts, e.g. 12.1 """ - if self.get_powergood_status(): + if self.get_powergood_status() and self.psu_voltage: # TODO: should we put log_func=None here? If not do this, when a PSU is back to power, some PSU related # sysfs may not ready, read_int_from_file would encounter exception and log an error. voltage = utils.read_int_from_file(self.psu_voltage, log_func=logger.log_info) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_psu.py b/platform/mellanox/mlnx-platform-api/tests/test_psu.py index 6de042e7bd8b..34fa70c7beca 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_psu.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_psu.py @@ -50,6 +50,7 @@ def test_fixed_psu(self): assert psu.get_temperature() is None assert psu.get_temperature_high_threshold() is None + @mock.patch('os.path.exists', mock.MagicMock(return_value=True)) def test_psu(self): psu = Psu(0) assert len(psu._fan_list) == 1 @@ -58,6 +59,8 @@ def test_psu(self): psu.psu_presence: 1, psu.psu_oper_status: 1, psu.psu_voltage: 10234, + psu.psu_voltage_min: 9000, + psu.psu_voltage_max: 12000, psu.psu_current: 20345, psu.psu_power: 30456, psu.psu_temp: 40567, @@ -68,6 +71,7 @@ def mock_read_int_from_file(file_path, **kwargs): return mock_sysfs_content[file_path] utils.read_int_from_file = mock_read_int_from_file + utils.read_str_from_file = mock.MagicMock(return_value='min max') assert psu.get_presence() is True mock_sysfs_content[psu.psu_presence] = 0 assert psu.get_presence() is False @@ -84,6 +88,8 @@ def mock_read_int_from_file(file_path, **kwargs): mock_sysfs_content[psu.psu_oper_status] = 1 assert psu.get_voltage() == 10.234 + assert psu.get_voltage_high_threshold() == 12.0 + assert psu.get_voltage_low_threshold() == 9.0 assert psu.get_current() == 20.345 assert psu.get_power() == 0.030456 assert psu.get_temperature() == 40.567 From 4659f8b8e807aa80defd6c521b2b9a62a1d8b3d8 Mon Sep 17 00:00:00 2001 From: liuh-80 <58683130+liuh-80@users.noreply.github.com> Date: Mon, 21 Mar 2022 08:33:12 +0800 Subject: [PATCH 027/119] [Submodule] Update src/sonic-utilities (#10272) Updating sonic-utilities sub module with the following commits b00b870 [build] stop vstest in the Azure pipeline 2c56e92 [GCU] Marking fields under BGP_PEER_RANGE, BGP_MONITORS as create-only 6289987 Fix sonic-installer failure due to missing import 45e6ac1 [show] add support for hwstatus in show muxcable status 93384ed Try get port operational speed from STATE DB 483fc6e [techsupport] Added a lock to avoid running techsupport in parallel 398da58 Validation check correction while adding a member to PortChannel a8a7edb [generate_dump] exclude mft and mlx folders from /etc 1cf1d03 Fix UT failed cause by change pycommon to use swsscommon --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 47c243eb7e9c..a2e68a05a8e6 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 47c243eb7e9cbe6ebd3479290a98183071cf2124 +Subproject commit a2e68a05a8e6ab296978a59bf107971beb899546 From 49ac9f9005cafbea419819598fbc4b0768464344 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 21 Mar 2022 10:27:24 +0800 Subject: [PATCH 028/119] [Build]: Support to set jobFilters (#10280) [Build]: Support to set jobFilters --- .../azure-pipelines-UpgrateVersion.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 5cd85ab5520b..0c7f7f966297 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -20,6 +20,20 @@ schedules: pool: sonicbld +parameters: +- name: 'jobFilters' + type: object + default: + - vs + - barefoot + - broadcom + - centec + - centec-arm64 + - generic + - innovium + - marvell-armhf + - mellanox + stages: - stage: Build variables: @@ -28,6 +42,7 @@ stages: jobs: - template: azure-pipelines-build.yml parameters: + jobFilters: ${{ parameters.jobFilters }} buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y' preSteps: - script: | From 87af5659c55bd1774aeb1d117a8a8f5336ed14a9 Mon Sep 17 00:00:00 2001 From: liuh-80 <58683130+liuh-80@users.noreply.github.com> Date: Mon, 21 Mar 2022 13:04:22 +0800 Subject: [PATCH 029/119] Update submodule sonic-snmpagent (#10277) Updating sonic-snmpagent submodule with the following commits dae8146 [ci]: Support code diff coverage 6bd51c4 Fix: LAG counters, if LAG don't have L3 interface 2654f4a Fix snmp agent Initialize config DB multiple times issue #### Why I did it When change pycommon to use swsscommon UT failed in sonic-snmpagent, need submodule update with UT issue fix. #### How I did it #### How to verify it #### Which release branch to backport (provide reason below if selected) #### Description for the changelog [ci]: Support code diff coverage Fix: LAG counters, if LAG don't have L3 interface Fix snmp agent Initialize config DB multiple times issue #### A picture of a cute animal (not mandatory but encouraged) --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 4ee573cddc4e..2654f4a66794 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 4ee573cddc4e356b589bcf29c19cedc4562a8b34 +Subproject commit 2654f4a667941296d4e56a16e8e1a7d1d5fca7b6 From 1017ee60023bf0046be00a3da859b874b51bf6b4 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 21 Mar 2022 16:47:20 +0800 Subject: [PATCH 030/119] [Build]: Use one debian mirror config (#10274) Why I did it Use one debian mirror config. The empty config in https://github.com/Azure/sonic-buildimage/blob/master/files/image_config/apt/sources.list overrides the file https://github.com/Azure/sonic-buildimage/blob/master/files/apt/sources.list.amd64 (armhf/arm64), it does not make sense. All the content in files/image_config/apt is no use, any one wants to add mirror config, please add in files/apt. How I did it Remove files/image_config/apt and the reference. --- files/apt/sources.list.amd64 | 22 +++++++------- files/apt/sources.list.arm64 | 20 ++++++------- files/apt/sources.list.armhf | 20 ++++++------- .../build_templates/sonic_debian_extension.j2 | 6 ---- files/image_config/apt/sonic-dev.gpg.key | 30 ------------------- files/image_config/apt/sources.list | 0 ...ian_archive_trafficmanager_net_debian.list | 3 -- .../arm64/debian_mirror_arm64.list | 9 ------ .../armhf/debian_mirror_armhf.list | 9 ------ 9 files changed, 30 insertions(+), 89 deletions(-) delete mode 100644 files/image_config/apt/sonic-dev.gpg.key delete mode 100644 files/image_config/apt/sources.list delete mode 100644 files/image_config/apt/sources.list.d/amd64/debian_archive_trafficmanager_net_debian.list delete mode 100644 files/image_config/apt/sources.list.d/arm64/debian_mirror_arm64.list delete mode 100644 files/image_config/apt/sources.list.d/armhf/debian_mirror_armhf.list diff --git a/files/apt/sources.list.amd64 b/files/apt/sources.list.amd64 index 04a2b143532d..fb0a1e994932 100644 --- a/files/apt/sources.list.amd64 +++ b/files/apt/sources.list.amd64 @@ -1,15 +1,13 @@ ## Debian mirror on Microsoft Azure ## Ref: http://debian-archive.trafficmanager.net/ -deb [arch=amd64] http://deb.debian.org/debian/ bullseye main contrib non-free -deb-src [arch=amd64] http://deb.debian.org/debian/ bullseye main contrib non-free -#deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free -#deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free -#deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye/updates main contrib non-free -#deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye/updates main contrib non-free -#deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye-backports main contrib non-free -#deb [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free -#deb-src [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free -#deb [arch=amd64] http://packages.trafficmanager.net/debian/debian-security/ bullseye_updates main contrib non-free -#deb-src [arch=amd64] http://packages.trafficmanager.net/debian/debian-security/ bullseye_updates main contrib non-free -#deb [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye-backports main contrib non-free +deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye-backports main contrib non-free +deb [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free +deb-src [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free +deb [arch=amd64] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free +deb-src [arch=amd64] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free +deb [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye-backports main contrib non-free diff --git a/files/apt/sources.list.arm64 b/files/apt/sources.list.arm64 index abd625070414..75bebe1a91d1 100644 --- a/files/apt/sources.list.arm64 +++ b/files/apt/sources.list.arm64 @@ -1,13 +1,13 @@ ## 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 bullseye main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian bullseye main contrib non-free -deb [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb [arch=arm64] http://ftp.debian.org/debian bullseye-backports main -# deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free -# deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free -# deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free -# deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free -# deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-backports main +deb [arch=arm64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +deb-src [arch=arm64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +deb [arch=arm64] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +deb-src [arch=arm64] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +deb [arch=arm64] http://debian-archive.trafficmanager.net/debian/ bullseye-backports main contrib non-free +deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free +deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free +deb [arch=arm64] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free +deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free +deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-backports main contrib non-free diff --git a/files/apt/sources.list.armhf b/files/apt/sources.list.armhf index ded8e27e6b2b..378aa084524e 100644 --- a/files/apt/sources.list.armhf +++ b/files/apt/sources.list.armhf @@ -1,13 +1,13 @@ ## 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 bullseye main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free -deb [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb [arch=armhf] http://ftp.debian.org/debian bullseye-backports main -# deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free -# deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free -# deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free -# deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free -# deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-backports main +deb [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +deb-src [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +deb [arch=armhf] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +deb-src [arch=armhf] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +deb [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye-backports main contrib non-free +deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free +deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free +deb [arch=armhf] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free +deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free +deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-backports main contrib non-free diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 455179c08029..a49e29406eeb 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -75,12 +75,6 @@ else sudo chroot $FILESYSTEM_ROOT $DOCKER_CTL_SCRIPT 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 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 b/files/image_config/apt/sources.list deleted file mode 100644 index e69de29bb2d1..000000000000 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 db55f3dd60cf..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/ bullseye main contrib non-free -#deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye/updates main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye-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 a34ce92658cc..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 bullseye main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian bullseye main contrib non-free -deb [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb [arch=arm64] http://security.debian.org bullseye-security main contrib non-free -deb-src [arch=arm64] http://security.debian.org bullseye-security main contrib non-free -deb [arch=arm64] https://download.docker.com/linux/debian bullseye stable -deb [arch=arm64] http://ftp.debian.org/debian bullseye-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 7c4865525feb..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 bullseye main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free -deb [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free -deb [arch=armhf] http://security.debian.org bullseye-security main contrib non-free -deb-src [arch=armhf] http://security.debian.org bullseye-security main contrib non-free -deb [arch=armhf] https://download.docker.com/linux/debian bullseye stable -deb [arch=armhf] http://ftp.debian.org/debian bullseye-backports main - From 92363eadbeff78e0a29344574115177e8c790cca Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 21 Mar 2022 17:10:33 +0800 Subject: [PATCH 031/119] [Build]: support to collect version when purging debian package (#10287) Why I did it support to collect version when purging debian package Support to collect version multiple times How I did it Add the collection action before purging. --- src/sonic-build-hooks/hooks/apt-get | 5 +++++ .../scripts/collect_version_files | 18 +++++++++++++++--- .../scripts/post_run_buildinfo | 2 -- .../scripts/pre_run_buildinfo | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/sonic-build-hooks/hooks/apt-get b/src/sonic-build-hooks/hooks/apt-get index 625b06843610..bdff703d01d7 100755 --- a/src/sonic-build-hooks/hooks/apt-get +++ b/src/sonic-build-hooks/hooks/apt-get @@ -20,6 +20,11 @@ if [ "$INSTALL" == y ]; then [ "$lock_result" == y ] && release_apt_installation_lock exit $command_result else + if [[ "$1" == "purge" || "$@" == *" purge "* ]]; 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 diff --git a/src/sonic-build-hooks/scripts/collect_version_files b/src/sonic-build-hooks/scripts/collect_version_files index b62beb4a2115..570883701e98 100755 --- a/src/sonic-build-hooks/scripts/collect_version_files +++ b/src/sonic-build-hooks/scripts/collect_version_files @@ -1,14 +1,26 @@ #!/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}" + +## Print the unique and sorted result +sort -u "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" +sort -u "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" +sort -u "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" exit 0 diff --git a/src/sonic-build-hooks/scripts/post_run_buildinfo b/src/sonic-build-hooks/scripts/post_run_buildinfo index 614389fd424c..e0d84d35bb08 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 diff --git a/src/sonic-build-hooks/scripts/pre_run_buildinfo b/src/sonic-build-hooks/scripts/pre_run_buildinfo index 3cf0cf7c8dfe..d9b927ab42f9 100755 --- a/src/sonic-build-hooks/scripts/pre_run_buildinfo +++ b/src/sonic-build-hooks/scripts/pre_run_buildinfo @@ -8,6 +8,8 @@ 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 symlink_build_hooks set_reproducible_mirrors From e4b507fa0309717f459fadaabcefb38e989153fd Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 21 Mar 2022 05:25:23 -0700 Subject: [PATCH 032/119] [Arista] rename management interface in initrd (#9856) On some products the pci enumeration adds randomness into which nic gets initialized first. Because SONiC doesn't use deterministic interface naming but instead old style interface naming, this leads to eth0 not always being the management port. To make sure eth0 is always the management port (SONiC expectation) rename the interfaces in the initramfs for Arista products. --- files/initramfs-tools/arista-net | 42 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/files/initramfs-tools/arista-net b/files/initramfs-tools/arista-net index 8759746458d6..64308630098c 100644 --- a/files/initramfs-tools/arista-net +++ b/files/initramfs-tools/arista-net @@ -95,19 +95,33 @@ fi # Iterate over all the net_maX items found in the cmdline two times. # First time renaming the interfaces to maX. # The second time renaming them to their final name ethX. -if [ -n "$aboot_flag" -a "$platform_flag" == 'rook' ]; then - for item in $items; do - key="${item%=*}" - value="${item#*=}" - arista_net_rename "$value" "$key" eth - done - for item in $items; do - key="${item%=*}" - value="${item#*=}" - index="${key#ma}" - index="$(( $index - 1 ))" - newKey="eth$index" - arista_net_rename "$value" "$newKey" ma - done +if [ -n "$aboot_flag" ]; then + if [ "$platform_flag" = 'rook' -o "$platform_flag" = 'lorikeet' ]; then + # Rename existing ethX interfaces to tmpX + for x in $(ls /sys/class/net/); do + case $x in + eth*) + value="${x#*eth}" + newname="tmp$value" + ip link set $x down + ip link set $x name "$newname" + ;; + *) + esac + done + for item in $items; do + key="${item%=*}" + value="${item#*=}" + arista_net_rename "$value" "$key" tmp + done + for item in $items; do + key="${item%=*}" + value="${item#*=}" + index="${key#ma}" + index="$(( $index - 1 ))" + newKey="eth$index" + arista_net_rename "$value" "$newKey" ma + done + fi fi From e919f4dafaaa92ee3dfa1dd33bb6bda7b5a655ea Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Mon, 21 Mar 2022 08:28:03 -0400 Subject: [PATCH 033/119] [Nokia][IXR7250E]Update Nokia IXR7250E platform device data file (#10091) Signed-off-by: mlok --- .../platform.json | 153 ++++++++++++----- .../Nokia-IXR7250E-SUP-10/platform.json | 161 ++++++++++++------ 2 files changed, 220 insertions(+), 94 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json index ad911fb609b0..55630de1126a 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json @@ -12,148 +12,209 @@ "name": "FPGA2" } ], - + "watchdog": { + "disarm": false + }, + "get_module_attributes": { + "model": false, + "serial": false, + "base_mac": false, + "system_eeprom_info": false + }, + "thermal_temperature": { + "minimum": 0, + "maximum": 110 + }, "fans": [], "fan_drawers": [], "master_psu_led_color": [], "psus": [], "thermals": [ { - "name": "temp_1(fan)" + "name": "temp_1(fan)", + "controllable": false }, { - "name": "temp_2(fan)" + "name": "temp_2(fan)", + "controllable": false }, { - "name": "temp_3" + "name": "temp_3(fan)", + "controllable": false }, { - "name": "temp_4" + "name": "temp_4", + "controllable": false }, { - "name": "temp_5" + "name": "temp_5", + "controllable": false }, { - "name": "temp_6" + "name": "temp_6(fan)", + "controllable": false }, { - "name": "temp_7" + "name": "temp_7(fan)", + "controllable": false }, { - "name": "temp_8" + "name": "temp_8(fan)", + "controllable": false }, { - "name": "temp_9" + "name": "temp_9(fan)", + "controllable": false + }, + { + "name": "temp_10(fan)", + "controllable": false } ], "sfps": [ { - "name": "QSFPDD_1" + "name": "QSFPDD_1", + "tx_disable_channel": false }, { - "name": "QSFPDD_2" + "name": "QSFPDD_2", + "tx_disable_channel": false }, { - "name": "QSFPDD_3" + "name": "QSFPDD_3", + "tx_disable_channel": false }, { - "name": "QSFPDD_4" + "name": "QSFPDD_4", + "tx_disable_channel": false }, { - "name": "QSFPDD_5" + "name": "QSFPDD_5", + "tx_disable_channel": false }, { - "name": "QSFPDD_6" + "name": "QSFPDD_6", + "tx_disable_channel": false }, { - "name": "QSFPDD_7" + "name": "QSFPDD_7", + "tx_disable_channel": false }, { - "name": "QSFPDD_8" + "name": "QSFPDD_8", + "tx_disable_channel": false }, { - "name": "QSFPDD_9" + "name": "QSFPDD_9", + "tx_disable_channel": false }, { - "name": "QSFPDD_10" + "name": "QSFPDD_10", + "tx_disable_channel": false }, { - "name": "QSFPDD_11" + "name": "QSFPDD_11", + "tx_disable_channel": false }, { - "name": "QSFPDD_12" + "name": "QSFPDD_12", + "tx_disable_channel": false }, { - "name": "QSFPDD_13" + "name": "QSFPDD_13", + "tx_disable_channel": false }, { - "name": "QSFPDD_14" + "name": "QSFPDD_14", + "tx_disable_channel": false }, { - "name": "QSFPDD_15" + "name": "QSFPDD_15", + "tx_disable_channel": false }, { - "name": "QSFPDD_16" + "name": "QSFPDD_16", + "tx_disable_channel": false }, { - "name": "QSFPDD_17" + "name": "QSFPDD_17", + "tx_disable_channel": false }, { - "name": "QSFPDD_18" + "name": "QSFPDD_18", + "tx_disable_channel": false }, { - "name": "QSFPDD_19" + "name": "QSFPDD_19", + "tx_disable_channel": false }, { - "name": "QSFPDD_20" + "name": "QSFPDD_20", + "tx_disable_channel": false }, { - "name": "QSFPDD_21" + "name": "QSFPDD_21", + "tx_disable_channel": false }, { - "name": "QSFPDD_22" + "name": "QSFPDD_22", + "tx_disable_channel": false }, { - "name": "QSFPDD_23" + "name": "QSFPDD_23", + "tx_disable_channel": false }, { - "name": "QSFPDD_24" + "name": "QSFPDD_24", + "tx_disable_channel": false }, { - "name": "QSFPDD_25" + "name": "QSFPDD_25", + "tx_disable_channel": false }, { - "name": "QSFPDD_26" + "name": "QSFPDD_26", + "tx_disable_channel": false }, { - "name": "QSFPDD_27" + "name": "QSFPDD_27", + "tx_disable_channel": false }, { - "name": "QSFPDD_28" + "name": "QSFPDD_28", + "tx_disable_channel": false }, { - "name": "QSFPDD_29" + "name": "QSFPDD_29", + "tx_disable_channel": false }, { - "name": "QSFPDD_30" + "name": "QSFPDD_30", + "tx_disable_channel": false }, { - "name": "QSFPDD_31" + "name": "QSFPDD_31", + "tx_disable_channel": false }, { - "name": "QSFPDD_32" + "name": "QSFPDD_32", + "tx_disable_channel": false }, { - "name": "QSFPDD_33" + "name": "QSFPDD_33", + "tx_disable_channel": false }, { - "name": "QSFPDD_34" + "name": "QSFPDD_34", + "tx_disable_channel": false }, { - "name": "QSFPDD_35" + "name": "QSFPDD_35", + "tx_disable_channel": false }, { - "name": "QSFPDD_36" + "name": "QSFPDD_36", + "tx_disable_channel": false } ] }, diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/platform.json b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/platform.json index ec96ac39ae09..4e24bb3e8d92 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/platform.json +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/platform.json @@ -9,6 +9,19 @@ "name": "FPGA1" } ], + "watchdog": { + "disarm": false + }, + "get_module_attributes": { + "model": false, + "serial": false, + "base_mac": false, + "system_eeprom_info": false + }, + "thermal_temperature": { + "minimum": 0, + "maximum": 110 + }, "fans": [], "fan_drawers": [ { @@ -16,7 +29,8 @@ "num_fans": 1, "fans": [ { - "name": "Fan0" + "name": "Fan0", + "speed": { "controllable": false } } ] }, @@ -25,7 +39,8 @@ "num_fans": 1, "fans": [ { - "name": "Fan1" + "name": "Fan1", + "speed": { "controllable": false } } ] }, @@ -34,7 +49,8 @@ "num_fans": 1, "fans": [ { - "name": "Fan2" + "name": "Fan2", + "speed": { "controllable": false } } ] }, @@ -43,7 +59,8 @@ "num_fans": 1, "fans": [ { - "name": "Fan3" + "name": "Fan3", + "speed": { "controllable": false } } ] } @@ -113,136 +130,184 @@ ], "thermals": [ { - "name": "temp_1" + "name": "temp_1(fan)", + "controllable": false }, { - "name": "temp_2" + "name": "temp_2", + "controllable": false }, { - "name": "temp_3(fan)" + "name": "temp_3", + "controllable": false }, { - "name": "temp_4(fan)" + "name": "temp_4(fan)", + "controllable": false }, { - "name": "sfm1_1(fan)" + "name": "temp_5(fan)", + "controllable": false }, { - "name": "sfm1_2" + "name": "sfm1_1(fan)", + "controllable": false }, { - "name": "sfm1_3" + "name": "sfm1_2", + "controllable": false }, { - "name": "sfm1_4" + "name": "sfm1_3", + "controllable": false }, { - "name": "sfm1_5" + "name": "sfm1_4(fan)", + "controllable": false }, { - "name": "sfm2_1(fan)" + "name": "sfm1_5(fan)", + "controllable": false }, { - "name": "sfm2_2" + "name": "sfm2_1(fan)", + "controllable": false }, { - "name": "sfm2_3" + "name": "sfm2_2", + "controllable": false }, { - "name": "sfm2_4" + "name": "sfm2_3", + "controllable": false }, { - "name": "sfm2_5" + "name": "sfm2_4(fan)", + "controllable": false }, { - "name": "sfm3_1(fan)" + "name": "sfm2_5(fan)", + "controllable": false }, { - "name": "sfm3_2" + "name": "sfm3_1(fan)", + "controllable": false }, { - "name": "sfm3_3" + "name": "sfm3_2", + "controllable": false }, { - "name": "sfm3_4" + "name": "sfm3_3", + "controllable": false }, { - "name": "sfm3_5" + "name": "sfm3_4(fan)", + "controllable": false }, { - "name": "sfm4_1(fan)" + "name": "sfm3_5(fan)", + "controllable": false }, { - "name": "sfm4_2" + "name": "sfm4_1(fan)", + "controllable": false }, { - "name": "sfm4_3" + "name": "sfm4_2", + "controllable": false }, { - "name": "sfm4_4" + "name": "sfm4_3", + "controllable": false }, { - "name": "sfm4_5" + "name": "sfm4_4(fan)", + "controllable": false }, { - "name": "sfm5_1(fan)" + "name": "sfm4_5(fan)", + "controllable": false }, { - "name": "sfm5_2" + "name": "sfm5_1(fan)", + "controllable": false }, { - "name": "sfm5_3" + "name": "sfm5_2", + "controllable": false }, { - "name": "sfm5_4" + "name": "sfm5_3", + "controllable": false }, { - "name": "sfm5_5" + "name": "sfm5_4(fan)", + "controllable": false }, { - "name": "sfm6_1(fan)" + "name": "sfm5_5(fan)", + "controllable": false }, { - "name": "sfm6_2" + "name": "sfm6_1(fan)", + "controllable": false }, { - "name": "sfm6_3" + "name": "sfm6_2", + "controllable": false }, { - "name": "sfm6_4" + "name": "sfm6_3", + "controllable": false }, { - "name": "sfm6_5" + "name": "sfm6_4(fan)", + "controllable": false }, { - "name": "sfm7_1(fan)" + "name": "sfm6_5(fan)", + "controllable": false }, { - "name": "sfm7_2" + "name": "sfm7_1(fan)", + "controllable": false }, { - "name": "sfm7_3" + "name": "sfm7_2", + "controllable": false }, { - "name": "sfm7_4" + "name": "sfm7_3", + "controllable": false }, { - "name": "sfm7_5" + "name": "sfm7_4(fan)", + "controllable": false }, { - "name": "sfm8_1(fan)" + "name": "sfm7_5(fan)", + "controllable": false }, { - "name": "sfm8_2" + "name": "sfm8_1(fan)", + "controllable": false }, { - "name": "sfm8_3" + "name": "sfm8_2", + "controllable": false + }, + { + "name": "sfm8_3", + "controllable": false }, { - "name": "sfm8_4" + "name": "sfm8_4(fan)", + "controllable": false }, { - "name": "sfm8_5" + "name": "sfm8_5(fan)", + "controllable": false } ], "sfps": [ From 4caa8876425eb381c360a4348347d25c81ff191a Mon Sep 17 00:00:00 2001 From: Eric Zhu <79439153+cel-eric@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:25:36 +0800 Subject: [PATCH 034/119] Fix issue of partially parsing syseeprom value (#10020) (#10276) Why I did it The current code assumes that the value part does not have whitespace. So everything after the whitespace will be ignored. The syseeprom values returned from platform API do not match the output of "show platform syseeprom" on dx010 and e1031 device. How I did it This change improved the regular expression for parsing syseeprom values to accommodate whitespaces in the value. PR 10021 provides the solution, but committed to the wrong place for dx010 and e1031. How to verify it Compile the sonic_platform wheel for dx010, then upload to device and install the wheel, verify the platform eeprom API. Signed-off-by: Eric Zhu --- device/celestica/x86_64-cel_e1031-r0/sonic_platform/eeprom.py | 2 +- .../celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 dc43a4d7ddda..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 @@ -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/device/celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py index b0d37d57beac..bfde69c8d296 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 @@ -44,7 +44,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') From f0ddd102d546ecb4be3e819dd210244e1e1c1938 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:54:52 +0800 Subject: [PATCH 035/119] [Mellanox] Add CPU thermal control for Nvidia platforms (#10202) Why I did it Add CPU thermal control for Nvidia platforms which will be enabled for platforms that have heavy CPU load. Now it is only enabled on 4800, and it will be enabled on future platforms. How I did it Check CPU pack temperature and update cooling level accordingly How to verify it Manual test Added sonic-mgmt test case, PR link will update later --- .../sonic_platform/cpu_thermal_control.py | 70 ++++++++++++++++ .../sonic_platform/device_data.py | 22 ++++- .../sonic_platform/thermal.py | 4 +- .../sonic_platform/thermal_manager.py | 29 ++++++- .../tests/test_cpu_thermal_control.py | 83 +++++++++++++++++++ 5 files changed, 202 insertions(+), 6 deletions(-) create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/cpu_thermal_control.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_cpu_thermal_control.py diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/cpu_thermal_control.py b/platform/mellanox/mlnx-platform-api/sonic_platform/cpu_thermal_control.py new file mode 100644 index 000000000000..f86a5b09fe07 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/cpu_thermal_control.py @@ -0,0 +1,70 @@ +# +# Copyright (c) 2019-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. +# +############################################################################# +# Mellanox +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +from sonic_py_common.task_base import ThreadTaskBase + +from . import utils +from .device_data import DeviceDataManager + + +class CPUThermalControl(ThreadTaskBase): + CPU_COOLING_STATE = '/var/run/hw-management/thermal/cooling2_cur_state' + CPU_TEMP_FILE = '/var/run/hw-management/thermal/cpu_pack' + MAX_COOLING_STATE = 10 + MIN_COOLING_STATE = 2 + INTERVAL = 3 + + def __init__(self): + super(CPUThermalControl, self).__init__() + self.temp_low, self.temp_high = DeviceDataManager.get_cpu_thermal_threshold() + + def task_worker(self): + last_temp = 0 + while not self.task_stopping_event.wait(self.INTERVAL): + last_temp = self.run(last_temp) + + def run(self, last_temp): + current_temp = self.read_cpu_temp() + if current_temp < self.temp_low: + self.set_cooling_state(self.MIN_COOLING_STATE) + elif current_temp > self.temp_high: + self.set_cooling_state(self.MAX_COOLING_STATE) + else: + cooling_state = self.get_cooling_state() + if current_temp > last_temp: + self.set_cooling_state(min(cooling_state + 1, self.MAX_COOLING_STATE)) + elif current_temp < last_temp: + self.set_cooling_state(max(cooling_state - 1, self.MIN_COOLING_STATE)) + return current_temp + + def set_cooling_state(self, state): + utils.write_file(self.CPU_COOLING_STATE, state, log_func=None) + + def get_cooling_state(self): + return utils.read_int_from_file(self.CPU_COOLING_STATE, default=self.MAX_COOLING_STATE, log_func=None) + + def read_cpu_temp(self): + cpu_temp = utils.read_int_from_file(self.CPU_TEMP_FILE, default=self.temp_high, log_func=None) + return cpu_temp if cpu_temp <= 1000 else int(cpu_temp / 1000) + \ No newline at end of file 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 b4610fe045f0..cd909231d1bc 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -148,7 +148,8 @@ 'thermal': { "capability": { "comex_amb": False - } + }, + 'cpu_threshold': (80, 95) # min=80, max=95 }, 'sfp': { 'max_port_per_line_card': 16 @@ -263,3 +264,20 @@ def get_linecard_max_port_count(cls): if not sfp_data: return 0 return sfp_data.get('max_port_per_line_card', 0) + + @classmethod + def is_cpu_thermal_control_supported(cls): + return cls.get_cpu_thermal_threshold() != (None, None) + + @classmethod + @utils.read_only_cache() + def get_cpu_thermal_threshold(cls): + platform_data = DEVICE_DATA.get(cls.get_platform_name(), None) + if not platform_data: + return None, None + + thermal_data = platform_data.get('thermal', None) + if not thermal_data: + return None, None + + return thermal_data.get('cpu_threshold', (None, None)) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index 22cf5a513529..bc307bc5e076 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -524,7 +524,7 @@ def monitor_asic_themal_zone(cls): else: cls.expect_cooling_state = None - + class RemovableThermal(Thermal): def __init__(self, name, temp_file, high_th_file, high_crit_th_file, position, presence_cb): super(RemovableThermal, self).__init__(name, temp_file, high_th_file, high_crit_th_file, position) 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 895d3aaefedb..dcdd25e90635 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,6 +15,8 @@ # limitations under the License. # from sonic_platform_base.sonic_thermal_control.thermal_manager_base import ThermalManagerBase +from .cpu_thermal_control import CPUThermalControl +from .device_data import DeviceDataManager from .thermal_actions import * from .thermal_conditions import * from .thermal_infos import * @@ -22,6 +24,8 @@ class ThermalManager(ThermalManagerBase): + cpu_thermal_control = None + @classmethod def start_thermal_control_algorithm(cls): """ @@ -42,8 +46,30 @@ def stop_thermal_control_algorithm(cls): """ Thermal.set_thermal_algorithm_status(False) + @classmethod + def start_cpu_thermal_control_algoritm(cls): + if cls.cpu_thermal_control: + return + + if not DeviceDataManager.is_cpu_thermal_control_supported(): + return + + cls.cpu_thermal_control = CPUThermalControl() + cls.cpu_thermal_control.task_run() + + @classmethod + def stop_cpu_thermal_control_algoritm(cls): + if cls.cpu_thermal_control: + cls.cpu_thermal_control.task_stop() + cls.cpu_thermal_control = None + @classmethod def run_policy(cls, chassis): + if cls._running: + cls.start_cpu_thermal_control_algoritm() + else: + cls.stop_cpu_thermal_control_algoritm() + if not cls._policy_dict: return @@ -59,7 +85,6 @@ def run_policy(cls, chassis): if not cls._running: return try: - print(policy.name) if policy.is_match(cls._thermal_info_dict): policy.do_action(cls._thermal_info_dict) except Exception as e: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_cpu_thermal_control.py b/platform/mellanox/mlnx-platform-api/tests/test_cpu_thermal_control.py new file mode 100644 index 000000000000..8970e659c0c8 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_cpu_thermal_control.py @@ -0,0 +1,83 @@ +# +# Copyright (c) 2019-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. +# +############################################################################# +# Mellanox +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +import glob +import os +import pytest +import sys +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform.cpu_thermal_control import CPUThermalControl + + +class TestCPUThermalControl: + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_cpu_thermal_threshold', mock.MagicMock(return_value=(85, 95))) + @mock.patch('sonic_platform.utils.read_int_from_file') + @mock.patch('sonic_platform.utils.write_file') + def test_run(self, mock_write_file, mock_read_file): + instance = CPUThermalControl() + file_content = { + CPUThermalControl.CPU_COOLING_STATE: 5, + CPUThermalControl.CPU_TEMP_FILE: instance.temp_high + 1 + } + + def read_file(file_path, **kwargs): + return file_content[file_path] + + mock_read_file.side_effect = read_file + # Test current temp is higher than high threshold + instance.run(0) + mock_write_file.assert_called_with(CPUThermalControl.CPU_COOLING_STATE, CPUThermalControl.MAX_COOLING_STATE, log_func=None) + + # Test current temp is lower than low threshold + file_content[CPUThermalControl.CPU_TEMP_FILE] = instance.temp_low - 1 + instance.run(0) + mock_write_file.assert_called_with(CPUThermalControl.CPU_COOLING_STATE, CPUThermalControl.MIN_COOLING_STATE, log_func=None) + + # Test current temp increasing + file_content[CPUThermalControl.CPU_TEMP_FILE] = instance.temp_low + instance.run(0) + mock_write_file.assert_called_with(CPUThermalControl.CPU_COOLING_STATE, 6, log_func=None) + + # Test current temp decreasing + instance.run(instance.temp_low + 1) + mock_write_file.assert_called_with(CPUThermalControl.CPU_COOLING_STATE, 4, log_func=None) + + # Test current temp increasing and current cooling state is already the max + file_content[CPUThermalControl.CPU_TEMP_FILE] = 85 + file_content[CPUThermalControl.CPU_COOLING_STATE] = CPUThermalControl.MAX_COOLING_STATE + instance.run(84) + mock_write_file.assert_called_with(CPUThermalControl.CPU_COOLING_STATE, CPUThermalControl.MAX_COOLING_STATE, log_func=None) + + # Test current temp decreasing and current cooling state is already the max + file_content[CPUThermalControl.CPU_COOLING_STATE] = CPUThermalControl.MIN_COOLING_STATE + instance.run(86) + mock_write_file.assert_called_with(CPUThermalControl.CPU_COOLING_STATE, CPUThermalControl.MIN_COOLING_STATE, log_func=None) From bf4ab4a33829ada1ef6b3688c8866e4788fa3cc7 Mon Sep 17 00:00:00 2001 From: Kostiantyn Yarovyi Date: Mon, 21 Mar 2022 19:07:20 +0200 Subject: [PATCH 036/119] [Barefoot][Syncd] restart of the interface for cleaning txquee through which communication takes place between Sonic and openBMC (#9941) Why I did it improvement of starting barefoot SDK How I did it restart of the interface for cleaning txquee through which communication takes place between Sonic and openBMC How to verify it run sonic autorestart tests --- files/scripts/syncd.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 95c3e3841ba8..889495e8c50a 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -28,6 +28,14 @@ function startplatform() { debug "Firmware update procedure ended" fi + if [[ x"$sonic_asic_platform" == x"barefoot" ]]; then + is_usb0=$(ls /sys/class/net | grep usb0) + if [[ "$is_usb0" == "usb0" ]]; then + /usr/bin/ip link set usb0 down + /usr/bin/ip link set usb0 up + fi + fi + if [[ x"$WARM_BOOT" != x"true" ]]; then if [ x$sonic_asic_platform == x'cavium' ]; then /etc/init.d/xpnet.sh start From 42ab5b8eaa14b950a099ab4b57a602ce3972be50 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 22 Mar 2022 01:38:37 +0800 Subject: [PATCH 037/119] [Mellanox] update MFT version to 4.18.0-106 (#10304) - Why I did it With the previous MFT 4.18.1-16 there is a bug in mstdump tool accessing wrong address. it is confirmed this issue does not exist in official 4.18.0-106. - How I did it Update the MFT version to 4.18.0-106 - How to verify it Run regression on Mellanox platforms --- platform/mellanox/mft.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 3a3d95c8ca8d..2616edcd4c41 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -16,8 +16,8 @@ # # Mellanox SAI -MFT_VERSION = 4.18.1 -MFT_REVISION = 16 +MFT_VERSION = 4.18.0 +MFT_REVISION = 106 export MFT_VERSION MFT_REVISION From 24397ead0914950863eb65c7b7800bb980d17626 Mon Sep 17 00:00:00 2001 From: Volodymyr Boiko Date: Mon, 21 Mar 2022 21:43:43 +0200 Subject: [PATCH 038/119] [sonic-config-engine][portconfig] Do not parse JSON as Python AST (#10224) #### Why I did it To fix https://github.com/Azure/sonic-buildimage/issues/9643 #### How I did it Instead of ast.literal_eval added python2 compat code for json strings unicode -> str convertion. We need python2 compatibility since py2 sonic config engine (buster/sonic_config_engine-1.0-py2-none-any.whl target) is still included into the build (ENABLE_PY2_MODULES flag is set for buster). Once we abandon buster and python2, this compat and ast.literal_eval could be cleaned up all through the code base. #### How to verify it run steps from the linked issue --- src/sonic-config-engine/portconfig.py | 21 +++++++++++++------ .../tests/sample_platform.json | 12 +++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index 51a4c438faf2..0c056d1cdab7 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -45,16 +45,25 @@ # # 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 diff --git a/src/sonic-config-engine/tests/sample_platform.json b/src/sonic-config-engine/tests/sample_platform.json index 4a8804a552fe..fbb281e07393 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", From 90416b565c1a792323ab615a9db4b8547e29097d Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Tue, 22 Mar 2022 12:51:07 +0800 Subject: [PATCH 039/119] [ci] Fix remove sonic-slave-* docker image issue when building sonic-slave* (#10296) --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 12 +----------- .azure-pipelines/docker-sonic-slave-template.yml | 11 +---------- .azure-pipelines/template-clean-sonic-slave.yml | 8 ++++++++ 3 files changed, 10 insertions(+), 21 deletions(-) create mode 100644 .azure-pipelines/template-clean-sonic-slave.yml diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 0c7f7f966297..4f1625b297a9 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -45,17 +45,7 @@ stages: jobFilters: ${{ parameters.jobFilters }} buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y' preSteps: - - script: | - containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }') - if [ ! -z "$containers" ]; then - docker container kill $containers || true - sleep 5 - fi - images=$(docker images 'sonic-slave-*' -a -q) - if [ ! -z "$images" ]; then - docker rmi -f $images - fi - displayName: 'Cleanup sonic slave' + - template: template-clean-sonic-slave.yml - stage: UpgradeVersions jobs: - job: UpgradeVersions diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index a8b00fa576b7..212b449abb18 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -38,6 +38,7 @@ jobs: pool: ${{ parameters.pool }} steps: - template: cleanup.yml + - template: template-clean-sonic-slave.yml - checkout: self clean: true submodules: recursive @@ -68,16 +69,6 @@ jobs: BUILD_OPTIONS = 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' fi - containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }') - if [ ! -z "$containers" ]; then - docker container kill $containers || true - sleep 5 - fi - images=$(docker images 'sonic-slave-*' -a -q) - if [ ! -z "$images" ]; then - docker rmi -f $images - fi - tmpfile=$(mktemp) echo ${{ parameters.arch }} > .arch diff --git a/.azure-pipelines/template-clean-sonic-slave.yml b/.azure-pipelines/template-clean-sonic-slave.yml new file mode 100644 index 000000000000..cc995e9c2621 --- /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' From e9ac13678d1b504947d9251d26a5781825703a21 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 22 Mar 2022 15:24:15 +0800 Subject: [PATCH 040/119] [Build]: Fix armhf mirrors not existing issue (#10312) Why I did it [Build]: Fix armhf mirrors not existing issue The mirror endpoint debian-archive.trafficmanager.net does not support armhf, change to use deb.debian.org and security.debian.org. --- files/apt/sources.list.armhf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/files/apt/sources.list.armhf b/files/apt/sources.list.armhf index 378aa084524e..4f9d4d0a9020 100644 --- a/files/apt/sources.list.armhf +++ b/files/apt/sources.list.armhf @@ -1,11 +1,16 @@ ## 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://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free -deb-src [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free -deb [arch=armhf] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free -deb-src [arch=armhf] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free -deb [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye-backports main contrib non-free +deb [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free +deb-src [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free +deb [arch=armhf] http://security.debian.org bullseye-security main contrib non-free +deb-src [arch=armhf] http://security.debian.org bullseye-security main contrib non-free +deb [arch=armhf] http://deb.debian.org/debian bullseye-backports main contrib non-free +#deb [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +#deb-src [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free +#deb [arch=armhf] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +#deb-src [arch=armhf] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free +#deb [arch=armhf] http://debian-archive.trafficmanager.net/debian/ bullseye-backports main contrib non-free deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free deb [arch=armhf] http://packages.trafficmanager.net/debian/debian-security/ bullseye-security main contrib non-free From f8e11042b7b64f654a344ca65f8f8036ce8095c6 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Tue, 22 Mar 2022 15:39:01 +0800 Subject: [PATCH 041/119] [build] Fix docker image cached tag issue. (#10297) before: [ finished ] target/docker-base-buster.gz after: [ cached ] target/docker-base-buster.gz --- slave.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slave.mk b/slave.mk index 0bd81ff371a7..641b732db64e 100644 --- a/slave.mk +++ b/slave.mk @@ -816,7 +816,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform # Load the target deb from DPKG cache $(call LOAD_CACHE,$*.gz,$@) - + $(eval $*_CACHE_LOADED:=$($*.gz_CACHE_LOADED)) # Skip building the target if it is already loaded from cache if [ -z '$($*.gz_CACHE_LOADED)' ] ; then @@ -890,7 +890,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%-$(DBG_IMAG # Load the target deb from DPKG cache $(call LOAD_CACHE,$*-$(DBG_IMAGE_MARK).gz,$@) - + $(eval $*_CACHE_LOADED:=$($*-$(DBG_IMAGE_MARK).gz_CACHE_LOADED)) # Skip building the target if it is already loaded from cache if [ -z '$($*-$(DBG_IMAGE_MARK).gz_CACHE_LOADED)' ] ; then From 874d7fc2c6eb99865c661635221ffef7c87c3701 Mon Sep 17 00:00:00 2001 From: Mohamed Ghoneim Date: Tue, 22 Mar 2022 17:12:16 -0700 Subject: [PATCH 042/119] [yang] In ACL_RULE PRIORITY is mandatory and PACKET_ACTION for CTRLPLANE ACLs (#10248) #### Why I did it Fixes https://github.com/Azure/sonic-utilities/issues/2049 from caclmgr: - PRIORITY is a required field [code](https://github.com/Azure/sonic-buildimage/blob/3fa18d18d4c06fe38164ebfefdc3187820fc7496/src/sonic-host-services/scripts/caclmgrd#L548) - PACKET_ACTION is a required field [code](https://github.com/Azure/sonic-buildimage/blob/3fa18d18d4c06fe38164ebfefdc3187820fc7496/src/sonic-host-services/scripts/caclmgrd#L581) I think PRIORITY is a required field for ACLs not only CTRLPLANE ACLs #### How I did it Check code. #### How to verify it Unit-test #### Which release branch to backport (provide reason below if selected) - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 #### Description for the changelog #### Link to config_db schema for YANG module changes #### A picture of a cute animal (not mandatory but encouraged) --- .../tests/yang_model_tests/tests/acl.json | 10 ++++ .../yang_model_tests/tests_config/acl.json | 57 +++++++++++++++++++ .../yang-templates/sonic-acl.yang.j2 | 4 ++ 3 files changed, 71 insertions(+) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json index 243554d60f9a..b7968e240767 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json @@ -4,6 +4,16 @@ "eStrKey" : "InvalidValue", "eStr": ["PACKET_ACTION"] }, + "ACL_RULE_FOR_CTRLPLANE_ACL_REQUIRES_PACKET_ACTION": { + "desc": "ACL_RULE for CTRLPLANE ACLs require PACKET_ACTION.", + "eStrKey" : "Must", + "eStr": ["CTRLPLANE", "PACKET_ACTION"] + }, + "ACL_RULE_MANDATORY_PRIORITY": { + "desc": "ACL_RULE MANDATORY PRIORITY field.", + "eStrKey" : "Mandatory", + "eStr": ["ACL_RULE", "PRIORITY"] + }, "ACL_TABLE_EMPTY_PORTS": { "desc": "Configure ACL_TABLE with empty ports." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json index 4829eb3971dc..d98645b8a19c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json @@ -211,6 +211,63 @@ } } }, + "ACL_RULE_FOR_CTRLPLANE_ACL_REQUIRES_PACKET_ACTION": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "MGMT_ONLY", + "DST_IP": "10.186.72.0/26", + "IP_TYPE": "IPv4ANY", + "PRIORITY": 999980, + "RULE_NAME": "Rule_20", + "SRC_IP": "10.176.0.0/15" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "MGMT_ONLY", + "policy_desc": "Filter IPv4", + "services": [ + "SNMP" + ], + "stage": "EGRESS", + "type": "CTRLPLANE" + } + ] + } + } + }, + "ACL_RULE_MANDATORY_PRIORITY": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "EVERFLOW", + "DST_IP": "10.186.72.0/26", + "IP_TYPE": "IPv4ANY", + "RULE_NAME": "Rule_20", + "SRC_IP": "10.176.0.0/15" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "EVERFLOW", + "policy_desc": "Filter IPv4", + "services": [ + "SNMP" + ], + "stage": "EGRESS", + "type": "MIRROR" + } + ] + } + } + }, "ACL_RULE_WITH_NON_EXIST_ACL_TABLE": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_RULE": { diff --git a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 index 9fd442297c9f..2a527aa2bcf9 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -69,6 +69,9 @@ module sonic-acl { type stypes:packet_action; } + /* Validating 'PACKET_ACTION' exist if ACL type is 'CTRLPLANE' */ + must "(not(../../ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME=current()/ACL_TABLE_NAME]/type = 'CTRLPLANE')) or (boolean(PACKET_ACTION))"; + leaf MIRROR_INGRESS_ACTION { type leafref { path "/sms:sonic-mirror-session/sms:MIRROR_SESSION/sms:MIRROR_SESSION_LIST/sms:name"; @@ -86,6 +89,7 @@ module sonic-acl { } leaf PRIORITY { + mandatory true; type uint32 { range 0..999999; } From 74c32d0d313fcf1e254da1d592ddc6ad335c5e69 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:58:15 -0700 Subject: [PATCH 043/119] [sonic-py-swsssdk]: Advance submodule (#10308) Update sonic-py-swsssdk submodule to include below commits: 96c0590 [port_util] Fix issue: port_util.get_vlan_interface_oid_map should not raise exception when DB has not RIF data (#117) 96da8b9 [build] pin pytest-azurepipelines version (#119) Signed-off-by: Suvarna Meenakshi --- src/sonic-py-swsssdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 24366480c213..96c05900fc6e 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 24366480c213893388766a3b0dd3c492b9c04b8f +Subproject commit 96c05900fc6e4063c51e3f6256f8a8e765605be4 From 99b7891e4d3f03af641f9890727fb57e89dba1b2 Mon Sep 17 00:00:00 2001 From: dflynn-Nokia <60479697+dflynn-Nokia@users.noreply.github.com> Date: Tue, 22 Mar 2022 20:58:46 -0400 Subject: [PATCH 044/119] [Nokia ixs7215] Fixes to support Debian bullseye (#10309) The following changes are provided to support bullseye and the latest master branch content. - Accommodate relocated fan and thermal sysfs entries in bullseye - Add support for chassis and PSU HW revision Why I did it Fix platform issues introduced by the bullseye kernel upgrade. How I did it Minor fixes to Nokia ixs7215 platform code How to verify it Execute the following CLI commands show platform summary show platform fan show platform temperature --- .../plugins/led_control.py | 20 ++++++++++--------- .../7215/sonic_platform/chassis.py | 16 +++++++++++++++ .../7215/sonic_platform/fan.py | 2 +- .../7215/sonic_platform/psu.py | 9 ++++++++- .../7215/sonic_platform/test/test-chassis.py | 2 ++ .../7215/sonic_platform/thermal.py | 9 +++++---- 6 files changed, 43 insertions(+), 15 deletions(-) diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py b/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py index 935343a84ce1..55d5c74808d0 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py @@ -60,8 +60,8 @@ def _set_i2c_register(self, reg_file, value): def _initSystemLed(self): # Front Panel System LEDs setting - oldfan = 0xf - oldpsu = 0xf + oldfan = 0xf # 0=amber, 1=green + oldpsu = 0xf # 0=amber, 1=green # Write sys led if smbus_present == 0: @@ -73,18 +73,19 @@ def _initSystemLed(self): bus.write_byte_data(DEVICE_ADDRESS, DEVICEREG, 0x02) DBG_PRINT(" System LED set O.K. ") + # Timer loop to monitor and set front panel Status, Fan, and PSU LEDs while True: - # Front Panel FAN Panel LED setting in register 0x08 + # Front Panel FAN Panel LED setting if (self.chassis.get_fan(0).get_status() == self.chassis.get_fan(1).get_status() == True): - if (os.path.isfile("/sys/class/gpio/fanLedAmber/value")): + if (os.path.isfile("/sys/class/gpio/fanLedGreen/value")): if oldfan != 0x1: self._set_i2c_register("/sys/class/gpio/fanLedAmber/value", 0) self._set_i2c_register("/sys/class/gpio/fanLedGreen/value", 1) oldfan = 0x1 else: - oldfan = 0xf + oldfan = 0xf else: - if (os.path.isfile("/sys/class/gpio/fanLedGreen/value")): + if (os.path.isfile("/sys/class/gpio/fanLedAmber/value")): if oldfan != 0x0: self._set_i2c_register("/sys/class/gpio/fanLedGreen/value", 0) self._set_i2c_register("/sys/class/gpio/fanLedAmber/value", 1) @@ -92,9 +93,9 @@ def _initSystemLed(self): else: oldfan = 0xf - # Front Panel PSU Panel LED setting in register 0x09 + # Front Panel PSU Panel LED setting if (self.chassis.get_psu(0).get_status() == self.chassis.get_psu(1).get_status() == True): - if (os.path.isfile("/sys/class/gpio/psuLedAmber/value")): + if (os.path.isfile("/sys/class/gpio/psuLedGreen/value")): if oldpsu != 0x1: self._set_i2c_register("/sys/class/gpio/psuLedAmber/value", 0) self._set_i2c_register("/sys/class/gpio/psuLedGreen/value", 1) @@ -102,13 +103,14 @@ def _initSystemLed(self): else: oldpsu = 0xf else: - if (os.path.isfile("/sys/class/gpio/psuLedGreen/value")): + if (os.path.isfile("/sys/class/gpio/psuLedAmber/value")): if oldpsu != 0x0: self._set_i2c_register("/sys/class/gpio/psuLedGreen/value", 0) self._set_i2c_register("/sys/class/gpio/psuLedAmber/value", 1) oldpsu = 0x0 else: oldpsu = 0xf + time.sleep(6) # Helper method to map SONiC port name to index 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 cf67a7bb30ac..eb507a49ef17 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 @@ -201,6 +201,22 @@ def get_serial(self): """ return self._eeprom.serial_number_str() + def get_revision(self): + """ + Retrieves the hardware revision of the chassis + + Returns: + string: Revision value of chassis + """ + if smbus_present == 0: # called from host + cmdstatus, value = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x0') + else: + bus = smbus.SMBus(0) + DEVICE_ADDRESS = 0x41 + DEVICE_REG = 0x0 + value = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) + return str(value) + def get_system_eeprom_info(self): """ Retrieves the full content of system EEPROM information for the 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 b8fd335930d6..71334ca48585 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 @@ -33,7 +33,7 @@ class Fan(FanBase): def __init__(self, fan_index, fan_drawer, psu_fan=False, dependency=None): self.is_psu_fan = psu_fan - ADT7473_DIR = "/sys/bus/i2c/devices/0-002e/" + ADT7473_DIR = "/sys/bus/i2c/devices/0-002e/hwmon/hwmon1/" if not self.is_psu_fan: # Fan is 1-based in Nokia platforms 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 6217555f0d58..383eb2481f68 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 @@ -114,7 +114,6 @@ def get_model(self): """ return self.eeprom.modelstr() - def get_serial(self): """ Retrieves the serial number of the PSU @@ -124,6 +123,14 @@ def get_serial(self): """ return self.eeprom.serial_number_str() + def get_revision(self): + """ + Retrieves the HW revision of the PSU + + Returns: + string: HW revision of PSU + """ + return self.eeprom.part_number_str() def get_part_number(self): """ 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 53c047ca2329..93dfcaac3d05 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 @@ -21,6 +21,8 @@ def main(): print(" Chassis serial: {}".format(chassis.get_serial())) + print(" Chassis revision: {}".format(chassis.get_revision())) + print(" Chassis status: {}".format(chassis.get_status())) print(" Chassis base_mac: {}".format(chassis.get_base_mac())) 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 20fdec61f38e..c7e408c3f3e9 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 @@ -22,9 +22,9 @@ class Thermal(ThermalBase): I2C_CLASS_DIR = "/sys/class/i2c-adapter/" I2C_DEV_MAPPING = (['i2c-0/0-004a/hwmon/', 1], ['i2c-0/0-004b/hwmon/', 1], - ['i2c-0/0-002e/', 1], - ['i2c-0/0-002e/', 2], - ['i2c-0/0-002e/', 3]) + ['i2c-0/0-002e/hwmon/', 1], + ['i2c-0/0-002e/hwmon/', 2], + ['i2c-0/0-002e/hwmon/', 3]) HWMON_CLASS_DIR = "/sys/class/hwmon/" @@ -55,7 +55,8 @@ def __init__(self, thermal_index): sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1] sensor_max_suffix = "max" sensor_crit_suffix = "crit" - self.SENSOR_DIR = i2c_path + hwmon_node = os.listdir(i2c_path)[0] + self.SENSOR_DIR = i2c_path + hwmon_node + '/' # Armada 38x SOC temperature sensor else: From 4a5e75e45e570609d47cfc2385a8b43c6b1caa99 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 22 Mar 2022 18:34:42 -0700 Subject: [PATCH 045/119] [restapi]: Don't use python/python2 for restapi start scripts (#10285) Python 2 isn't installed by default in Buster and Bullseye containers, and the scripts/modules can be used with Python 3, so make sure Python 3 is used. Why I did it After the Buster and Bullseye upgrade for the restapi container, processes will no longer start because supervisord is trying to call python and python2, both of which are unavailable. Signed-off-by: Saikrishna Arcot --- dockers/docker-sonic-restapi/supervisord.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockers/docker-sonic-restapi/supervisord.conf b/dockers/docker-sonic-restapi/supervisord.conf index a873ba03d7da..c95b4b6b92d8 100644 --- a/dockers/docker-sonic-restapi/supervisord.conf +++ b/dockers/docker-sonic-restapi/supervisord.conf @@ -4,7 +4,7 @@ logfile_backups=2 nodaemon=true [eventlistener:dependent-startup] -command=python -m supervisord_dependent_startup +command=python3 -m supervisord_dependent_startup autostart=true autorestart=unexpected startretries=0 @@ -13,7 +13,7 @@ events=PROCESS_STATE buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] -command=python2 /usr/bin/supervisor-proc-exit-listener --container-name restapi +command=/usr/bin/supervisor-proc-exit-listener --container-name restapi events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=false From 9451a9d43e70fa4642e3184ea41052e932ba9608 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 22 Mar 2022 21:57:15 -0700 Subject: [PATCH 046/119] Check to see that the py2 and py3 version files exist before trying to sort them (#10325) For Bullseye, Python 2 isn't present at all. This means that in certain build cases (such as building something only for Bullseye), the version file may not exist, and so the sort command would fail. For most normal build commands, this probably won't be an issue, because the SONiC build will start with Buster (which has both Python 2 and Python 3 wheels built), and so the py2 and py3 files will be present even during the Bullseye builds. Signed-off-by: Saikrishna Arcot --- src/sonic-build-hooks/scripts/collect_version_files | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sonic-build-hooks/scripts/collect_version_files b/src/sonic-build-hooks/scripts/collect_version_files index 570883701e98..a4b33eeaa897 100755 --- a/src/sonic-build-hooks/scripts/collect_version_files +++ b/src/sonic-build-hooks/scripts/collect_version_files @@ -20,7 +20,11 @@ dpkg-query -W -f '${Package}==${Version}\n' >> "${TARGET_PATH}/versions-deb-${DI ## Print the unique and sorted result sort -u "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" -sort -u "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -sort -u "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py3-${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 exit 0 From 9565ef7a9a85dcb5d08a12adbb3a3d607876fe31 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Wed, 23 Mar 2022 09:16:03 +0200 Subject: [PATCH 047/119] [Mellanox] Refactor SFP to use new APIs. (#10317) - Why I did it Refactor SFP code to remove code duplication and to be able to use the latest features available in new APIs. - How I did it Refactor SFP code to remove code duplication and to be able to use the latest features available in new APIs. - How to verify it Run sonic-mgmt/platform_tests/sfp tests --- .../sonic_platform/chassis.py | 20 +- .../mlnx-platform-api/sonic_platform/sfp.py | 1836 +---------------- .../mlnx-platform-api/tests/test_chassis.py | 4 +- .../mlnx-platform-api/tests/test_sfp.py | 2 +- 4 files changed, 38 insertions(+), 1824 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 6a712af68ff2..1cc3d0f75660 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -74,7 +74,7 @@ def __init__(self): # Initialize DMI data self.dmi_data = None - + # move the initialization of each components to their dedicated initializer # which will be called from platform # @@ -115,7 +115,7 @@ def __del__(self): if SFP.shared_sdk_handle: deinitialize_sdk_handle(SFP.shared_sdk_handle) - + ############################################## # PSU methods ############################################## @@ -238,7 +238,7 @@ def initialize_single_sfp(self, index): if index < sfp_count: if not self._sfp_list: self._sfp_list = [None] * sfp_count - + if not self._sfp_list[index]: from .sfp import SFP self._sfp_list[index] = SFP(index) @@ -295,7 +295,7 @@ def get_sfp(self, index): index = index - 1 self.initialize_single_sfp(index) return super(Chassis, self).get_sfp(index) - + def get_change_event(self, timeout=0): """ Returns a nested dictionary containing all devices which have @@ -310,7 +310,7 @@ def get_change_event(self, timeout=0): - 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'}, + {'device_id':'device_event'}, where device_id is the device ID for this device and device_event, status='1' represents device inserted, @@ -596,7 +596,7 @@ def get_watchdog(self): Note: We overload this method to ensure that watchdog is only initialized when it is referenced. Currently, only one daemon can open the watchdog. - To initialize watchdog in the constructor causes multiple daemon + To initialize watchdog in the constructor causes multiple daemon try opening watchdog when loading and constructing a chassis object and fail. By doing so we can eliminate that risk. """ @@ -609,11 +609,11 @@ def get_watchdog(self): return self._watchdog - + def get_revision(self): """ Retrieves the hardware revision of the device - + Returns: string: Revision value of device """ @@ -647,7 +647,7 @@ def _parse_dmi(self, filename): def _verify_reboot_cause(self, filename): ''' - Open and read the reboot cause file in + Open and read the reboot cause file in /var/run/hwmanagement/system (which is defined as REBOOT_CAUSE_ROOT) If a reboot cause file doesn't exists, returns '0'. ''' @@ -754,7 +754,7 @@ def initialize_single_module(self, index): if index < count: if not self._module_list: self._module_list = [None] * count - + if not self._module_list[index]: from .module import Module self._module_list[index] = Module(index + 1) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 59f71bebc9a5..29d1c7c081f6 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -25,24 +25,17 @@ try: import subprocess import os - 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.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 . import utils from .device_data import DeviceDataManager + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase except ImportError as e: raise ImportError (str(e) + "- required module not found") try: - # python_sdk_api does not support python3 for now. Daemons like thermalctld or psud + # python_sdk_api does not support python3 for now. Daemons like thermalctld or psud # also import this file without actually use the sdk lib. So we catch the ImportError # and ignore it here. Meanwhile, we have to trigger xcvrd using python2 now because it # uses the sdk lib. @@ -63,171 +56,6 @@ except KeyError: pass -# 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 - -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 @@ -252,31 +80,6 @@ '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_PATH = "/var/run/hw-management/qsfp/" -SFP_TYPE = "SFP" -QSFP_TYPE = "QSFP" -OSFP_TYPE = "OSFP" -QSFP_DD_TYPE = "QSFP_DD" - #variables for sdk REGISTER_NUM = 1 DEVICE_ID = 1 @@ -331,6 +134,7 @@ def initialize_sdk_handle(): return sdk_handle + def deinitialize_sdk_handle(sdk_handle): if sdk_handle is not None: rc = sx_api_close(sdk_handle) @@ -355,23 +159,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): deinitialize_sdk_handle(self.sdk_handle) -class SfpCapability: - def __init__(self): - 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.dom_tx_disable_supported = False - self.dom_thresholds_supported = False - self.dom_rx_tx_power_bias_supported = False - self.calibration = 0 - self.qsfp_page3_available = False - self.second_application_list = False - - -class SFP(SfpBase): +class SFP(SfpOptoeBase): """Platform-specific SFP class""" shared_sdk_handle = None SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE = 'Long range for non-Mellanox cable or module' @@ -388,7 +176,7 @@ class SFP(SfpBase): def __init__(self, sfp_index, slot_id=0, linecard_port_count=0, lc_name=None): super(SFP, self).__init__() - + if slot_id == 0: # For non-modular chassis self.index = sfp_index + 1 self.sdk_index = sfp_index @@ -406,9 +194,7 @@ def __init__(self, sfp_index, slot_id=0, linecard_port_count=0, lc_name=None): self._thermal_list = initialize_linecard_sfp_thermal(lc_name, slot_id, sfp_index) self.slot_id = slot_id - self._sfp_type = None - self._sfp_capability = None - + @property def sdk_handle(self): if not SFP.shared_sdk_handle: @@ -417,218 +203,12 @@ def sdk_handle(self): logger.log_error('Failed to open SDK handle') return SFP.shared_sdk_handle - @property - def sfp_type(self): - if not 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 - - # we don't regonize this identifier value, treat the xSFP module as the default type - if not self._sfp_type: - raise RuntimeError("Failed to detect SFP type for SFP {}".format(self.index)) - else: - return self._sfp_type - - def _dom_capability_detect(self): - if self._sfp_capability: - return - - self._sfp_capability = SfpCapability() - if not self.get_presence(): - return - - if self.sfp_type == QSFP_TYPE: - self._sfp_capability.calibration = 1 - sfpi_obj = sff8436InterfaceId() - if sfpi_obj is None: - self._sfp_capability.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._sfp_capability.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' - self._sfp_capability.dom_volt_supported = dom_capability['data']['Voltage_support']['value'] == 'On' - self._sfp_capability.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' - self._sfp_capability.dom_tx_power_supported = dom_capability['data']['Tx_power_support']['value'] == 'On' - else: - self._sfp_capability.dom_temp_supported = True - self._sfp_capability.dom_volt_supported = True - self._sfp_capability.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' - self._sfp_capability.dom_tx_power_supported = True - self._sfp_capability.dom_supported = True - self._sfp_capability.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._sfp_capability.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._sfp_capability.qsfp_page3_available = dom_status_indicator['data']['FlatMem']['value'] == 'Off' - else: - self._sfp_capability.dom_supported = False - self._sfp_capability.dom_temp_supported = False - self._sfp_capability.dom_volt_supported = False - self._sfp_capability.dom_rx_power_supported = False - self._sfp_capability.dom_tx_power_supported = False - self._sfp_capability.calibration = 0 - self._sfp_capability.qsfp_page3_available = False - - elif self.sfp_type == QSFP_DD_TYPE: - sfpi_obj = qsfp_dd_InterfaceId() - if sfpi_obj is None: - self._sfp_capability.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._sfp_capability.dom_temp_supported = True - self._sfp_capability.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._sfp_capability.dom_supported = True - self._sfp_capability.second_application_list = True - self._sfp_capability.dom_rx_power_supported = True - self._sfp_capability.dom_tx_power_supported = True - self._sfp_capability.dom_tx_bias_power_supported = True - self._sfp_capability.dom_thresholds_supported = True - self._sfp_capability.dom_rx_tx_power_bias_supported = True - else: - self._sfp_capability.dom_supported = False - self._sfp_capability.second_application_list = False - self._sfp_capability.dom_rx_power_supported = False - self._sfp_capability.dom_tx_power_supported = False - self._sfp_capability.dom_tx_bias_power_supported = False - self._sfp_capability.dom_thresholds_supported = False - self._sfp_capability.dom_rx_tx_power_bias_supported = False - else: - self._sfp_capability.dom_supported = False - self._sfp_capability.dom_temp_supported = False - self._sfp_capability.dom_volt_supported = False - self._sfp_capability.dom_rx_power_supported = False - self._sfp_capability.dom_tx_power_supported = False - self._sfp_capability.dom_tx_bias_power_supported = False - self._sfp_capability.dom_thresholds_supported = False - self._sfp_capability.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._sfp_capability.dom_supported = (sfp_dom_capability & 0x40 != 0) - if self._sfp_capability.dom_supported: - self._sfp_capability.dom_temp_supported = True - self._sfp_capability.dom_volt_supported = True - self._sfp_capability.dom_rx_power_supported = True - self._sfp_capability.dom_tx_power_supported = True - if sfp_dom_capability & 0x20 != 0: - self._sfp_capability.calibration = 1 - elif sfp_dom_capability & 0x10 != 0: - self._sfp_capability.calibration = 2 - else: - self._sfp_capability.calibration = 0 - else: - self._sfp_capability.dom_temp_supported = False - self._sfp_capability.dom_volt_supported = False - self._sfp_capability.dom_rx_power_supported = False - self._sfp_capability.dom_tx_power_supported = False - self._sfp_capability.calibration = 0 - self._sfp_capability.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) - else: - self._sfp_capability.dom_supported = False - self._sfp_capability.dom_temp_supported = False - self._sfp_capability.dom_volt_supported = False - self._sfp_capability.dom_rx_power_supported = False - self._sfp_capability.dom_tx_power_supported = False - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_supported(self): - return self._sfp_capability.dom_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_temp_supported(self): - return self._sfp_capability.dom_temp_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_volt_supported(self): - return self._sfp_capability.dom_volt_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_rx_power_supported(self): - return self._sfp_capability.dom_rx_power_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_tx_power_supported(self): - return self._sfp_capability.dom_tx_power_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def calibration(self): - return self._sfp_capability.calibration - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_tx_bias_power_supported(self): - return self._sfp_capability.dom_tx_bias_power_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_tx_disable_supported(self): - return self._sfp_capability.dom_tx_disable_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def qsfp_page3_available(self): - return self._sfp_capability.qsfp_page3_available - - @property - @utils.pre_initialize(_dom_capability_detect) - def second_application_list(self): - return self._sfp_capability.second_application_list - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_thresholds_supported(self): - return self._sfp_capability.dom_thresholds_supported - - @property - @utils.pre_initialize(_dom_capability_detect) - def dom_rx_tx_power_bias_supported(self): - return self._sfp_capability.dom_rx_tx_power_bias_supported - def reinit(self): - """ Re-initialize this SFP object when a new SFP inserted - :return: + :return: """ - self._sfp_type = None - self._sfp_capability = None + self.refresh_xcvr_api() def get_presence(self): """ @@ -637,32 +217,17 @@ def get_presence(self): Returns: 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 != '': - presence = True - - except OSError as e: - raise OSError("Cannot detect sfp") - - return presence + eeprom_raw = self.read_eeprom(0, 1) + + return eeprom_raw is not None # Read out any bytes from any offset - def _read_eeprom_specific_bytes(self, offset, num_bytes): + def read_eeprom(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, + output = subprocess.check_output(ethtool_cmd, + shell=True, universal_newlines=True) output_lines = output.splitlines() first_line_raw = output_lines[0] @@ -673,933 +238,8 @@ def _read_eeprom_specific_bytes(self, offset, num_bytes): except subprocess.CalledProcessError as e: return None - 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 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 - vendor_rev |1*255VCHAR |vendor revision 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 = {} - - # 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['vendor_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['vendor_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: - 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['vendor_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 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 - - for QSFP, originally I would like to make use of Initialization complete flag bit - which is at Page a0 offset 6 bit 0 to test whether reset is complete. - However as unit testing was carried out I find this approach may fail because: - 1. we make use of ethtool to read data on I2C bus rather than to read directly - 2. ethtool is unable to access I2C during QSFP module being reset - In other words, whenever the flag is able to be retrived, the value is always be 1 - As a result, it doesn't make sense to retrieve that flag. Just treat successfully - retrieving data as "data ready". - for SFP it seems that there is not flag indicating whether reset succeed. However, - we can also do it in the way for QSFP. - """ - if not self.dom_supported: - return False - - if self.sfp_type == OSFP_TYPE: - return False - elif self.sfp_type == QSFP_TYPE: - offset = 0 - sfpd_obj = sff8436Dom() - dom_module_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_MODULE_MONITOR_OFFSET), QSFP_MODULE_MONITOR_WIDTH) - - if dom_module_monitor_raw is not None: - return True - else: - return False - elif self.sfp_type == SFP_TYPE: - offset = 0 - sfpd_obj = sff8472Dom() - 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: - return True - else: - return False - elif self.sfp_type == QSFP_DD_TYPE: - offset = 0 - 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) - - if dom_channel_status_raw is None: - return False - - dom_channel_status_data = sfpd_obj.parse_dom_channel_status(dom_channel_status_raw, 0) - return dom_channel_status_data['data']['Status']['value'] == 'On' - - 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. - """ - 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 - + eeprom_raw = list(map(lambda h: int(h, base=16), eeprom_raw)) + return bytearray(eeprom_raw) @classmethod def mgmt_phy_mod_pwr_attr_get(cls, power_attr_type, sdk_handle, sdk_index, slot_id): @@ -1619,8 +259,6 @@ def mgmt_phy_mod_pwr_attr_get(cls, power_attr_type, sdk_handle, sdk_index, slot_ finally: delete_sx_mgmt_phy_mod_pwr_attr_t_p(sx_mgmt_phy_mod_pwr_attr_p) - - def get_lpmode(self): """ Retrieves the lpmode (low power mode) status of this SFP @@ -1629,7 +267,7 @@ def get_lpmode(self): A Boolean, True if lpmode is enabled, False if disabled """ if utils.is_host(): - # To avoid performance issue, + # To avoid performance issue, # call class level method to avoid initialize the whole sonic platform API get_lpmode_code = 'from sonic_platform import sfp;\n' \ 'with sfp.SdkHandleContext() as sdk_handle:' \ @@ -1644,10 +282,9 @@ def get_lpmode(self): else: return self._get_lpmode(self.sdk_handle, self.sdk_index, self.slot_id) - @classmethod def _get_lpmode(cls, sdk_handle, sdk_index, slot_id): - """Class level method to get low power mode. + """Class level method to get low power mode. Args: sdk_handle: SDK handle @@ -1660,369 +297,6 @@ def _get_lpmode(cls, sdk_handle, sdk_index, slot_id): _, oper_pwr_mode = cls.mgmt_phy_mod_pwr_attr_get(SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, sdk_handle, sdk_index, slot_id) return oper_pwr_mode == SX_MGMT_PHY_MOD_PWR_MODE_LOW_E - - 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 NotImplementedError - - - 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 - offset_xcvr = 128 - - 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 - offset_xcvr = 128 - - 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 - offset_xcvr = 128 - - 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 - offset_xcvr = 128 - - 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 - offset_xcvr = 128 - - 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. @@ -2033,7 +307,7 @@ def reset(self): refer plugins/sfpreset.py """ if utils.is_host(): - # To avoid performance issue, + # To avoid performance issue, # call class level method to avoid initialize the whole sonic platform API reset_code = 'from sonic_platform import sfp;\n' \ 'with sfp.SdkHandleContext() as sdk_handle:' \ @@ -2050,7 +324,6 @@ def reset(self): else: return self._reset(self.sdk_handle, self.sdk_index, self.slot_id) - @classmethod def _reset(cls, sdk_handle, sdk_index, slot_id): module_id_info = sx_mgmt_module_id_info_t() @@ -2063,41 +336,6 @@ def _reset(cls, sdk_handle, sdk_index, slot_id): return rc == SX_STATUS_SUCCESS - 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 - - for SFP, make use of bit 6 of byte at (offset 110, a2h (i2c addr 0x51)) to disable/enable tx - for QSFP, set all channels to disable/enable tx - """ - return NotImplementedError - - - 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 - - QSFP: page a0, address 86, lower 4 bits - """ - return NotImplementedError - - @classmethod def is_nve(cls, port): return (port & NVE_MASK) != 0 @@ -2117,7 +355,7 @@ def is_port_admin_status_up(cls, sdk_handle, log_port): assert rc == SXD_STATUS_SUCCESS, "sx_api_port_state_get failed, rc = %d" % rc admin_state = sx_port_admin_state_t_p_value(admin_state_p) - + delete_sx_port_oper_state_t_p(oper_state_p) delete_sx_port_admin_state_t_p(admin_state_p) delete_sx_port_module_state_t_p(module_state_p) @@ -2220,7 +458,7 @@ def set_lpmode(self, lpmode): A boolean, True if lpmode is set successfully, False if not """ if utils.is_host(): - # To avoid performance issue, + # To avoid performance issue, # call class level method to avoid initialize the whole sonic platform API set_lpmode_code = 'from sonic_platform import sfp;\n' \ 'with sfp.SdkHandleContext() as sdk_handle:' \ @@ -2238,42 +476,20 @@ def set_lpmode(self, lpmode): else: return self._set_lpmode(lpmode, self.sdk_handle, self.sdk_index, self.slot_id) - + @classmethod def _set_lpmode(cls, lpmode, sdk_handle, sdk_index, slot_id): log_port_list = cls.get_logical_ports(sdk_handle, sdk_index, slot_id) sdk_lpmode = SX_MGMT_PHY_MOD_PWR_MODE_LOW_E if lpmode else SX_MGMT_PHY_MOD_PWR_MODE_AUTO_E - cls._set_lpmode_raw(sdk_handle, - sdk_index, + cls._set_lpmode_raw(sdk_handle, + sdk_index, slot_id, - log_port_list, - SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, + log_port_list, + SX_MGMT_PHY_MOD_PWR_ATTR_PWR_MODE_E, sdk_lpmode) logger.log_info("{} low power mode for module {}, slot {}".format("Enabled" if lpmode else "Disabled", sdk_index, slot_id)) 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 - """ - return NotImplementedError - def is_replaceable(self): """ Indicate whether this device is replaceable. diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index cfa2d8224718..a7eff5b08625 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -38,7 +38,7 @@ class TestChassis: 2. Fan drawer related API 3. SFP related API (Except modular chassis SFP related API) 4. Reboot cause related API - + Thermal, Eeprom, Watchdog, Component, System LED related API will be tested in seperate class """ @classmethod @@ -166,7 +166,6 @@ def test_sfp(self): @mock.patch('sonic_platform.sfp_event.sfp_event.check_sfp_status', MagicMock()) @mock.patch('sonic_platform.sfp_event.sfp_event.__init__', MagicMock(return_value=None)) @mock.patch('sonic_platform.sfp_event.sfp_event.initialize', MagicMock()) - @mock.patch('sonic_platform.sfp.SFP.reinit', MagicMock()) @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=3)) def test_change_event(self): from sonic_platform.sfp_event import sfp_event @@ -185,7 +184,6 @@ def mock_check_sfp_status(self, port_dict, error_dict, timeout): assert status is True assert 'sfp' in event_dict and event_dict['sfp'][1] == '1' assert len(chassis._sfp_list) == 3 - assert SFP.reinit.call_count == 1 # Call get_change_event with timeout=1.0 return_port_dict = {} diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 0ad9537430b9..261a03b527aa 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -49,7 +49,7 @@ def test_sfp_index(self, mock_max_port): assert sfp.sdk_index == 1 assert sfp.index == 5 - @mock.patch('sonic_platform.sfp.SFP._read_eeprom_specific_bytes', mock.MagicMock(return_value=None)) + @mock.patch('sonic_platform.sfp.SFP.read_eeprom', mock.MagicMock(return_value=None)) @mock.patch('sonic_platform.sfp.SFP._get_error_code') @mock.patch('sonic_platform.chassis.Chassis.get_num_sfps', mock.MagicMock(return_value=2)) def test_sfp_get_error_status(self, mock_get_error_code): From 8bc81206c57a5e5105dfd843a46856997f1cf957 Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Wed, 23 Mar 2022 13:19:25 +0200 Subject: [PATCH 048/119] [Mellanox] Update NVIDIA License header for files changed since 1.1.2022 (#10289) - Why I did it Update NVIDIA Copyright header to "mellanox" files which were changed since 1.1.2022 - How I did it Update the copyright header - How to verify it Sanity tests and PR checkers. --- device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml | 2 +- platform/mellanox/asic_table.j2 | 2 +- platform/mellanox/docker-saiserver-mlnx.mk | 2 +- platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 | 2 +- platform/mellanox/fw.mk | 2 +- platform/mellanox/hw-management.mk | 2 +- platform/mellanox/install-pending-fw.mk | 2 +- platform/mellanox/install-pending-fw.py | 2 +- platform/mellanox/libsaithrift-dev.mk | 2 +- platform/mellanox/mft.mk | 2 +- platform/mellanox/mlnx-onie-fw-update.sh | 2 +- platform/mellanox/mlnx-platform-api/sonic_platform/component.py | 2 +- platform/mellanox/mlnx-platform-api/sonic_platform/fan.py | 2 +- platform/mellanox/mlnx-platform-api/sonic_platform/psu.py | 2 +- platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py | 2 +- .../mlnx-platform-api/sonic_platform/thermal_actions.py | 2 +- .../mlnx-platform-api/sonic_platform/thermal_conditions.py | 2 +- platform/mellanox/mlnx-platform-api/tests/conftest.py | 2 +- platform/mellanox/mlnx-platform-api/tests/test_fan_api.py | 2 +- platform/mellanox/mlnx-platform-api/tests/test_firmware.py | 2 +- platform/mellanox/mlnx-platform-api/tests/test_psu.py | 2 +- platform/mellanox/mlnx-platform-api/tests/test_thermal.py | 2 +- .../mellanox/mlnx-platform-api/tests/test_thermal_policy.py | 2 +- platform/mellanox/mlnx-ssd-fw-update.sh | 2 +- platform/mellanox/rules.mk | 2 +- platform/mellanox/sdk.mk | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml index 51ffd949d54a..c4fb7293cc10 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/pcie.yaml @@ -1,5 +1,5 @@ ## -## Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. +## Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. ## Apache-2.0 ## ## Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/asic_table.j2 b/platform/mellanox/asic_table.j2 index a12f8d38d254..3cda40be51d5 100644 --- a/platform/mellanox/asic_table.j2 +++ b/platform/mellanox/asic_table.j2 @@ -1,5 +1,5 @@ {# - Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. + Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/docker-saiserver-mlnx.mk b/platform/mellanox/docker-saiserver-mlnx.mk index b765b338eddd..d71349a28ae7 100644 --- a/platform/mellanox/docker-saiserver-mlnx.mk +++ b/platform/mellanox/docker-saiserver-mlnx.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2018-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2018-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 index d5b5e92ea81c..b356f145c9a4 100644 --- a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 @@ -1,5 +1,5 @@ ## -## Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +## Copyright (c) 2016-2022 NVIDIA CORPORATION & AFFILIATES. ## Apache-2.0 ## ## Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index eb7371175c9e..8293b38cd5fe 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 620dd39a96b0..1f2a08b32d4d 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/install-pending-fw.mk b/platform/mellanox/install-pending-fw.mk index 0160bb81ed53..714ac6bdec6f 100644 --- a/platform/mellanox/install-pending-fw.mk +++ b/platform/mellanox/install-pending-fw.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/install-pending-fw.py b/platform/mellanox/install-pending-fw.py index 55287854bfe2..c5b61341be9d 100755 --- a/platform/mellanox/install-pending-fw.py +++ b/platform/mellanox/install-pending-fw.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/libsaithrift-dev.mk b/platform/mellanox/libsaithrift-dev.mk index d50311976cfe..579a41f02a24 100644 --- a/platform/mellanox/libsaithrift-dev.mk +++ b/platform/mellanox/libsaithrift-dev.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2017-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2017-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 2616edcd4c41..981c456906b3 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-onie-fw-update.sh b/platform/mellanox/mlnx-onie-fw-update.sh index d60c6694c0cd..4d441c5ced9b 100755 --- a/platform/mellanox/mlnx-onie-fw-update.sh +++ b/platform/mellanox/mlnx-onie-fw-update.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/component.py b/platform/mellanox/mlnx-platform-api/sonic_platform/component.py index 37f04f9a1dee..d2820090798b 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/component.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/component.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py index b67bb065a70c..8c40e2b61809 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py index 64aa0166086f..39494a124ed4 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); 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 06948af3286b..4749a6fbe710 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); 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 3b93a7468b15..bada4476d4c2 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_actions.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_actions.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); 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 456923d230c2..24a22c41019b 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/tests/conftest.py b/platform/mellanox/mlnx-platform-api/tests/conftest.py index c69ba8464e28..b69fdd6c75f0 100644 --- a/platform/mellanox/mlnx-platform-api/tests/conftest.py +++ b/platform/mellanox/mlnx-platform-api/tests/conftest.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py b/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py index 2aa33c213882..5845a1b2cadb 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_fan_api.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/tests/test_firmware.py b/platform/mellanox/mlnx-platform-api/tests/test_firmware.py index 5d576cd2d0cd..a08dbb9d1464 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_firmware.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_firmware.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/tests/test_psu.py b/platform/mellanox/mlnx-platform-api/tests/test_psu.py index 34fa70c7beca..c53a9d44797d 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_psu.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_psu.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py index 89c940d89260..9c1526479a9b 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); 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 b0ef02c347d7..ffdc6afbb0a9 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/mlnx-ssd-fw-update.sh b/platform/mellanox/mlnx-ssd-fw-update.sh index 7a180bde7bc7..07ec9ce103ea 100755 --- a/platform/mellanox/mlnx-ssd-fw-update.sh +++ b/platform/mellanox/mlnx-ssd-fw-update.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 7048920f6c5f..a6fc81b3beb4 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index f1c53e0dd134..08051e5ca0c7 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2021 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2022 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); From 8f418bb6524b6060e79966dc64ab9d510ac9b21c Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 23 Mar 2022 22:36:53 +0800 Subject: [PATCH 049/119] [Build]: Enable marvell-armhf PR check (#10259) Why I did it [Build]: Enable marvell-armhf PR check Improve the azp dependencies, make the Test stage only depended on BuildVS stage. The Test stage will be triggered once the BuildVS stage finished, reduce the waiting time. --- .../azure-pipelines-image-template.yml | 2 +- .azure-pipelines/official-build-cache.yml | 5 ++++ azure-pipelines.yml | 26 +++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 0a83c334074f..7f2874024740 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -28,7 +28,7 @@ jobs: - template: cleanup.yml - ${{ parameters.preSteps }} - script: | - if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox)$"; then + 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" echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" diff --git a/.azure-pipelines/official-build-cache.yml b/.azure-pipelines/official-build-cache.yml index 4019dbba4f97..94fd48ede501 100644 --- a/.azure-pipelines/official-build-cache.yml +++ b/.azure-pipelines/official-build-cache.yml @@ -37,3 +37,8 @@ stages: variables: docker_syncd_rpc_image: yes platform_rpc: mlnx + - name: marvell-armhf + pool: sonicbld-armhf + timeoutInMinutes: 1200 + variables: + PLATFORM_ARCH: armhf diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b96deeefb37b..557ce3beff82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,25 +31,41 @@ resources: name: Azure/sonic-mgmt endpoint: build +variables: +- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml +- name: CACHE_MODE + value: rcache + stages: -- stage: Build +- stage: BuildVS pool: sonicbld - variables: - - template: .azure-pipelines/azure-pipelines-repd-build-variables.yml - - name: CACHE_MODE - value: rcache 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: [] + jobs: + - template: .azure-pipelines/azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + jobGroups: - name: broadcom variables: swi_image: yes - name: mellanox + - name: marvell-armhf + pool: sonicbld-armhf + timeoutInMinutes: 1200 + variables: + PLATFORM_ARCH: armhf - stage: Test + dependsOn: BuildVS variables: - name: inventory value: veos_vtb From 147d63106510c69d8916f752a08db0d2bdfcbbed Mon Sep 17 00:00:00 2001 From: "Robert J. Halstead" Date: Wed, 23 Mar 2022 17:21:36 -0700 Subject: [PATCH 050/119] [PINS] update sonic-p4rt docker to bullseye (#10182) #### Why I did it SONiC is migrating to bullseye. This will update the sonic-pins container to bullseye. #### How I did it The [sonic-pins code](https://github.com/Azure/sonic-buildimage/blob/master/rules/p4rt.mk) isn't dependent on any architecture so it will already build successfully for bullseye. This PR updates the docker to use bullseye. #### How to verify it Today we cannot build the docker-sonic-p4rt.gz target (e.g. Issue #9885). With this change the docker will build successfully. The P4RT executable will not run, because of a missing runtime library, libgmpxx, which I'll address in a followup PR. #### Description for the changelog Update docker-sonic-p4rt.gz target to build with Bullseye instead of Buster. --- dockers/docker-sonic-p4rt/Dockerfile.j2 | 2 +- rules/docker-p4rt.mk | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dockers/docker-sonic-p4rt/Dockerfile.j2 b/dockers/docker-sonic-p4rt/Dockerfile.j2 index c27dadad6cf7..8708518340c8 100644 --- a/dockers/docker-sonic-p4rt/Dockerfile.j2 +++ b/dockers/docker-sonic-p4rt/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-config-engine-bullseye ARG docker_container_name ARG git_commit diff --git a/rules/docker-p4rt.mk b/rules/docker-p4rt.mk index 6d8a650aad82..60e0d7d75244 100644 --- a/rules/docker-p4rt.mk +++ b/rules/docker-p4rt.mk @@ -7,12 +7,12 @@ DOCKER_P4RT_DBG = $(DOCKER_P4RT_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_P4RT)_PATH = $(DOCKERS_PATH)/$(DOCKER_P4RT_STEM) $(DOCKER_P4RT)_DEPENDS += $(SONIC_P4RT) -$(DOCKER_P4RT)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) +$(DOCKER_P4RT)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) $(DOCKER_P4RT)_DBG_DEPENDS += $(SONIC_P4RT_DBG) $(LIBSWSSCOMMON_DBG) $(DOCKER_P4RT)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) -$(DOCKER_P4RT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_P4RT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) -$(DOCKER_P4RT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) +$(DOCKER_P4RT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) $(DOCKER_P4RT)_VERSION = 1.0.0 $(DOCKER_P4RT)_PACKAGE_NAME = p4rt From 97c02075f5d6590ca8b5083e9141182cd4492299 Mon Sep 17 00:00:00 2001 From: pavannaregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Thu, 24 Mar 2022 19:54:13 +0530 Subject: [PATCH 051/119] [Marvell-armhf] Fixing issues related to partition label (#10203) Why I did it Removing incorrect check in plt setup for fw_env config: This check was added before to compare 2 different types of disk. Now the check is redundant and check is not required as transition is complete. 2)Removing legacy_volume_label in create_partition: legacy_volume_label is not used in armhf install files. With legacy_volume_label initialized to NULL, current code will always return true for check, if demo_part exits. How I did it Change is about removing the redundant/incorrect code explained above. How to verify it uboot fw_printenv and fw_setenv is tested onie-nos-install has be verified. Signed-off-by: Pavan Naregundi --- platform/marvell-armhf/platform.conf | 2 +- .../sonic-platform-nokia/nokia-7215_plt_setup.sh | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/platform/marvell-armhf/platform.conf b/platform/marvell-armhf/platform.conf index 58748808fef7..3a9869158abc 100644 --- a/platform/marvell-armhf/platform.conf +++ b/platform/marvell-armhf/platform.conf @@ -196,7 +196,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 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 8301999d0d0a..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 From 7eb321c376fd1fcdbc67462185b8d4a7cff5f76f Mon Sep 17 00:00:00 2001 From: pavannaregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Thu, 24 Mar 2022 19:54:49 +0530 Subject: [PATCH 052/119] [Marvell-armhf] Setting u-boot ftd_high to resolve kernel hung (#10204) Why I did it Kernel hang in during early boot is caused due overwriting of device tree with uncompressing kernel. Added the fdt_high which gives a safe offset from kernel location. How I did it Setting uboot environment variable fdt_high. How to verify it Successful boot of bullseye kernel on Marvell Armada 380/385. Change-Id: I3e2521780f5ecdb3bdf6cbb6542250814ca11959 Signed-off-by: Pavan Naregundi --- platform/marvell-armhf/platform.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/marvell-armhf/platform.conf b/platform/marvell-armhf/platform.conf index 3a9869158abc..0ef500e16e4f 100644 --- a/platform/marvell-armhf/platform.conf +++ b/platform/marvell-armhf/platform.conf @@ -7,6 +7,7 @@ echo "Preparing for installation ... " # global defines kernel_addr=0x1100000 fdt_addr=0x1000000 +fdt_high=0x10fffff initrd_addr=0x2000000 VAR_LOG=512 @@ -152,6 +153,7 @@ prepare_boot_menu() { # 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 ] From e2502edefdb38b3f93aab3ff4e4129e021a43a1f Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Thu, 24 Mar 2022 23:44:37 +0530 Subject: [PATCH 053/119] Refactoring DELL platform init to reduce rc.local processing time porting changes in master (#10318) Why I did it To reduce the processing time of rc.local, refactoring s6100 platform initialization. Porting changes from 202012 branch [202012] Refactoring DELL platform init to reduce rc.local processing time #10171 --- files/image_config/platform/rc.local | 3 +- .../debian/platform-modules-s6100.install | 4 +- .../s6100/scripts/fast-reboot_plugin | 2 +- .../s6100/scripts/reboot_plugin | 2 +- .../s6100/scripts/s6100_platform.sh | 56 +++++++------------ ...umeration.sh => s6100_platform_startup.sh} | 31 +++++++++- .../s6100/systemd/s6100-i2c-enumerate.service | 12 ---- .../systemd/s6100-platform-startup.service | 12 ++++ 8 files changed, 68 insertions(+), 54 deletions(-) rename platform/broadcom/sonic-platform-modules-dell/s6100/scripts/{s6100_i2c_enumeration.sh => s6100_platform_startup.sh} (89%) delete mode 100644 platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service create mode 100644 platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index b01c802f086f..7043da9fe143 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -225,11 +225,10 @@ if [ ! -e /host/machine.conf ]; then grub_installation_needed="TRUE" fi + migrate_nos_configuration umount /mnt/onie-boot fi -migrate_nos_configuration - . /host/machine.conf program_console_speed 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 cac4ffbf65db..4770ac7c2caf 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 @@ -33,7 +33,7 @@ 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 s6100/scripts/s6100_serial_getty_monitor etc/monit/conf.d common/fw-updater usr/local/bin common/onie_mode_set usr/local/bin 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 683dcc6733ae..20a5d8cf5ac2 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 @@ -8,4 +8,4 @@ fi io_rd_wr.py --set --val 40 --offset 0x131 io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 0B --offset 211; io_rd_wr.py --set --val aa --offset 213 -/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/reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin index 4ccfecdfe2af..84b525fe6bac 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin @@ -5,4 +5,4 @@ if [[ -d /sys/devices/platform/SMF.512/hwmon/ ]]; then 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/s6100_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh index 2afa571aa809..15763bbc9e36 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,20 +2,6 @@ #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=$(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 -} - - if [[ "$1" == "init" ]]; then pericom="/sys/bus/pci/devices/0000:08:00.0" @@ -38,30 +24,31 @@ if [[ "$1" == "init" ]]; then systemctl start --no-block s6100-ssd-upgrade-status.service - is_fast_warm=$(cat /proc/cmdline | grep SONIC_BOOT_TYPE | wc -l) - - if [[ "$is_fast_warm" == "1" ]]; then - systemctl start --no-block s6100-i2c-enumerate.service + 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 + + 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 - echo -2 > /sys/bus/i2c/drivers/pca954x/0-0070/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/4-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/6-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/6-0072/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/7-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/7-0072/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/8-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/8-0072/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/9-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/9-0072/idle_state - - install_python_api_package - monit reload - 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 @@ -69,7 +56,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_i2c_enumeration.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh similarity index 89% rename from platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh rename to platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh index d00fec233eaa..d6f6d74cf290 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh @@ -1,9 +1,22 @@ #!/bin/bash -### DellEMC S6100 I2C MUX Enumeration script +### 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 @@ -292,6 +305,20 @@ if [[ "$1" == "init" ]]; then switch_board_qsfp_lpmode "disable" /usr/local/bin/s6100_bitbang_reset.sh xcvr_presence_interrupts "enable" + + echo -2 > /sys/bus/i2c/drivers/pca954x/0-0070/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/4-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/6-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/6-0072/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/7-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/7-0072/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/8-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/8-0072/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/9-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/9-0072/idle_state + + install_python_api_package + monit reload elif [[ "$1" == "deinit" ]]; then xcvr_presence_interrupts "disable" switch_board_sfp "delete_device" @@ -302,4 +329,6 @@ elif [[ "$1" == "deinit" ]]; then 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/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..d7a40f43033c --- /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 +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/s6100_platform_startup.sh init +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target From 928261845058a177c4b65ebaf20495e85d48a497 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Fri, 25 Mar 2022 06:14:30 +0800 Subject: [PATCH 054/119] [YANG] Add route flow counter support (#9814) * [YANG] Add route flow counter support --- .../tests/files/sample_config_db.json | 15 ++++ .../yang_model_tests/tests/flex_counter.json | 11 +++ .../tests_config/flex_counter.json | 73 +++++++++++++++++++ .../yang-models/sonic-flex_counter.yang | 65 +++++++++++++++++ 4 files changed, 164 insertions(+) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index ae0cc60da648..6415fb6100e9 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1021,6 +1021,21 @@ }, "DEBUG_COUNTER": { "FLEX_COUNTER_STATUS": "enable" + }, + "FLOW_CNT_ROUTE": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + } + }, + "FLOW_COUNTER_ROUTE_PATTERN": { + "1.1.1.0/24": { + "max_match_count": "30" + }, + "2000::/64": { + "max_match_count": "30" + }, + "Vnet1|2.2.2.0/24": { + "max_match_count": "30" } }, "CRM": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/flex_counter.json b/src/sonic-yang-models/tests/yang_model_tests/tests/flex_counter.json index 7a328ca693c1..92d96b54f3a1 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/flex_counter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/flex_counter.json @@ -6,5 +6,16 @@ "desc": "Out of range poll interval.", "eStrKey": "Range", "eStr": "100..4294967295" + }, + "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF": { + "desc": "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF no failure." + }, + "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_DEFAULT_VRF": { + "desc": "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_DEFAULT_VRF no failure." + }, + "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_INVALID_MAX_MATCH_COUNT": { + "desc": "Out of range max_match_count.", + "eStrKey": "Range", + "eStr": "1..50" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json index 9043132791fd..169a38ff6d7c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json @@ -46,6 +46,10 @@ "FLOW_CNT_TRAP": { "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": 10000 + }, + "FLOW_CNT_ROUTE": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": 10000 } } } @@ -97,8 +101,77 @@ "FLOW_CNT_TRAP": { "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": 99 + }, + "FLOW_CNT_ROUTE": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": 99 } } } + }, + "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_VRF": { + "sonic-vrf:sonic-vrf":{ + "sonic-vrf:VRF": { + "VRF_LIST": [ + { + "name":"Vrf1" + } + ] + } + }, + "sonic-flex_counter:sonic-flex_counter": { + "sonic-flex_counter:FLOW_COUNTER_ROUTE_PATTERN": { + "FLOW_COUNTER_ROUTE_PATTERN_VRF_LIST": [ + { + "vrf_name": "Vrf1", + "ip_prefix": "1.1.1.0/24", + "max_match_count": 30 + }, + { + "vrf_name": "Vrf1", + "ip_prefix": "2000::/64", + "max_match_count": 30 + } + ] + } + } + }, + "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_DEFAULT_VRF": { + "sonic-flex_counter:sonic-flex_counter": { + "sonic-flex_counter:FLOW_COUNTER_ROUTE_PATTERN": { + "FLOW_COUNTER_ROUTE_PATTERN_LIST": [ + { + "ip_prefix": "1.1.1.0/24", + "max_match_count": 30 + }, + { + "ip_prefix": "2000::/64", + "max_match_count": 30 + } + ] + } + } + }, + "FLOW_COUNTER_ROUTE_PATTERN_TABLE_WITH_INVALID_MAX_MATCH_COUNT": { + "sonic-vrf:sonic-vrf":{ + "sonic-vrf:VRF": { + "VRF_LIST": [ + { + "name":"Vrf1" + } + ] + } + }, + "sonic-flex_counter:sonic-flex_counter": { + "sonic-flex_counter:FLOW_COUNTER_ROUTE_PATTERN": { + "FLOW_COUNTER_ROUTE_PATTERN_VRF_LIST": [ + { + "vrf_name": "Vrf1", + "ip_prefix": "1.1.1.0/24", + "max_match_count": 0 + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-flex_counter.yang b/src/sonic-yang-models/yang-models/sonic-flex_counter.yang index 8e958af2f427..9ced223e94bc 100644 --- a/src/sonic-yang-models/yang-models/sonic-flex_counter.yang +++ b/src/sonic-yang-models/yang-models/sonic-flex_counter.yang @@ -5,6 +5,10 @@ module sonic-flex_counter { namespace "http://github.com/Azure/sonic-flex_counter"; prefix flex_counter; + import ietf-inet-types { + prefix inet; + } + import sonic-types { prefix stypes; } @@ -211,8 +215,69 @@ module sonic-flex_counter { } } + container FLOW_CNT_ROUTE { + /* ROUTE_FLEX_COUNTER_GROUP */ + leaf FLEX_COUNTER_STATUS { + type flex_status; + } + leaf FLEX_COUNTER_DELAY_STATUS { + type flex_delay_status; + } + leaf POLL_INTERVAL { + type poll_interval; + } + } + } /* end of container FLEX_COUNTER_TABLE */ + + container FLOW_COUNTER_ROUTE_PATTERN { + description "Flow counter route pattern of config_db.json"; + + list FLOW_COUNTER_ROUTE_PATTERN_LIST { + + key "ip_prefix"; + + leaf ip_prefix { + type inet:ip-prefix; + } + + leaf max_match_count { + type uint32 { + range 1..50; + } + } + + } + + list FLOW_COUNTER_ROUTE_PATTERN_VRF_LIST { + + key "vrf_name ip_prefix"; + + leaf vrf_name { + /* + We don't use vrf_name reference here because: + 1. User is allowed to configure a VRF that does not exist yet here, orchagent is designed to resolve the VRF name once the VRF is created. + 2. The field vrf_name accept both VRF name and VNET name. + */ + type string { + length 0..16; + } + } + + leaf ip_prefix { + type inet:ip-prefix; + } + + leaf max_match_count { + type uint32 { + range 1..50; + } + } + + } + } + /* end of container FLOW_COUNTER_ROUTE_PATTERN */ } /* end of top level container */ } From cc938e73a3a22dfa1527344b5c4e772cf4aaf8c6 Mon Sep 17 00:00:00 2001 From: tomer-israel <76040066+tomer-israel@users.noreply.github.com> Date: Sat, 26 Mar 2022 03:47:24 +0300 Subject: [PATCH 055/119] Dynamic port configuration - solve lldp issues when adding/removing ports (#9386) #### Why I did it when adding and removing ports after init stage we saw two issues: first: In several cases, after removing a port, lldpmgr is continuing to try to add a port to lldp with lldpcli command. the execution of this command is continuing to fail since the port is not existing anymore. second: after adding a port, we sometimes see this warning messgae: "Command failed 'lldpcli configure ports Ethernet18 lldp portidsubtype local etp5b': 2021-07-27T14:16:54 [WARN/lldpctl] cannot find port Ethernet18" we added these changes in order to solve it. #### How I did it port create events are taken from app db only. lldpcli command is executed only when linux port is up. when delete port event is received we remove this command from pending_cmds dictionary #### How to verify it manual tests and running lldp tests #### Description for the changelog Dynamic port configuration - solve lldp issues when adding/removing ports --- dockers/docker-lldp/lldpmgrd | 116 ++++++++++++++++------------------- 1 file changed, 54 insertions(+), 62 deletions(-) diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index a6eb84bcab93..9e85406d4510 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -30,6 +30,8 @@ VERSION = "1.0" SYSLOG_IDENTIFIER = "lldpmgrd" PORT_INIT_TIMEOUT = 300 +FAILED_CMD_TIMEOUT = 6 +RETRY_LIMIT = 5 class LldpManager(daemon_base.DaemonBase): @@ -41,7 +43,8 @@ class LldpManager(daemon_base.DaemonBase): state_db: Handle to Redis State database via swsscommon lib config_db: Handle to Redis Config database via swsscommon lib pending_cmds: Dictionary where key is port name, value is pending - LLDP configuration command to run + LLDP configuration command to run + and the last timestamp that this command was failed (used for retry mechanism) """ REDIS_TIMEOUT_MS = 0 @@ -58,6 +61,11 @@ class LldpManager(daemon_base.DaemonBase): self.REDIS_TIMEOUT_MS, False) + # Open a handle to the State database + self.state_db = swsscommon.DBConnector("STATE_DB", + self.REDIS_TIMEOUT_MS, + False) + self.pending_cmds = {} self.hostname = "None" self.mgmt_ip = "None" @@ -66,6 +74,7 @@ class LldpManager(daemon_base.DaemonBase): 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) + self.state_port_table = swsscommon.Table(self.state_db, swsscommon.STATE_PORT_TABLE_NAME) def update_hostname(self, hostname): cmd = "lldpcli configure system hostname {0}".format(hostname) @@ -99,32 +108,25 @@ class LldpManager(daemon_base.DaemonBase): 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 - PORT TABLE in the Application DB + Determine if a port is up or down by looking into the netdev_oper_status for the port in + PORT TABLE in the State DB """ # Retrieve all entires for this port from the Port table - (status, fvp) = self.app_port_table.get(port_name) + (status, fvp) = self.state_port_table.get(port_name) if status: # Convert list of tuples to a dictionary port_table_dict = dict(fvp) # Get the oper-status for the port - if "oper_status" in port_table_dict: - port_oper_status = port_table_dict.get("oper_status") - self.log_info("Port name {} oper status: {}".format(port_name, port_oper_status)) + if "netdev_oper_status" in port_table_dict: + port_oper_status = port_table_dict.get("netdev_oper_status") return port_oper_status == "up" else: return False else: - # Retrieve PortInitDone entry from the Port table - (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( - port_name, swsscommon.APP_PORT_TABLE_NAME)) return False - def generate_pending_lldp_config_cmd_for_port(self, port_name): + def generate_pending_lldp_config_cmd_for_port(self, port_name, port_table_dict): """ For port `port_name`, look up the description and alias in the Config database, then form the appropriate lldpcli configuration command and run it. @@ -135,27 +137,16 @@ class LldpManager(daemon_base.DaemonBase): # asic-to-asic communication in VOQ based chassis system. We do not configure LLDP on these. if port_name.startswith(inband_prefix()): return - - # Retrieve all entires for this port from the Port table - (status, fvp) = self.port_table.get(port_name) - if status: - # Convert list of tuples to a dictionary - port_table_dict = dict(fvp) - - # Get the port alias. If None or empty string, use port name instead - port_alias = port_table_dict.get("alias") - if not port_alias: - self.log_info("Unable to retrieve port alias for port '{}'. Using port name instead.".format(port_name)) - port_alias = port_name - - # Get the port description. If None or empty string, we'll skip this configuration - port_desc = port_table_dict.get("description") - - else: - self.log_error("Port '{}' not found in {} table in Config DB. Using port name instead of port alias.".format( - port_name, swsscommon.CFG_PORT_TABLE_NAME)) + + # Get the port alias. If None or empty string, use port name instead + port_alias = port_table_dict.get("alias") + if not port_alias: + self.log_info("Unable to retrieve port alias for port '{}'. Using port name instead.".format(port_name)) port_alias = port_name - + + # Get the port description. If None or empty string, we'll skip this configuration + port_desc = port_table_dict.get("description") + lldpcli_cmd = "lldpcli configure ports {0} lldp portidsubtype local {1}".format(port_name, port_alias) # if there is a description available, also configure that @@ -166,17 +157,25 @@ class LldpManager(daemon_base.DaemonBase): # Add the command to our dictionary of pending commands, overwriting any # previous pending command for this port - self.pending_cmds[port_name] = lldpcli_cmd + self.pending_cmds[port_name] = { 'cmd': lldpcli_cmd, 'failed_count': 0} def process_pending_cmds(self): # List of port names (keys of elements) to delete from self.pending_cmds to_delete = [] - for (port_name, cmd) in self.pending_cmds.items(): - self.log_debug("Running command: '{}'".format(cmd)) + for (port_name, port_item) in self.pending_cmds.items(): + cmd = port_item['cmd'] - rc, stderr = run_cmd(self, cmd) + # check if linux port is up + if not self.is_port_up(port_name): + self.log_info("port %s is not up, continue"%port_name) + continue + + if 'failed_timestamp' in port_item and time.time()-port_item['failed_timestamp']= RETRY_LIMIT: + self.log_error("Command failed '{}': {} - command was failed {} times, disabling retry".format(cmd, stderr, RETRY_LIMIT+1)) + # not retrying again + to_delete.append(port_name) + else: + self.pending_cmds[port_name]['failed_count'] += 1 + self.pending_cmds[port_name]['failed_timestamp'] = time.time() + self.log_info("Command failed '{}': {} - cmd failed {} times, retrying again".format(cmd, stderr, self.pending_cmds[port_name]['failed_count'])) + # Delete all successful commands from self.pending_cmds for port_name in to_delete: self.pending_cmds.pop(port_name, None) @@ -268,10 +274,6 @@ class LldpManager(daemon_base.DaemonBase): sel = swsscommon.Select() - # Subscribe to PORT table notifications in the Config DB - sst_confdb = swsscommon.SubscriberStateTable(self.config_db, swsscommon.CFG_PORT_TABLE_NAME) - sel.addSelectable(sst_confdb) - # Subscribe to PORT table notifications in the App DB sst_appdb = swsscommon.SubscriberStateTable(self.appl_db, swsscommon.APP_PORT_TABLE_NAME) sel.addSelectable(sst_appdb) @@ -289,17 +291,6 @@ class LldpManager(daemon_base.DaemonBase): (state, c) = sel.select(SELECT_TIMEOUT_MS) if state == swsscommon.Select.OBJECT: - (key, op, fvp) = sst_confdb.pop() - if fvp: - fvp_dict = dict(fvp) - - # handle config change - if ("alias" in fvp_dict or "description" in fvp_dict) and (op in ["SET", "DEL"]): - if self.is_port_up(key): - self.generate_pending_lldp_config_cmd_for_port(key) - 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) @@ -310,15 +301,16 @@ class LldpManager(daemon_base.DaemonBase): (key, op, fvp) = sst_appdb.pop() if (key != "PortInitDone") and (key != "PortConfigDone"): - if fvp: - fvp_dict = dict(fvp) - - # handle port status change - if "oper_status" in fvp_dict: - if "up" in fvp_dict.get("oper_status"): - self.generate_pending_lldp_config_cmd_for_port(key) + if op == "SET": + if fvp: + if "up" in dict(fvp).get("oper_status",""): + self.generate_pending_lldp_config_cmd_for_port(key, dict(fvp)) else: self.pending_cmds.pop(key, None) + elif op == "DEL": + self.pending_cmds.pop(key, None) + else: + self.log_error("unknown operation") elif key == "PortInitDone": port_init_done = True From 8e642848c2064067819a1ba39c63a3200ba29cc2 Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Mon, 28 Mar 2022 11:22:32 -0700 Subject: [PATCH 056/119] Introduce the asic_subtype field for adding the sub platform variants. (#10235) * Introduce the asic_subtype field for adding the sub platform variants. It uses the value of TARGET_MACHINE variable in slave.mk. --- build_debian.sh | 1 + dockers/docker-orchagent/orchagent.sh | 1 + files/build_templates/sonic_version.yml.j2 | 3 +++ files/build_templates/swss_vars.j2 | 3 +++ 4 files changed, 8 insertions(+) diff --git a/build_debian.sh b/build_debian.sh index 62de5a8218fb..c509b7097151 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -492,6 +492,7 @@ export build_version="${SONIC_IMAGE_VERSION}" export debian_version="$(cat $FILESYSTEM_ROOT/etc/debian_version)" export kernel_version="${kversion}" export asic_type="${sonic_asic_platform}" +export asic_subtype="${TARGET_MACHINE}" export commit_id="$(git rev-parse --short HEAD)" export branch="$(git rev-parse --abbrev-ref HEAD)" export release="$(if [ -f $FILESYSTEM_ROOT/etc/sonic/sonic_release ]; then cat $FILESYSTEM_ROOT/etc/sonic/sonic_release; fi)" diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index aaa047a42036..7585e4896cf4 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -5,6 +5,7 @@ SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2 # Retrieve SWSS vars from sonic-cfggen SWSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $SWSS_VARS_FILE) || exit 1 export platform=$(echo $SWSS_VARS | jq -r '.asic_type') +export sub_platform=$(echo $SWSS_VARS | jq -r '.asic_subtype') MAC_ADDRESS=$(echo $SWSS_VARS | jq -r '.mac') if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then diff --git a/files/build_templates/sonic_version.yml.j2 b/files/build_templates/sonic_version.yml.j2 index 34486061ea8a..6e3f3acac95a 100644 --- a/files/build_templates/sonic_version.yml.j2 +++ b/files/build_templates/sonic_version.yml.j2 @@ -7,6 +7,9 @@ debian_version: '{{ debian_version }}' kernel_version: '{{ kernel_version }}' {% endif -%} asic_type: {{ asic_type }} +{% if asic_subtype is defined and asic_subtype != '' -%} +asic_subtype: '{{ asic_subtype }}' +{% endif -%} commit_id: '{{ commit_id }}' branch: '{{ branch }}' {% if release is defined and release != '' -%} diff --git a/files/build_templates/swss_vars.j2 b/files/build_templates/swss_vars.j2 index df5e4d038f51..1cd95d16a6d6 100644 --- a/files/build_templates/swss_vars.j2 +++ b/files/build_templates/swss_vars.j2 @@ -1,5 +1,8 @@ { "asic_type": "{{ asic_type }}", + {% if asic_subtype is defined and asic_subtype != '' -%} + "asic_subtype": "{{ asic_subtype }}", + {% endif -%} "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}", "mac": "{{ DEVICE_METADATA.localhost.mac }}", "resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}", From beead0a6cf8a27e62ea65489096333f198502e2e Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:34:46 +0800 Subject: [PATCH 057/119] [Build]: Fix host image debian package version issue (#10358) Why I did it Fix host image debian package version issue. The package dependencies may have issue, when some of debian packages of the base image are upgraded. For example, libc is installed in base image, but if the mirror has new version, when running "apt-get upgrade", the package will be upgraded unexpected. To avoid such issue, need to add the versions when building the host image. How I did it The package versions of host-image should contain host-base-image. --- scripts/prepare_slave_container_buildinfo.sh | 4 ++++ scripts/versions_manager.py | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/prepare_slave_container_buildinfo.sh b/scripts/prepare_slave_container_buildinfo.sh index be6fe078bdfb..5d306a0e1c20 100755 --- a/scripts/prepare_slave_container_buildinfo.sh +++ b/scripts/prepare_slave_container_buildinfo.sh @@ -10,6 +10,10 @@ sudo dpkg -i --force-overwrite $SLAVE_DIR/buildinfo/sonic-build-hooks_*.deb > /d # Enable the build hooks symlink_build_hooks +# Enable reproducible mirrors +set_reproducible_mirrors +apt-get update > /dev/null 2>&1 + # Build the slave running config cp -rf $SLAVE_DIR/buildinfo/* /usr/local/share/buildinfo/ . /usr/local/share/buildinfo/scripts/buildinfo_base.sh diff --git a/scripts/versions_manager.py b/scripts/versions_manager.py index c986e29a4e17..a20684e97bb4 100755 --- a/scripts/versions_manager.py +++ b/scripts/versions_manager.py @@ -174,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) @@ -661,10 +670,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) From f054d07df5e0b8990dac7e2bd789e84c9d0ee5d4 Mon Sep 17 00:00:00 2001 From: Lior Avramov <73036155+liorghub@users.noreply.github.com> Date: Tue, 29 Mar 2022 16:34:24 +0300 Subject: [PATCH 058/119] [sonic-swss]: Advance submodule (#10332) Update sonic-swss submodule to include below commits: d80094b [aclorch] Do not fail ACL rule remove flow if rule already deleted (#2183) bea0b70 [gcov]: Change coverage.xml file references (#2120) 829b219 [tunnelmgrd]: Warm boot support (#2166) ad65b0a Fix issue: sometimes PFC WD unable to create zero buffer pool (#2164) 608acc3 [doc] Moving Configuration.md from swss to yang sub-folder (#2177) 0294376 [orchagent] NVGRE Tunnel orchestration agent implementation (#1953) ce88696 [ci] Update default sonic image downloading build ID. (#2175) Co-authored-by: liora --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 00266891a9f4..d80094b248e7 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 00266891a9f41e5bd37100b05237e865cde429b2 +Subproject commit d80094b248e7df5ac9df309d785ddf21e0ab92d7 From 7debcffe6249a97996222114c2963b47f4fe4326 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 30 Mar 2022 04:35:42 +0800 Subject: [PATCH 059/119] [Accton/PDDF] Enable thermalctld in pmon (#9982) When do "skip_thermalcltd: true" will let "show platform fan" and "show platform temp" fail. When enable thermalctld, these cmd will work well. Signed-off-by: Jostar Yang --- .../x86_64-accton_as5835_54t-r0/pmon_daemon_control.json | 2 +- .../x86_64-accton_as7712_32x-r0/pmon_daemon_control.json | 2 +- .../x86_64-accton_as7726_32x-r0/pmon_daemon_control.json | 3 +-- .../x86_64-accton_as9716_32d-r0/pmon_daemon_control.json | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54t-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as5835_54t-r0/pmon_daemon_control.json index 584a14b9d942..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as5835_54t-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as5835_54t-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_as7712_32x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as7712_32x-r0/pmon_daemon_control.json index 59bdebeb4b52..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as7712_32x-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_as7726_32x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json index 0d3f1fb4561d..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json @@ -1,6 +1,5 @@ { "skip_ledd": true, - "skip_pcied": true, - "skip_thermalctld": true + "skip_pcied": true } diff --git a/device/accton/x86_64-accton_as9716_32d-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as9716_32d-r0/pmon_daemon_control.json index 584a14b9d942..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as9716_32d-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as9716_32d-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { "skip_ledd": true, - "skip_thermalctld": true + "skip_pcied": true } From ab3053b3df8d072fa62de5babbd910675eea6928 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 30 Mar 2022 04:36:58 +0800 Subject: [PATCH 060/119] [Accton/PDDF] Support show cmd for psu-temp and fan (#10215) Why I did it Support for show platform temp/fan for psu-temp and fan. Original code doesn't has fan_drawer to support these information. How I did it Support for show platform temp/fan for psu-temp and fan. Add fan_drawer.py and update thermal.py to add needed code. It need PDDF common code to support . (Refer to #10213) How to verify it Test show platform temp and show platform fan. root@as7726-32x-2:~# show platform fan Drawer LED FAN Speed Direction Presence Status Timestamp Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 08:13:04 N/A green PSU1_FAN1 23% EXHAUST Present OK 20220311 08:13:04 N/A green PSU2_FAN1 22% EXHAUST Present OK 20220311 08:13:04 root@as7726-32x-2:~# show platform temp Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp PSU1_TEMP1 28 N/A N/A N/A N/A False 20220311 08:13:04 PSU2_TEMP1 25 N/A N/A N/A N/A False 20220311 08:13:04 TEMP1 23.5 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP2 27 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP3 24 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP4 27 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP5 24 80.0 N/A N/A N/A False 20220311 08:13:04 Co-authored-by: Jostar Yang --- .../as4630-54pe/sonic_platform/fan_drawer.py | 17 +++++++++++++++++ .../as4630-54pe/sonic_platform/thermal.py | 4 ++-- .../as7326-56x/sonic_platform/fan_drawer.py | 17 +++++++++++++++++ .../as7326-56x/sonic_platform/thermal.py | 4 ++-- .../as7712-32x/sonic_platform/fan_drawer.py | 17 +++++++++++++++++ .../as7712-32x/sonic_platform/thermal.py | 4 ++-- .../as7726-32x/sonic_platform/fan_drawer.py | 17 +++++++++++++++++ .../as7726-32x/sonic_platform/thermal.py | 4 ++-- .../as7816-64x/sonic_platform/fan_drawer.py | 17 +++++++++++++++++ .../as7816-64x/sonic_platform/thermal.py | 4 ++-- .../as9716-32d/sonic_platform/fan_drawer.py | 17 +++++++++++++++++ .../as9716-32d/sonic_platform/thermal.py | 4 ++-- 12 files changed, 114 insertions(+), 12 deletions(-) create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/fan_drawer.py diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py index 5b829fc26caa..77d6ec7ae886 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py @@ -11,7 +11,7 @@ class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): - PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/thermal.py index 5b829fc26caa..77d6ec7ae886 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform/thermal.py @@ -11,7 +11,7 @@ class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): - PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py index 5b829fc26caa..77d6ec7ae886 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py @@ -11,7 +11,7 @@ class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): - PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/thermal.py index 5b829fc26caa..77d6ec7ae886 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform/thermal.py @@ -11,7 +11,7 @@ class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): - PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/thermal.py index 5b829fc26caa..77d6ec7ae886 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform/thermal.py @@ -11,7 +11,7 @@ class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): - PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/thermal.py index 5b829fc26caa..77d6ec7ae886 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/sonic_platform/thermal.py @@ -11,7 +11,7 @@ class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): - PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) # Provide the functions/variables below for which implementation is to be overwritten From 1ddcfd0c3c516a28a63faac922a9df25061641b8 Mon Sep 17 00:00:00 2001 From: tjchadaga <85581939+tjchadaga@users.noreply.github.com> Date: Tue, 29 Mar 2022 13:41:31 -0700 Subject: [PATCH 061/119] Update Broadcom SAI version to 6.1 (#10344) --- platform/broadcom/sai-modules.mk | 4 ++-- platform/broadcom/sai.mk | 4 ++-- platform/broadcom/saibcm-modules-dnx | 2 +- platform/broadcom/saibcm-modules/debian/changelog | 6 ++++++ platform/broadcom/saibcm-modules/make/Make.config | 5 +++++ .../saibcm-modules/systems/linux/user/common/Makefile | 4 ++++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/platform/broadcom/sai-modules.mk b/platform/broadcom/sai-modules.mk index b4f28f125687..1236e06d6240 100644 --- a/platform/broadcom/sai-modules.mk +++ b/platform/broadcom/sai-modules.mk @@ -1,6 +1,6 @@ # Broadcom SAI modules -BRCM_OPENNSL_KERNEL_VERSION = 6.0.0.13 +BRCM_OPENNSL_KERNEL_VERSION = 6.1.0.3 BRCM_OPENNSL_KERNEL = opennsl-modules_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules @@ -10,7 +10,7 @@ $(BRCM_OPENNSL_KERNEL)_MACHINE = broadcom SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL) # SAI bcm modules for DNX family ASIC -BRCM_DNX_OPENNSL_KERNEL_VERSION = 6.0.0.13 +BRCM_DNX_OPENNSL_KERNEL_VERSION = 6.1.0.3 BRCM_DNX_OPENNSL_KERNEL = opennsl-modules-dnx_$(BRCM_DNX_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_DNX_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules-dnx diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index e23515a1f5ea..1ec8d915e5bd 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,5 +1,5 @@ -LIBSAIBCM_VERSION = 6.0.0.13-3 -LIBSAIBCM_BRANCH_NAME = REL_6.0 +LIBSAIBCM_VERSION = 6.1.0.3 +LIBSAIBCM_BRANCH_NAME = REL_6.1 LIBSAIBCM_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_VERSION)" BRCM_SAI = libsaibcm_$(LIBSAIBCM_VERSION)_amd64.deb diff --git a/platform/broadcom/saibcm-modules-dnx b/platform/broadcom/saibcm-modules-dnx index 3fc83d5e5f9d..6bf58f8310bc 160000 --- a/platform/broadcom/saibcm-modules-dnx +++ b/platform/broadcom/saibcm-modules-dnx @@ -1 +1 @@ -Subproject commit 3fc83d5e5f9d1abad3ddf7fa6767b8cdd6121232 +Subproject commit 6bf58f8310bcb29168ae5b2dabed84fc942429fc diff --git a/platform/broadcom/saibcm-modules/debian/changelog b/platform/broadcom/saibcm-modules/debian/changelog index e9e36aaaf302..0ff357c57279 100644 --- a/platform/broadcom/saibcm-modules/debian/changelog +++ b/platform/broadcom/saibcm-modules/debian/changelog @@ -1,3 +1,9 @@ +opennsl (6.1.0.3) unstable; urgency=medium + + * Update to Broadcom SAI 6.1.0.3 + + -- Tejaswini Chadaga Fri, 24 MAR 2022 12:30:00 +0000 + opennsl (6.0.0.13) unstable; urgency=medium * Update to Broadcom SAI 6.0.0.13 diff --git a/platform/broadcom/saibcm-modules/make/Make.config b/platform/broadcom/saibcm-modules/make/Make.config index b6f42bf65c48..01869634e295 100644 --- a/platform/broadcom/saibcm-modules/make/Make.config +++ b/platform/broadcom/saibcm-modules/make/Make.config @@ -120,7 +120,12 @@ ifndef SDKBUILD SDKBUILD :=build endif +ifdef SDK_OUTDIR +BLDROOT = ${SDK_OUTDIR}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix} +export DEST_DIR := ${SDK_OUTDIR}/${SDKBUILD}$(if ${BLDCONFIG},/${BLDCONFIG})$(DEST_DIR_SUFFIX) +else BLDROOT = ${SDK}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix} +endif endif # ifeq "$(HOSTTYPE)" "Windows2000PC" diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile index 3dc6425e6ee0..7a342f6ef60e 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile @@ -69,8 +69,12 @@ kernel-override=linux-$(platform) ifdef BLDCONFIG KERN_BLDROOT=${SDK}/${SDKBUILD}/${BLDCONFIG}/$(kernel-override)$(bldroot_suffix) else +ifdef SDK_OUTDIR +KERN_BLDROOT=${SDK_OUTDIR}/${SDKBUILD}/$(kernel-override)$(bldroot_suffix) +else KERN_BLDROOT=${SDK}/${SDKBUILD}/$(kernel-override)$(bldroot_suffix) endif +endif ifeq (,$(kernel_version)) kernel_version=2_4 From ced22db1e3870d363c3c330f111606ad6ff3f7ae Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 30 Mar 2022 14:43:51 +0800 Subject: [PATCH 062/119] [Build]: fix ENABLE_DOCKER_BASE_PULL not working issue in armhf/arm64 (#10330) Why I did it Fix ENABLE_DOCKER_BASE_PULL not working issue in armhf/arm64 For build in native armhf/arm64, the expected container registry repo name is sonic-slave- How I did it Publish the slave image to sonic-slave-. --- .azure-pipelines/docker-sonic-slave-arm64.yml | 1 + .azure-pipelines/docker-sonic-slave-armhf.yml | 1 + .azure-pipelines/docker-sonic-slave-template.yml | 15 +++++++++++++++ .azure-pipelines/docker-sonic-slave.yml | 1 + 4 files changed, 18 insertions(+) diff --git a/.azure-pipelines/docker-sonic-slave-arm64.yml b/.azure-pipelines/docker-sonic-slave-arm64.yml index 94c6143eed55..6bb9203b49ae 100644 --- a/.azure-pipelines/docker-sonic-slave-arm64.yml +++ b/.azure-pipelines/docker-sonic-slave-arm64.yml @@ -23,6 +23,7 @@ pr: - sonic-slave-stretch - sonic-slave-buster - sonic-slave-bullseye + - .azure-pipelines parameters: - name: 'dists' diff --git a/.azure-pipelines/docker-sonic-slave-armhf.yml b/.azure-pipelines/docker-sonic-slave-armhf.yml index ab0cefebf61f..250bf7400a69 100644 --- a/.azure-pipelines/docker-sonic-slave-armhf.yml +++ b/.azure-pipelines/docker-sonic-slave-armhf.yml @@ -23,6 +23,7 @@ pr: - sonic-slave-stretch - sonic-slave-buster - sonic-slave-bullseye + - .azure-pipelines parameters: - name: 'dists' diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 212b449abb18..7ba3592044c4 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -81,6 +81,10 @@ jobs: docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:latest docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:$SLAVE_BASE_TAG + if [ "$SLAVE_BASE_IMAGE_UPLOAD" != "$SLAVE_DIR" ]; then + docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_DIR:latest-${{ parameters.arch }} + docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_DIR:$SLAVE_BASE_TAG + fi set +x echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_IMAGE]$SLAVE_BASE_IMAGE_UPLOAD" echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_TAG]$SLAVE_BASE_TAG" @@ -89,6 +93,7 @@ jobs: displayName: Build sonic-slave-${{ parameters.dist }}-${{ parameters.arch }} - task: Docker@2 + condition: ne(variables['Build.Reason'], 'PullRequest') displayName: Upload image inputs: containerRegistry: ${{ parameters.registry_conn }} @@ -97,3 +102,13 @@ jobs: tags: | $(VARIABLE_SLAVE_BASE_TAG) latest + - ${{ if ne(parameters.arch, 'amd64') }}: + - task: Docker@2 + condition: ne(variables['Build.Reason'], 'PullRequest') + displayName: Upload image ${{ parameters.dist }} + inputs: + containerRegistry: ${{ parameters.registry_conn }} + repository: "sonic-slave-${{ parameters.dist }}" + command: push + tags: | + $(VARIABLE_SLAVE_BASE_TAG) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index a0b156bfde19..bf5fce77a722 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -24,6 +24,7 @@ pr: - sonic-slave-buster - sonic-slave-bullseye - src/sonic-build-hooks + - .azure-pipelines parameters: - name: 'arches' From 761ae244271d01f60bb6a4462888590066f78338 Mon Sep 17 00:00:00 2001 From: Lior Avramov <73036155+liorghub@users.noreply.github.com> Date: Wed, 30 Mar 2022 14:43:13 +0300 Subject: [PATCH 063/119] [submodule] Advance sonic-utilities submodule pointer (#10333) Update sonic-utilities submodule to include below commits: 510a9b9 Add date to show version (#2086) 61b1396 [sfpshow][recycle_port] sfpshow script needs to skip recycle ports (#2109) 4681697 Support command `show ip fib` and `show ipv6 fib` (#2100) 2a982a1 Update `config mirror_session` CLI to support heximal gre type value (#2095) b25f1e1 [generic-config-updater] Add caclrule validator (#2103) 968900c [sonic-package-manager] do not mod_config for whole config db when setting init_cfg (#2055) bf55ceb [nvgre] Added auto-generated CLI plugins and test for NVGRE Tunnel feature (#1915) 8389c81 [sonic-cli-gen] fix failure "Error: digits_class" when field "digit_class" does not exist in DB (#2054) f71ef64 Fix import statement in mclag.py (#2073) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index a2e68a05a8e6..8389c8137d4f 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit a2e68a05a8e6ab296978a59bf107971beb899546 +Subproject commit 8389c8137d4fdc5a2d1c803c9c06e6dcb4f849c1 From 1e2e493daa642bff3472953669d0d08ffb3190a4 Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Wed, 30 Mar 2022 20:41:31 +0300 Subject: [PATCH 064/119] [Mellanox] Credo Y-cable read_eeprom/write_eeprom API implementation (#10320) - Why I did it Implement read_eeprom/write_eeprom API for Credo Y-cable for Dual ToR Active-Standby - How I did it Use mlxreg utility for API implementation Signed-off-by: Andriy Yurkiv --- .../mlnx-platform-api/sonic_platform/sfp.py | 164 +++++++++++++++++- .../tests/input_platform/__init__.py | 0 .../tests/input_platform/output_sfp.py | 55 ++++++ .../mlnx-platform-api/tests/test_sfp.py | 29 ++++ 4 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 platform/mellanox/mlnx-platform-api/tests/input_platform/__init__.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/input_platform/output_sfp.py diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 29d1c7c081f6..7ebe9d5e5e57 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -121,6 +121,13 @@ # parameters for SFP presence SFP_STATUS_INSERTED = '1' +# SFP constants +SFP_PAGE_SIZE = 256 +SFP_UPPER_PAGE_OFFSET = 128 +SFP_VENDOR_PAGE_START = 640 + +BYTES_IN_DWORD = 4 + # Global logger class instance logger = Logger() @@ -146,6 +153,72 @@ def deinitialize_sdk_handle(sdk_handle): logger.log_warning("Sdk handle is none") return False +class MlxregManager: + def __init__(self, mst_pci_device, slot_id, sdk_index): + self.mst_pci_device = mst_pci_device + self.slot_id = slot_id + self.sdk_index = sdk_index + + def construct_dword(self, write_buffer): + if len(write_buffer) == 0: + return None + + used_bytes_in_dword = len(write_buffer) % BYTES_IN_DWORD + + res = "dword[0]=0x" + for idx, x in enumerate(write_buffer): + word = hex(x)[2:] + + if (idx > 0) and (idx % BYTES_IN_DWORD) == 0: + res += ",dword[{}]=0x".format(str((idx + 1)//BYTES_IN_DWORD)) + res += word.zfill(2) + + if used_bytes_in_dword > 0: + res += (BYTES_IN_DWORD - used_bytes_in_dword) * "00" + return res + + def write_mlxreg_eeprom(self, num_bytes, dword, device_address, page): + if not dword: + return False + + try: + cmd = "mlxreg -d /dev/mst/{} --reg_name MCIA --indexes \ + slot_index={},module={},device_address={},page_number={},i2c_device_address=0x50,size={},bank_number=0 \ + --set {} -y".format(self.mst_pci_device, self.slot_id, self.sdk_index, device_address, page, num_bytes, dword) + subprocess.check_call(cmd, shell=True, universal_newlines=True, stdout=subprocess.DEVNULL) + except subprocess.CalledProcessError as e: + logger.log_error("Error! Unable to write data for {} port, page {} offset {}, rc = {}, err msg: {}".format(self.sdk_index, page, device_address, e.returncode, e.output)) + return False + return True + + def read_mlxred_eeprom(self, offset, page, num_bytes): + try: + cmd = "mlxreg -d /dev/mst/{} --reg_name MCIA --indexes \ + slot_index={},module={},device_address={},page_number={},i2c_device_address=0x50,size={},bank_number=0 \ + --get".format(self.mst_pci_device, self.slot_id, self.sdk_index, offset, page, num_bytes) + result = subprocess.check_output(cmd, universal_newlines=True, shell=True) + except subprocess.CalledProcessError as e: + logger.log_error("Error! Unable to write data for {} port, page {} offset {}, rc = {}, err msg: {}".format(self.sdk_index, page, device_address, e.returncode, e.output)) + return None + return result + + def parse_mlxreg_read_output(self, read_output, num_bytes): + res = "" + dword_num = num_bytes // BYTES_IN_DWORD + used_bytes_in_dword = num_bytes % BYTES_IN_DWORD + arr = [value for value in read_output.split('\n') if value[0:5] == "dword"] + for i in range(dword_num): + dword = arr[i].split()[2] + res += dword[2:] + + if used_bytes_in_dword > 0: + # Cut needed info and insert into final hex string + # Example: 3 bytes : 0x12345600 + # ^ ^ + dword = arr[dword_num].split()[2] + res += dword[2 : 2 + used_bytes_in_dword * 2] + + return bytearray.fromhex(res) if res else None class SdkHandleContext(object): def __init__(self): @@ -194,6 +267,16 @@ def __init__(self, sfp_index, slot_id=0, linecard_port_count=0, lc_name=None): self._thermal_list = initialize_linecard_sfp_thermal(lc_name, slot_id, sfp_index) self.slot_id = slot_id + self.mst_pci_device = self.get_mst_pci_device() + + # get MST PCI device name + def get_mst_pci_device(self): + device_name = None + try: + device_name = subprocess.check_output("ls /dev/mst/ | grep pciconf", universal_newlines=True, shell=True).strip() + except subprocess.CalledProcessError as e: + logger.log_error("Failed to find mst PCI device rc={} err.msg={}".format(e.returncode, e.output)) + return device_name @property def sdk_handle(self): @@ -222,7 +305,11 @@ def get_presence(self): return eeprom_raw is not None # Read out any bytes from any offset - def read_eeprom(self, offset, num_bytes): + def _read_eeprom_specific_bytes(self, offset, num_bytes): + if offset + num_bytes > SFP_VENDOR_PAGE_START: + logger.log_error("Error mismatch between page size and bytes to read (offset: {} num_bytes: {}) ".format(offset, num_bytes)) + return None + eeprom_raw = [] ethtool_cmd = "ethtool -m sfp{} hex on offset {} length {}".format(self.index, offset, num_bytes) try: @@ -241,6 +328,81 @@ def read_eeprom(self, offset, num_bytes): eeprom_raw = list(map(lambda h: int(h, base=16), eeprom_raw)) return bytearray(eeprom_raw) + # read eeprom specfic bytes beginning from offset with size as num_bytes + def read_eeprom(self, offset, num_bytes): + """ + Read eeprom specfic bytes beginning from a random offset with size as num_bytes + Returns: + bytearray, if raw sequence of bytes are read correctly from the offset of size num_bytes + None, if the read_eeprom fails + Example: + mlxreg -d /dev/mst/mt52100_pciconf0 --reg_name MCIA --indexes slot_index=0,module=1,device_address=148,page_number=0,i2c_device_address=0x50,size=16,bank_number=0 -g + Sending access register... + Field Name | Data + =================================== + status | 0x00000000 + slot_index | 0x00000000 + module | 0x00000001 + l | 0x00000000 + device_address | 0x00000094 + page_number | 0x00000000 + i2c_device_address | 0x00000050 + size | 0x00000010 + bank_number | 0x00000000 + dword[0] | 0x43726564 + dword[1] | 0x6f202020 + dword[2] | 0x20202020 + dword[3] | 0x20202020 + dword[4] | 0x00000000 + dword[5] | 0x00000000 + .... + 16 bytes to read from dword -> 0x437265646f2020202020202020202020 -> Credo + """ + # recalculate offset and page. Use 'ethtool' if there is no need to read vendor pages + if offset < SFP_VENDOR_PAGE_START: + return self._read_eeprom_specific_bytes(offset, num_bytes) + else: + page = (offset - SFP_PAGE_SIZE) // SFP_UPPER_PAGE_OFFSET + 1 + # calculate offset per page + device_address = (offset - SFP_PAGE_SIZE) % SFP_UPPER_PAGE_OFFSET + SFP_UPPER_PAGE_OFFSET + + if not self.mst_pci_device: + return None + + mlxreg_mngr = MlxregManager(self.mst_pci_device, self.slot_id, self.sdk_index) + read_output = mlxreg_mngr.read_mlxred_eeprom(device_address, page, num_bytes) + return mlxreg_mngr.parse_mlxreg_read_output(read_output, num_bytes) + + # write eeprom specfic bytes beginning from offset with size as num_bytes + def write_eeprom(self, offset, num_bytes, write_buffer): + """ + write eeprom specfic bytes beginning from a random offset with size as num_bytes + and write_buffer as the required bytes + Returns: + Boolean, true if the write succeeded and false if it did not succeed. + Example: + mlxreg -d /dev/mst/mt52100_pciconf0 --reg_name MCIA --indexes slot_index=0,module=1,device_address=154,page_number=5,i2c_device_address=0x50,size=1,bank_number=0 --set dword[0]=0x01000000 -y + """ + if num_bytes != len(write_buffer): + logger.log_error("Error mismatch between buffer length and number of bytes to be written") + return False + + # recalculate offset and page + if offset < SFP_PAGE_SIZE: + page = 0 + device_address = offset + else: + page = (offset - SFP_PAGE_SIZE) // SFP_UPPER_PAGE_OFFSET + 1 + # calculate offset per page + device_address = (offset - SFP_PAGE_SIZE) % SFP_UPPER_PAGE_OFFSET + SFP_UPPER_PAGE_OFFSET + + if not self.mst_pci_device: + return False + + mlxreg_mngr = MlxregManager(self.mst_pci_device, self.slot_id, self.sdk_index) + dword = mlxreg_mngr.construct_dword(write_buffer) + return mlxreg_mngr.write_mlxreg_eeprom(num_bytes, dword, device_address, page) + @classmethod def mgmt_phy_mod_pwr_attr_get(cls, power_attr_type, sdk_handle, sdk_index, slot_id): sx_mgmt_phy_mod_pwr_attr_p = new_sx_mgmt_phy_mod_pwr_attr_t_p() diff --git a/platform/mellanox/mlnx-platform-api/tests/input_platform/__init__.py b/platform/mellanox/mlnx-platform-api/tests/input_platform/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/mellanox/mlnx-platform-api/tests/input_platform/output_sfp.py b/platform/mellanox/mlnx-platform-api/tests/input_platform/output_sfp.py new file mode 100644 index 000000000000..20a09d1b54f6 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/input_platform/output_sfp.py @@ -0,0 +1,55 @@ +""" +module holding the correct values for the sfp_test.py +""" + +read_eeprom_output = """ +Sending access register... +Field Name | Data +=================================== +status | 0x00000000 +slot_index | 0x00000000 +module | 0x00000001 +l | 0x00000000 +device_address | 0x000000a8 +page_number | 0x00000000 +i2c_device_address | 0x00000050 +size | 0x00000010 +bank_number | 0x00000000 +dword[0] | 0x43414331 +dword[1] | 0x31353332 +dword[2] | 0x31503250 +dword[3] | 0x41324d53 +dword[4] | 0x00000000 +dword[5] | 0x00000000 +dword[6] | 0x00000000 +dword[7] | 0x00000000 +dword[8] | 0x00000000 +dword[9] | 0x00000000 +dword[10] | 0x00000000 +dword[11] | 0x00000000 +dword[12] | 0x00000000 +dword[13] | 0x00000000 +dword[14] | 0x00000000 +dword[15] | 0x00000000 +dword[16] | 0x00000000 +dword[17] | 0x00000000 +dword[18] | 0x00000000 +dword[19] | 0x00000000 +dword[20] | 0x00000000 +dword[21] | 0x00000000 +dword[22] | 0x00000000 +dword[23] | 0x00000000 +dword[24] | 0x00000000 +dword[25] | 0x00000000 +dword[26] | 0x00000000 +dword[27] | 0x00000000 +dword[28] | 0x00000000 +dword[29] | 0x00000000 +dword[30] | 0x00000000 +dword[31] | 0x00000000 +=================================== +""" + +y_cable_part_number = "CAC115321P2PA2MS" +write_eeprom_dword1 = "dword[0]=0x01020304" +write_eeprom_dword2 = "dword[0]=0x01020304,dword[1]=0x05060000" diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 261a03b527aa..dcb3953ded88 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -27,6 +27,9 @@ from sonic_platform.sfp import SFP, SX_PORT_MODULE_STATUS_INITIALIZING, SX_PORT_MODULE_STATUS_PLUGGED, SX_PORT_MODULE_STATUS_UNPLUGGED, SX_PORT_MODULE_STATUS_PLUGGED_WITH_ERROR, SX_PORT_MODULE_STATUS_PLUGGED_DISABLED from sonic_platform.chassis import Chassis +from sonic_platform.sfp import MlxregManager +from tests.input_platform import output_sfp + class TestSfp: @mock.patch('sonic_platform.device_data.DeviceDataManager.get_linecard_count', mock.MagicMock(return_value=8)) @@ -80,3 +83,29 @@ def test_sfp_get_error_status(self, mock_get_error_code): description = sfp.get_error_description() assert description == expected_description + + @mock.patch('sonic_platform.sfp.SFP.get_mst_pci_device', mock.MagicMock(return_value="pciconf")) + @mock.patch('sonic_platform.sfp.MlxregManager.write_mlxreg_eeprom', mock.MagicMock(return_value=True)) + def test_sfp_write_eeprom(self): + mlxreg_mngr = MlxregManager("", 0, 0) + write_buffer = bytearray([1,2,3,4]) + offset = 793 + + sfp = SFP(0) + sfp.write_eeprom(offset, 4, write_buffer) + MlxregManager.write_mlxreg_eeprom.assert_called_with(4, output_sfp.write_eeprom_dword1, 153, 5) + + offset = 641 + write_buffer = bytearray([1,2,3,4,5,6]) + sfp.write_eeprom(offset, 6, write_buffer) + MlxregManager.write_mlxreg_eeprom.assert_called_with(6, output_sfp.write_eeprom_dword2, 129, 4) + + @mock.patch('sonic_platform.sfp.SFP.get_mst_pci_device', mock.MagicMock(return_value="pciconf")) + @mock.patch('sonic_platform.sfp.MlxregManager.read_mlxred_eeprom', mock.MagicMock(return_value=output_sfp.read_eeprom_output)) + def test_sfp_read_eeprom(self): + mlxreg_mngr = MlxregManager("", 0, 0) + offset = 644 + + sfp = SFP(0) + assert output_sfp.y_cable_part_number == sfp.read_eeprom(offset, 16).decode() + MlxregManager.read_mlxred_eeprom.assert_called_with(132, 4, 16) From b31df59c7c42a440a22d1b1e8d1bdda8d08e7a40 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 30 Mar 2022 14:03:29 -0700 Subject: [PATCH 065/119] [tun_pkt]: Wait for AsyncSniffer to init fully (#10346) Fix for Tunnel packet handler can crash at system startup Signed-off-by: Lawrence Lee --- .../docker-orchagent/tunnel_packet_handler.py | 86 ++++++++++--------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/dockers/docker-orchagent/tunnel_packet_handler.py b/dockers/docker-orchagent/tunnel_packet_handler.py index 3d9b48b450b6..682316eb6d49 100755 --- a/dockers/docker-orchagent/tunnel_packet_handler.py +++ b/dockers/docker-orchagent/tunnel_packet_handler.py @@ -51,6 +51,10 @@ def __init__(self): 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): @@ -270,6 +274,39 @@ def sniffer_restart_required(self, messages): 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 @@ -277,59 +314,28 @@ def listen_for_tunnel_pkts(self): These packets may be trapped if there is no neighbor info for the inner packet destination IP in the hardware. """ - - def _ping_inner_dst(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_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) - - self_ip, peer_ip = self.get_ipinip_tunnel_addrs() - if self_ip is None or peer_ip is None: + 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 - packet_filter = 'host {} and host {}'.format(self_ip, peer_ip) + self.packet_filter = 'host {} and host {}'.format(self.self_ip, peer_ip) logger.log_notice('Starting tunnel packet handler for {}' - .format(packet_filter)) + .format(self.packet_filter)) - sniff_intfs = self.get_up_portchannels() - logger.log_info("Listening on interfaces {}".format(sniff_intfs)) + self.sniff_intfs = self.get_up_portchannels() + logger.log_info("Listening on interfaces {}".format(self.sniff_intfs)) - sniffer = AsyncSniffer( - iface=sniff_intfs, - filter=packet_filter, - prn=_ping_inner_dst, - store=0 - ) - sniffer.start() + self.start_sniffer() while True: msgs = self.wait_for_netlink_msgs() if self.sniffer_restart_required(msgs): - sniffer.stop() + self.sniffer.stop() sniff_intfs = self.get_up_portchannels() logger.log_notice('Restarting tunnel packet handler on ' 'interfaces {}'.format(sniff_intfs)) - sniffer = AsyncSniffer( - iface=sniff_intfs, - filter=packet_filter, - prn=_ping_inner_dst, - store=0 - ) - sniffer.start() + self.start_sniffer() def run(self): """ From 16766c0ea4aff78bb8b749d31e6a2135386681f4 Mon Sep 17 00:00:00 2001 From: Longxiang Lyu <35479537+lolyu@users.noreply.github.com> Date: Thu, 31 Mar 2022 08:24:13 +0800 Subject: [PATCH 066/119] [YANG ] Support vlan sub intf short naming format (#10160) Why I did it To support vlan sub intf short naming format, like subport Eth8.100 for parent portEthernet8 with vlan id 100. How I did it Add checks to must condition to verify there is a port or portchannel with the index same as the vlan sub intf. How to verify it Run the unttests. --- .../tests/files/sample_config_db.json | 16 +- .../tests/vlan_sub_interface.json | 18 ++ .../tests_config/vlan_sub_interface.json | 214 ++++++++++++++++++ .../yang-models/sonic-vlan-sub-interface.yang | 12 +- 4 files changed, 255 insertions(+), 5 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 6415fb6100e9..d33cf20e2038 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -900,11 +900,21 @@ } }, "VLAN_SUB_INTERFACE": { - "Ethernet120.10": { + "Ethernet12.10": { "admin_status": "up" }, - "Ethernet120.10|10.0.1.56/31": {}, - "Ethernet120.10|fc00::1:71/126": {} + "Ethernet12.10|10.0.1.56/31": {}, + "Ethernet12.10|fc00::1:71/126": {}, + "Po0003.10": { + "admin_status": "up" + }, + "Po0003.10|10.0.1.58/31": {}, + "Po0003.10|fc00::1:75/126": {}, + "Eth120.10": { + "admin_status": "up" + }, + "Eth120.10|10.0.1.60/31": {}, + "Eth120.10|fc00::1:79/126": {} }, "VLAN_MEMBER": { "Vlan111|Ethernet0": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json b/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json index 789b7ddd364a..e3ffa9dc44b6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/vlan_sub_interface.json @@ -2,10 +2,28 @@ "VLAN_SUB_INTERFACE_MUST_CONDITION_TRUE_TEST": { "desc": "Configure valid vlan sub interface must condition true." }, + "VLAN_SUB_INTERFACE_SHORT_NAME_FORMAT_MUST_CONDITION_TRUE_TEST": { + "desc": "Configure valid short name format vlan sub interface must condition true." + }, "VLAN_SUB_INTERFACE_MUST_CONDITION_FALSE_TEST": { "desc": "Configure vlan sub interface must condition false.", "eStrKey": "Must" }, + "VLAN_SUB_INTERFACE_SHORT_NAME_FORMAT_MUST_CONDITION_FALSE_TEST": { + "desc": "Configure short name format vlan sub interface must condition false.", + "eStrKey": "Must" + }, + "VLAN_SUB_INTERFACE_PO_SHORT_NAME_FORMAT_MUST_CONDITION_TRUE_TEST": { + "desc": "Configure valid portchannel short name format vlan sub interface must condition true." + }, + "VLAN_SUB_INTERFACE_PO_MUST_CONDITION_FALSE_TEST": { + "desc": "Configure portchannel long name format vlan sub interface must condition false.", + "eStrKey": "Must" + }, + "VLAN_SUB_INTERFACE_PO_SHORT_NAME_FORMAT_MUST_CONDITION_FALSE_TEST": { + "desc": "Configure portchannel short name format vlan sub interface must condition false.", + "eStrKey": "Must" + }, "VLAN_SUB_INTERFACE_IP_PREFIX_PORT_NON_EXISTING_LEAF_TEST": { "desc": "Configure ip prefix vlan sub interface with non-existing reference.", "eStrKey": "LeafRef" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json index f95b1af8f049..8adff73e497c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan_sub_interface.json @@ -31,6 +31,38 @@ } } }, + "VLAN_SUB_INTERFACE_SHORT_NAME_FORMAT_MUST_CONDITION_TRUE_TEST": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "Eth8.10" + } + ], + "VLAN_SUB_INTERFACE_IPPREFIX_LIST": [ + { + "name": "Eth8.10", + "ip-prefix": "10.0.0.1/30" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "admin_status": "up", + "alias": "Ethernet8/1", + "description": "Ethernet8", + "lanes": "45,46,47,48", + "mtu": 9000, + "speed": 100000 + } + ] + } + } + }, "VLAN_SUB_INTERFACE_MUST_CONDITION_FALSE_TEST": { "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { @@ -63,6 +95,188 @@ } } }, + "VLAN_SUB_INTERFACE_SHORT_NAME_FORMAT_MUST_CONDITION_FALSE_TEST": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "Eth8.10" + } + ], + "VLAN_SUB_INTERFACE_IPPREFIX_LIST": [ + { + "name": "Eth8.10", + "ip-prefix": "10.0.0.1/30" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet12", + "admin_status": "up", + "alias": "Ethernet12/1", + "description": "Ethernet12", + "lanes": "49,50,51,52", + "mtu": 9000, + "speed": 100000 + } + ] + } + } + }, + "VLAN_SUB_INTERFACE_PO_SHORT_NAME_FORMAT_MUST_CONDITION_TRUE_TEST": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "Po0001.10" + } + ], + "VLAN_SUB_INTERFACE_IPPREFIX_LIST": [ + { + "name": "Po0001.10", + "ip-prefix": "10.0.0.1/30" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": 9000, + "name": "Ethernet0", + "tpid": "0x8100", + "speed": 25000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "admin_status": "up", + "members": [ + "Ethernet0" + ], + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100", + "lacp_key": "auto", + "name": "PortChannel0001" + } + ] + } + } + }, + "VLAN_SUB_INTERFACE_PO_MUST_CONDITION_FALSE_TEST": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "PortChannel0001.10" + } + ], + "VLAN_SUB_INTERFACE_IPPREFIX_LIST": [ + { + "name": "PortChannel0001.10", + "ip-prefix": "10.0.0.1/30" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": 9000, + "name": "Ethernet0", + "tpid": "0x8100", + "speed": 25000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "admin_status": "up", + "members": [ + "Ethernet0" + ], + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100", + "lacp_key": "auto", + "name": "PortChannel0001" + } + ] + } + } + }, + "VLAN_SUB_INTERFACE_PO_SHORT_NAME_FORMAT_MUST_CONDITION_FALSE_TEST": { + "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { + "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { + "VLAN_SUB_INTERFACE_LIST": [ + { + "name": "Po0002.10" + } + ], + "VLAN_SUB_INTERFACE_IPPREFIX_LIST": [ + { + "name": "Po0002.10", + "ip-prefix": "10.0.0.1/30" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": 9000, + "name": "Ethernet0", + "tpid": "0x8100", + "speed": 25000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "admin_status": "up", + "members": [ + "Ethernet0" + ], + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100", + "lacp_key": "auto", + "name": "PortChannel0001" + } + ] + } + } + }, "VLAN_SUB_INTERFACE_IP_PREFIX_PORT_NON_EXISTING_LEAF_TEST": { "sonic-vlan-sub-interface:sonic-vlan-sub-interface": { "sonic-vlan-sub-interface:VLAN_SUB_INTERFACE": { diff --git a/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang b/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang index 6ce391033ab0..953aa7e14c80 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan-sub-interface.yang @@ -14,6 +14,10 @@ module sonic-vlan-sub-interface { prefix port; } + import sonic-portchannel { + prefix lag; + } + import sonic-vrf { prefix vrf; } @@ -36,9 +40,13 @@ module sonic-vlan-sub-interface { key "name"; leaf name { - must "substring-before(current(), '.') = /port:sonic-port/port:PORT/port:PORT_LIST/port:name" + must "(substring-before(current(), '.') = /port:sonic-port/port:PORT/port:PORT_LIST/port:name) or " + + "(starts-with(substring-before(current(), '.'), 'Eth') and " + + "concat('Ethernet', substring-after(substring-before(current(), '.'), 'Eth')) = /port:sonic-port/port:PORT/port:PORT_LIST/port:name) or " + + "(starts-with(substring-before(current(), '.'), 'Po') and " + + "concat('PortChannel', substring-after(substring-before(current(), '.'), 'Po')) = /lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name)" { - error-message "Must condition not satisfied, Try adding PORT: {}, Example: 'Ethernet0': {}"; + error-message "Must condition not satisfied, please follow vlan sub interface naming convention"; } // check if the vlan sub interface have the form as . From 47f4a9d90557e91a98a45976d52966932d6ac14e Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Thu, 31 Mar 2022 12:37:53 +0800 Subject: [PATCH 067/119] [build][Bug]: Fix the command set_reproducible_mirrors not found issue (#10398) Why I did it Fix the command set_reproducible_mirrors not found issue during the build. --- scripts/prepare_slave_container_buildinfo.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/prepare_slave_container_buildinfo.sh b/scripts/prepare_slave_container_buildinfo.sh index 5d306a0e1c20..1fb2f006640b 100755 --- a/scripts/prepare_slave_container_buildinfo.sh +++ b/scripts/prepare_slave_container_buildinfo.sh @@ -10,14 +10,14 @@ sudo dpkg -i --force-overwrite $SLAVE_DIR/buildinfo/sonic-build-hooks_*.deb > /d # Enable the build hooks symlink_build_hooks -# Enable reproducible mirrors -set_reproducible_mirrors -apt-get update > /dev/null 2>&1 - # Build the slave running config 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" From d8b80d2317983bf46d4dd877049e39d4b503762f Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 31 Mar 2022 12:40:19 +0800 Subject: [PATCH 068/119] [ci] Use template from master branch in UpgrateVersion/sonic-slave pipeline (#10380) --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 10 +++++++++- .azure-pipelines/docker-sonic-slave-template.yml | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 4f1625b297a9..06ef505f0d5d 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -18,6 +18,14 @@ schedules: - 202006 always: true +resources: + repositories: + - repository: buildimage + type: github + name: Azure/sonic-buildimage + ref: master + endpoint: build + pool: sonicbld parameters: @@ -45,7 +53,7 @@ stages: jobFilters: ${{ parameters.jobFilters }} buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y' preSteps: - - template: template-clean-sonic-slave.yml + - template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage - stage: UpgradeVersions jobs: - job: UpgradeVersions diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 7ba3592044c4..40a937a8c89a 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -3,6 +3,13 @@ # 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: Azure/sonic-buildimage + ref: master + endpoint: build parameters: - name: arch @@ -38,7 +45,7 @@ jobs: pool: ${{ parameters.pool }} steps: - template: cleanup.yml - - template: template-clean-sonic-slave.yml + - template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage - checkout: self clean: true submodules: recursive From 8f01c7fba6c0308a7ef9e34ca3b6ac5754ead7a2 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 31 Mar 2022 13:07:46 +0800 Subject: [PATCH 069/119] [build] Fix issues found in reproducible build. (#10407) --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 2 +- scripts/docker_version_control.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 06ef505f0d5d..03593c551cff 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -51,7 +51,7 @@ stages: - template: azure-pipelines-build.yml parameters: jobFilters: ${{ parameters.jobFilters }} - buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y' + 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 - stage: UpgradeVersions diff --git a/scripts/docker_version_control.sh b/scripts/docker_version_control.sh index da8cd0484f49..e94370d0e2d9 100755 --- a/scripts/docker_version_control.sh +++ b/scripts/docker_version_control.sh @@ -23,7 +23,7 @@ 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" != multiarch/debian-debootstrap:* ]];then + if [[ "$image_tag" != */debian:* ]] && [[ "$image_tag" != debian:* ]] && [[ "$image_tag" != multiarch/debian-debootstrap:* ]];then exit 0 fi if [ -f $version_file ];then @@ -40,7 +40,7 @@ if [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,all,* ]] || [[ ",$SONIC_VERSION 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 + if [ -z "$hash_value" ];then hash_value=unknown fi fi From c03bf075f79929c6688bebdb4d15034e12c77351 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 31 Mar 2022 13:14:55 +0800 Subject: [PATCH 070/119] [ci] Add azure pipeline to build common libs. (#10367) Why I did it To remove reference on Azure.sonic-buildimage artifacts. Azure.sonic-buildimage has a higher failure rate. --- .azure-pipelines/build-commonlib.yml | 19 ++++++++++++++ .azure-pipelines/template-commonlib.yml | 34 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .azure-pipelines/build-commonlib.yml create mode 100644 .azure-pipelines/template-commonlib.yml diff --git a/.azure-pipelines/build-commonlib.yml b/.azure-pipelines/build-commonlib.yml new file mode 100644 index 000000000000..df9bcb25ae70 --- /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: Azure/sonic-buildimage + ref: master + endpoint: build + +jobs: +- template: .azure-pipelines/template-commonlib.yml@buildimage diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml new file mode 100644 index 000000000000..0e42cb4e17ac --- /dev/null +++ b/.azure-pipelines/template-commonlib.yml @@ -0,0 +1,34 @@ +jobs: +- job: Build + timeoutInMinutes: 120 + pool: sonicbld + steps: + - checkout: self + clean: true + submodules: recursive + - script: | + set -ex + case $(Build.SourceBranchName) in + 202012 | 202106) + bldenv=buster + ;; + *) + bldenv=bullseye + ;; + esac + BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y + echo "##vso[task.setvariable variable=bldenv;]$bldenv" + displayName: Make configure + - script: | + set -ex + LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}') + LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/") + BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y + + LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}') + LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/") + BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libyang_${LIBYANG_VERSION}_amd64.deb + find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory) + displayName: Make common lib packages + - publish: $(Build.ArtifactStagingDirectory) + artifact: common-lib From 85539e7e0852cac76497de43c4add3e3c5856904 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 31 Mar 2022 13:21:09 +0800 Subject: [PATCH 071/119] [Mellanox] Update hw-mgmt package to version V.7.0020.2004 (#10401) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Why I did it Take new hw-mgmt release to SONiC, including: New features: 1. hw-mgmt: add to PSU FW upgrade tool command to show current FW version 2. hw-mgmt: add to PSU FW upgrade tool support for single-PSU-in-the-system FW upgrade 3. hw-mgmt: add attribute “/firmware” to show FW version of restricted upgradable PSUs only 4. hw-mgmt: Add NVME temperature reports attributes (_alarm/_crit/_min/_max) Bug fix: 1. psu: redundant i2c_addr attributes being created for psu 3 & 4 in system having only 2 psus. 2. hw-mgmt: in SPC1/2 i2c driver removal is too slow vs. ASIC reset causing non-functional log errors 3. PSU thresholds sysfs changed in 5.10 to “read only” preventing modification (modification required due PSU HW bug) 4. CPLD3 sysfs attribute missing after chip down/up flow 5. sysfs attributes missing when hw-mgmt is restarted (stop/start) within systemd Release notes can be found from link https://github.com/Mellanox/hw-mgmt/blob/V.7.0020.2004/debian/Release.txt - How I did it Update hw-mgmt make file with new version number Update hw-mgmt submodule pointer - How to verify it Run platform regression on all Mellanox platform Signed-off-by: Kebo Liu --- platform/mellanox/hw-management.mk | 2 +- ...03-Remove-unused-non-upstream-kernel-modules-from-load.patch | 2 +- platform/mellanox/hw-management/hw-mgmt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 1f2a08b32d4d..fac7bddc2c24 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -16,7 +16,7 @@ # # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0020.1300 +MLNX_HW_MANAGEMENT_VERSION = 7.0020.2004 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch b/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch index fb114224494b..496085e9d4d8 100644 --- a/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch +++ b/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch @@ -16,7 +16,7 @@ index 39f621e..c0980bc 100644 mp2888 i2c-mux-pca954x -emc2305 --ads1015 +-ti-ads1015 powr1220 gpio-pca953x pmbus diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index cd4e3f7bdc9f..ec2e9173e9f2 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit cd4e3f7bdc9fe77f0dc78b405e52fe876f7ca490 +Subproject commit ec2e9173e9f24cbc02eb87d81889d408528e090b From 6e51779efbb4d1bd8103f167fdb760b03fe2a1a9 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Thu, 31 Mar 2022 15:29:23 +0800 Subject: [PATCH 072/119] [sonic-cfggen] Fix invalid switch_type (#10383) Why I did it sonic-config-engine unit test is using invalid switch_type How I did it Update xml with correct switch_type How to verify it Run UT for sonic-config-engine Signed-off-by: Gang Lv ganglv@microsoft.com --- .../tests/sample-chassis-packet-lc-graph.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml b/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml index 183c578385f0..ac83d87b96ca 100644 --- a/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml +++ b/src/sonic-config-engine/tests/sample-chassis-packet-lc-graph.xml @@ -394,7 +394,7 @@ SwitchType - chassis_packet + chassis-packet DeploymentId @@ -459,7 +459,7 @@ SwitchType - chassis_packet + chassis-packet From 271ef69e60752a9fa22c2bbbc8173a3c70d22363 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Thu, 31 Mar 2022 17:33:43 +0800 Subject: [PATCH 073/119] Add j2 template for enable pam_limit and limit SSH session (#10177) #### Why I did it When too many user login concurrently and run commands, SONiC may kernel panic on some device which has very limited memory. #### How I did it Add j2 template for setup pam_limit plugin for limit SSH session per-user. #### How to verify it Manually validate the j2 template can generate correct config file. #### Which release branch to backport (provide reason below if selected) - [x] 201811 - [ ] 201911 - [ ] 202006 - [x] 202012 - [x] 202106 - [x] 202111 #### Description for the changelog Add j2 template for setup pam_limit plugin for limit SSH session per-user. #### A picture of a cute animal (not mandatory but encouraged) --- .../templates/limits.conf.j2 | 69 +++++++++++++++++++ .../templates/pam_limits.j2 | 12 ++++ src/sonic-host-services/scripts/hostcfgd | 65 +++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100755 src/sonic-host-services-data/templates/limits.conf.j2 create mode 100755 src/sonic-host-services-data/templates/pam_limits.j2 diff --git a/src/sonic-host-services-data/templates/limits.conf.j2 b/src/sonic-host-services-data/templates/limits.conf.j2 new file mode 100755 index 000000000000..41b37221e41e --- /dev/null +++ b/src/sonic-host-services-data/templates/limits.conf.j2 @@ -0,0 +1,69 @@ +# /etc/security/limits.conf +# +# This file generate by j2 template file: src/sonic-host-services-data/templates/limits.conf.j2 +# +# Each line describes a limit for a user in the form: +# +# +# +# Where: +# can be: +# - a user name +# - a group name, with @group syntax +# - the wildcard *, for default entry +# - the wildcard %, can be also used with %group syntax, +# for maxlogin limit +# - NOTE: group and wildcard limits are not applied to root. +# To apply a limit to the root user, must be +# the literal username root. +# +# can have the two values: +# - "soft" for enforcing the soft limits +# - "hard" for enforcing hard limits +# +# can be one of the following: +# - core - limits the core file size (KB) +# - data - max data size (KB) +# - fsize - maximum filesize (KB) +# - memlock - max locked-in-memory address space (KB) +# - nofile - max number of open file descriptors +# - rss - max resident set size (KB) +# - stack - max stack size (KB) +# - cpu - max CPU time (MIN) +# - nproc - max number of processes +# - as - address space limit (KB) +# - maxlogins - max number of logins for this user +# - maxsyslogins - max number of logins on the system +# - priority - the priority to run user process with +# - locks - max number of file locks the user can hold +# - sigpending - max number of pending signals +# - msgqueue - max memory used by POSIX message queues (bytes) +# - nice - max nice priority allowed to raise to values: [-20, 19] +# - rtprio - max realtime priority +# - chroot - change root to directory (Debian-specific) +# +# +# is related with : +# All items support the values -1, unlimited or infinity indicating +# no limit, except for priority and nice. +# +# If a hard limit or soft limit of a resource is set to a valid value, +# but outside of the supported range of the local system, the system +# may reject the new limit or unexpected behavior may occur. If the +# control value required is used, the module will reject the login if +# a limit could not be set. +# +# +# + +# * soft core 0 +# root hard core 100000 +# * hard rss 10000 +# @student hard nproc 20 +# @faculty soft nproc 20 +# @faculty hard nproc 50 +# ftp hard nproc 0 +# ftp - chroot /ftp +# @student - maxlogins 4 + +# End of file diff --git a/src/sonic-host-services-data/templates/pam_limits.j2 b/src/sonic-host-services-data/templates/pam_limits.j2 new file mode 100755 index 000000000000..f87906932fb7 --- /dev/null +++ b/src/sonic-host-services-data/templates/pam_limits.j2 @@ -0,0 +1,12 @@ +#THIS IS AN AUTO-GENERATED FILE +# +# This file generate by j2 template file: src/sonic-host-services-data/templates/pam_limits.j2 +# +# /etc/pam.d/pam-limits settings common to all services +# This file is included from other service-specific PAM config files, +# and should contain a list of the authentication modules that define +# the central authentication scheme for use on the system +# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the +# traditional Unix authentication mechanisms. +# +# here are the per-package modules (the "Primary" block) \ No newline at end of file diff --git a/src/sonic-host-services/scripts/hostcfgd b/src/sonic-host-services/scripts/hostcfgd index be8317259e38..5b6693fbcdf7 100755 --- a/src/sonic-host-services/scripts/hostcfgd +++ b/src/sonic-host-services/scripts/hostcfgd @@ -25,6 +25,10 @@ PAM_RADIUS_AUTH_CONF_TEMPLATE = "/usr/share/sonic/templates/pam_radius_auth.conf NSS_CONF = "/etc/nsswitch.conf" ETC_PAMD_SSHD = "/etc/pam.d/sshd" ETC_PAMD_LOGIN = "/etc/pam.d/login" +PAM_LIMITS_CONF_TEMPLATE = "/usr/share/sonic/templates/pam_limits.j2" +LIMITS_CONF_TEMPLATE = "/usr/share/sonic/templates/limits.conf.j2" +PAM_LIMITS_CONF = "/etc/pam.d/pam-limits-conf" +LIMITS_CONF = "/etc/security/limits.conf" # TACACS+ TACPLUS_SERVER_PASSKEY_DEFAULT = "" @@ -966,6 +970,64 @@ class NtpCfg(object): syslog.syslog(syslog.LOG_INFO, 'ntp server update, restarting ntp-config, ntp servers configured {}'.format(self.ntp_servers)) run_cmd(cmd) +class PamLimitsCfg(object): + """ + PamLimit Config Daemon + 1) The pam_limits PAM module sets limits on the system resources that can be obtained in a user-session. + 2) Purpose of this daemon is to render pam_limits config file. + """ + def __init__(self, config_db): + self.config_db = config_db + self.hwsku = "" + self.type = "" + + # Load config from ConfigDb and render config file/ + def update_config_file(self): + device_metadata = self.config_db.get_table('DEVICE_METADATA') + if "localhost" not in device_metadata: + return + + self.read_localhost_config(device_metadata["localhost"]) + self.render_conf_file() + + # Read localhost config + def read_localhost_config(self, localhost): + if "hwsku" in localhost: + self.hwsku = localhost["hwsku"] + else: + self.hwsku = "" + + if "type" in localhost: + self.type = localhost["type"] + else: + self.type = "" + + # Render pam_limits config files + def render_conf_file(self): + env = jinja2.Environment(loader=jinja2.FileSystemLoader('/'), trim_blocks=True) + env.filters['sub'] = sub + + try: + template_file = os.path.abspath(PAM_LIMITS_CONF_TEMPLATE) + template = env.get_template(template_file) + pam_limits_conf = template.render( + hwsku=self.hwsku, + type=self.type) + with open(PAM_LIMITS_CONF, 'w') as f: + f.write(pam_limits_conf) + + template_file = os.path.abspath(LIMITS_CONF_TEMPLATE) + template = env.get_template(template_file) + limits_conf = template.render( + hwsku=self.hwsku, + type=self.type) + with open(LIMITS_CONF, 'w') as f: + f.write(limits_conf) + except Exception as e: + syslog.syslog(syslog.LOG_ERR, + "modify pam_limits config file failed with exception: {}" + .format(e)) + class HostConfigDaemon: def __init__(self): # Just a sanity check to verify if the CONFIG_DB has been initialized @@ -1007,6 +1069,9 @@ class HostConfigDaemon: self.hostname_cache="" self.aaacfg = AaaCfg() + # Initialize PamLimitsCfg + self.pamLimitsCfg = PamLimitsCfg(self.config_db) + self.pamLimitsCfg.update_config_file() def load(self): aaa = self.config_db.get_table('AAA') From 71a04722f43fd06f32b86d2a4449d2aafd323b8b Mon Sep 17 00:00:00 2001 From: Myron Sosyak Date: Thu, 31 Mar 2022 02:45:29 -0700 Subject: [PATCH 074/119] [submodule] Update sonic-sairedis (#10302) 1ccda8d MACsec in Gearbox (#993) 7a2b824 Update SAI submodule (#1015) 418d5fb Add pre match logic for lag member (#1008) Signed-off-by: Myron Sosyak --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index b9337dc5787a..1ccda8d1d982 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit b9337dc5787aadf71eee9d676d6b7f1181ac0787 +Subproject commit 1ccda8d1d9821a65f73eb5c8f88f9abea0623c0b From 106fac5f09b9764175b1fef93c76dd6c8d7a7fea Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 31 Mar 2022 20:23:57 +0800 Subject: [PATCH 075/119] [counter] Fix issue: non default counters will be delayed forever after fastboot (#10413) - Why I did it Fastboot will delay all counters in CONFIG DB, it relies on enable_counters.py to recover the delayed counters. However, enable_counters.py does not recover those non-default counters. - How I did it For non-default counters, if it is in CONFIG DB, put delay status to false after the waiting. - How to verify it Manual test --- dockers/docker-orchagent/enable_counters.py | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/dockers/docker-orchagent/enable_counters.py b/dockers/docker-orchagent/enable_counters.py index 7d25643bba43..c45a931e0553 100755 --- a/dockers/docker-orchagent/enable_counters.py +++ b/dockers/docker-orchagent/enable_counters.py @@ -38,16 +38,18 @@ def enable_rates(): def enable_counters(): db = swsssdk.ConfigDBConnector() db.connect() - enable_counter_group(db, 'PORT') - enable_counter_group(db, 'RIF') - 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') - enable_counter_group(db, 'ACL') + default_enabled_counters = ['PORT', 'RIF', 'QUEUE', 'PFCWD', 'PG_WATERMARK', 'PG_DROP', + 'QUEUE_WATERMARK', 'BUFFER_POOL_WATERMARK', 'PORT_BUFFER_DROP', 'ACL'] + + # Enable those default counters + for key in default_enabled_counters: + enable_counter_group(db, key) + + # Set FLEX_COUNTER_DELAY_STATUS to false for those non-default counters + keys = db.get_keys('FLEX_COUNTER_TABLE') + for key in keys: + if key not in default_enabled_counters: + enable_counter_group(db, key) enable_rates() From 0bce0a7e6db9b2d492ab34641c3a43fa1f6285e6 Mon Sep 17 00:00:00 2001 From: AmitKaushik7 <52193450+AmitKaushik7@users.noreply.github.com> Date: Thu, 31 Mar 2022 22:52:03 +0530 Subject: [PATCH 076/119] =?UTF-8?q?Allow=20NULL=20Buffer=20Profile=20in=20?= =?UTF-8?q?buffer=20pg/queue=20yang=20files=20for=20Dynamic=20B=E2=80=A6?= =?UTF-8?q?=20(#10353)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it To address #10342 (Yang validation fails when Buffer profiles are configured with "NULL" values) --- .../yang_model_tests/tests/buffer_pg.json | 3 ++ .../tests_config/buffer_pg.json | 52 +++++++++++++++++++ .../yang-models/sonic-buffer-pg.yang | 13 +++-- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pg.json b/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pg.json index f92a75365c78..e6e4e59a8fdf 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pg.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pg.json @@ -10,6 +10,9 @@ "desc": "BUFFER_PG_WRONG_PG_VALUE pattern failure", "eStr": "Invalid Buffer PG number" }, + "BUFFER_PG_NULL_PROFILE_VALUE": { + "desc": "BUFFER_PG_NULL_PROFILE_VALUE no failure" + }, "BUFFER_PG_WRONG_PORT_VALUE": { "desc": "BUFFER_PG_WRONG_PORT_VALUE pattern failure", "eStr": "wrong" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pg.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pg.json index ec3ea73bf76d..cd0a244a0e0e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pg.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pg.json @@ -52,6 +52,58 @@ } } }, + "BUFFER_PG_NULL_PROFILE_VALUE": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } + ] + } + }, + "sonic-buffer-pool:sonic-buffer-pool": { + "sonic-buffer-pool:BUFFER_POOL": { + "BUFFER_POOL_LIST": [ + { + "name": "egress_lossless_pool", + "mode": "static", + "size": "300", + "type": "ingress" + } + ] + } + }, + "sonic-buffer-profile:sonic-buffer-profile": { + "sonic-buffer-profile:BUFFER_PROFILE": { + "BUFFER_PROFILE_LIST": [ + { + "name": "lossless_buffer_profile", + "size": "300", + "pool": "egress_lossless_pool" + } + ] + } + }, + "sonic-buffer-pg:sonic-buffer-pg": { + "sonic-buffer-pg:BUFFER_PG": { + "BUFFER_PG_LIST": [ + { + "port": "Ethernet4", + "pg_num": "3", + "profile": "NULL" + } + ] + } + } + }, "BUFFER_PG_WRONG_PROFILE_VALUE": { "sonic-port:sonic-port": { "sonic-port:PORT": { diff --git a/src/sonic-yang-models/yang-models/sonic-buffer-pg.yang b/src/sonic-yang-models/yang-models/sonic-buffer-pg.yang index efe6e34ad0d6..60d06bf6ef6c 100644 --- a/src/sonic-yang-models/yang-models/sonic-buffer-pg.yang +++ b/src/sonic-yang-models/yang-models/sonic-buffer-pg.yang @@ -2,9 +2,7 @@ module sonic-buffer-pg { namespace "http://github.com/Azure/sonic-buffer-pg"; prefix bpg; - import sonic-extension { - prefix sonic-ext; - } + yang-version 1.1; import sonic-port { prefix prt; @@ -54,8 +52,13 @@ module sonic-buffer-pg { leaf profile { default 0; - type leafref { - path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name"; + type union { + type leafref { + path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name"; + } + type string { + pattern "NULL"; + } } description "Buffer Profile associated with Priority Group number for a port"; } From eb141f21638b261877bd9ea562b672116e2e4419 Mon Sep 17 00:00:00 2001 From: Myron Sosyak Date: Thu, 31 Mar 2022 12:49:22 -0700 Subject: [PATCH 077/119] [BFN] Remove SAI patches (#10343) Signed-off-by: Myron Sosyak --- platform/barefoot/libsaithrift-dev.mk | 5 -- ...eplace-unions-with-structs-in-thrift.patch | 70 ------------------- ...-Use-std-shared_ptr-instead-of-boost.patch | 25 ------- .../0003-include-algorithm.patch | 24 ------- ...0004-Fix-Thrift-0.14.1-compatibility.patch | 47 ------------- platform/barefoot/saithrift-patches/Makefile | 19 ----- platform/barefoot/saithrift-patches/series | 4 -- 7 files changed, 194 deletions(-) delete mode 100644 platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch delete mode 100644 platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch delete mode 100644 platform/barefoot/saithrift-patches/0003-include-algorithm.patch delete mode 100644 platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch delete mode 100644 platform/barefoot/saithrift-patches/Makefile delete mode 100644 platform/barefoot/saithrift-patches/series diff --git a/platform/barefoot/libsaithrift-dev.mk b/platform/barefoot/libsaithrift-dev.mk index 40cd5554653e..0fb5ca0cb81d 100644 --- a/platform/barefoot/libsaithrift-dev.mk +++ b/platform/barefoot/libsaithrift-dev.mk @@ -1,7 +1,3 @@ -SAITHRIFT_PATCHES = saithrift-patches -$(SAITHRIFT_PATCHES)_SRC_PATH = $(PLATFORM_PATH)/saithrift-patches -SONIC_MAKE_FILES += $(SAITHRIFT_PATCHES) - # libsaithrift-dev package SAI_VER = 0.9.4 LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb @@ -13,7 +9,6 @@ $(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) \ #$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) # $(LIBSAITHRIFT_DEV)_BUILD_ENV = platform=v -$(LIBSAITHRIFT_DEV)_AFTER_FILES = $(SAITHRIFT_PATCHES) $(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(BFN_SAI) SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) diff --git a/platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch b/platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch deleted file mode 100644 index 762c72c75607..000000000000 --- a/platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 6f0188ad82845ac56729d3db621b2d10bea94ddd Mon Sep 17 00:00:00 2001 -From: Myron Sosyak -Date: Thu, 27 Jan 2022 17:25:42 +0000 -Subject: [PATCH 1/4] Replace unions with structs in thrift - ---- - test/saithrift/src/switch_sai.thrift | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/test/saithrift/src/switch_sai.thrift b/test/saithrift/src/switch_sai.thrift -index a9e1d28..0c24b71 100644 ---- a/test/saithrift/src/switch_sai.thrift -+++ b/test/saithrift/src/switch_sai.thrift -@@ -48,7 +48,7 @@ struct sai_thrift_vlan_port_t { - 2: sai_thrift_vlan_tagging_mode_t tagging_mode; - } - --union sai_thrift_ip_t { -+struct sai_thrift_ip_t { - 1: sai_thrift_ip4_t ip4; - 2: sai_thrift_ip6_t ip6; - } -@@ -79,7 +79,7 @@ struct sai_thrift_s32_list_t { - 2: list s32list; - } - --union sai_thrift_acl_mask_t { -+struct sai_thrift_acl_mask_t { - 1: byte u8; - 2: byte s8; - 3: i16 u16; -@@ -91,7 +91,7 @@ union sai_thrift_acl_mask_t { - 9: sai_thrift_ip6_t ip6; - } - --union sai_thrift_acl_data_t { -+struct sai_thrift_acl_data_t { - 1: byte u8; - 2: byte s8; - 3: i16 u16; -@@ -112,7 +112,7 @@ struct sai_thrift_acl_field_data_t - 3: sai_thrift_acl_data_t data; - } - --union sai_thrift_acl_parameter_t { -+struct sai_thrift_acl_parameter_t { - 1: byte u8; - 2: byte s8; - 3: i16 u16; -@@ -161,7 +161,7 @@ struct sai_thrift_fdb_values_t { - 2: sai_thrift_fdb_entry_t thrift_fdb_entry; - } - --union sai_thrift_attribute_value_t { -+struct sai_thrift_attribute_value_t { - 1: bool booldata; - 2: string chardata; - 3: byte u8; -@@ -207,7 +207,7 @@ struct sai_thrift_attribute_list_t { - 2: i32 attr_count; // redundant - } - --union sai_thrift_result_data_t { -+struct sai_thrift_result_data_t { - 1: sai_thrift_object_list_t objlist; - 2: sai_thrift_object_id_t oid; - 3: i16 u16; --- -2.20.1 - diff --git a/platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch b/platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch deleted file mode 100644 index 93602dc4e991..000000000000 --- a/platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 6605dbe4906173b78f428f42f749674c2722361a Mon Sep 17 00:00:00 2001 -From: Myron Sosyak -Date: Thu, 27 Jan 2022 17:26:08 +0000 -Subject: [PATCH 2/4] Use std::shared_ptr instead of boost - ---- - test/saithrift/src/switch_sai_rpc_server.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/saithrift/src/switch_sai_rpc_server.cpp b/test/saithrift/src/switch_sai_rpc_server.cpp -index 0df9b3d..e990c50 100644 ---- a/test/saithrift/src/switch_sai_rpc_server.cpp -+++ b/test/saithrift/src/switch_sai_rpc_server.cpp -@@ -74,7 +74,7 @@ using namespace ::apache::thrift::protocol; - using namespace ::apache::thrift::transport; - using namespace ::apache::thrift::server; - --using boost::shared_ptr; -+using std::shared_ptr; - - using namespace ::switch_sai; - --- -2.20.1 - diff --git a/platform/barefoot/saithrift-patches/0003-include-algorithm.patch b/platform/barefoot/saithrift-patches/0003-include-algorithm.patch deleted file mode 100644 index 22471adc380e..000000000000 --- a/platform/barefoot/saithrift-patches/0003-include-algorithm.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b468a7aa00843be9c5ead478bd074784c04b4ba2 Mon Sep 17 00:00:00 2001 -From: Myron Sosyak -Date: Thu, 27 Jan 2022 17:26:40 +0000 -Subject: [PATCH 3/4] include algorithm - ---- - test/saithrift/src/saiserver.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/test/saithrift/src/saiserver.cpp b/test/saithrift/src/saiserver.cpp -index 846c3f1..7120b26 100644 ---- a/test/saithrift/src/saiserver.cpp -+++ b/test/saithrift/src/saiserver.cpp -@@ -5,6 +5,7 @@ - #include - #include - #include -+#include - #include - #include - #include --- -2.20.1 - diff --git a/platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch b/platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch deleted file mode 100644 index 19e619aa5be0..000000000000 --- a/platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 58d5e21378d3fd5dd3a48adb24423c1bb9ff6f7a Mon Sep 17 00:00:00 2001 -From: Myron Sosyak -Date: Thu, 27 Jan 2022 17:28:05 +0000 -Subject: [PATCH 4/4] Fix Thrift 0.14.1 compatibility - ---- - test/saithrift/Makefile | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/test/saithrift/Makefile b/test/saithrift/Makefile -index cbe6f48..3734ee7 100644 ---- a/test/saithrift/Makefile -+++ b/test/saithrift/Makefile -@@ -21,8 +21,8 @@ CDEFS = -DBRCMSAI - endif - endif - endif --DEPS = switch_sai_constants.h switch_sai_rpc.h switch_sai_types.h --OBJS = switch_sai_constants.o switch_sai_rpc.o switch_sai_types.o -+DEPS = switch_sai_rpc.h switch_sai_types.h -+OBJS = switch_sai_rpc.o switch_sai_types.o - - ODIR = ./src/obj - SAIDIR = ./include -@@ -42,8 +42,6 @@ endif - SAI_LIBRARY_DIR ?= $(SAI_PREFIX)/lib - LDFLAGS = -L$(SAI_LIBRARY_DIR) -Wl,-rpath=$(SAI_LIBRARY_DIR) - CPP_SOURCES = \ -- src/gen-cpp/switch_sai_constants.cpp \ -- src/gen-cpp/switch_sai_constants.h \ - src/gen-cpp/switch_sai_rpc.cpp \ - src/gen-cpp/switch_sai_rpc.h \ - src/gen-cpp/switch_sai_types.cpp \ -@@ -89,8 +87,8 @@ $(ODIR)/switch_sai_rpc_server.o: src/switch_sai_rpc_server.cpp - $(ODIR)/saiserver.o: src/saiserver.cpp - $(CXX) $(CFLAGS) -c $^ -o $@ $(CFLAGS) $(CDEFS) -I$(SRC)/gen-cpp -I$(SRC) - --$(ODIR)/librpcserver.a: $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_constants.o $(ODIR)/switch_sai_rpc_server.o -- ar rcs $(ODIR)/librpcserver.a $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_constants.o $(ODIR)/switch_sai_rpc_server.o -+$(ODIR)/librpcserver.a: $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_rpc_server.o -+ ar rcs $(ODIR)/librpcserver.a $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_rpc_server.o - - saiserver: $(ODIR)/saiserver.o $(ODIR)/librpcserver.a - $(CXX) $(LDFLAGS) $(ODIR)/switch_sai_rpc_server.o $(ODIR)/saiserver.o -o $@ \ --- -2.20.1 - diff --git a/platform/barefoot/saithrift-patches/Makefile b/platform/barefoot/saithrift-patches/Makefile deleted file mode 100644 index 625317dcb5fe..000000000000 --- a/platform/barefoot/saithrift-patches/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -SHELL = /bin/bash -.ONESHELL: -.SHELLFLAGS += -e - -MAIN_TARGET = saithrift-patches - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : -# To add some BFN specific patches to SAI under sonic-sairedis while sai is not updated -SRC_DIR = ../saithrift-patches -DST_DIR = ../../../src/sonic-sairedis/SAI.patch/ - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - # copy patches to SAI - mkdir -p $(DST_DIR) - cp -f $(SRC_DIR)/* $(DST_DIR) - - touch $(DEST)/saithrift-patches - - diff --git a/platform/barefoot/saithrift-patches/series b/platform/barefoot/saithrift-patches/series deleted file mode 100644 index fe26c2102c25..000000000000 --- a/platform/barefoot/saithrift-patches/series +++ /dev/null @@ -1,4 +0,0 @@ -0001-Replace-unions-with-structs-in-thrift.patch -0002-Use-std-shared_ptr-instead-of-boost.patch -0003-include-algorithm.patch -0004-Fix-Thrift-0.14.1-compatibility.patch From 13353dffe8b4262fcfcd54dd8e5c82a47bab9699 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Thu, 31 Mar 2022 23:54:40 -0400 Subject: [PATCH 078/119] [Nokia][device] Update the BCM config with Recycle ports info for Nokia IXR7250E platform (#10389) Signed-off-by: mlok --- .../Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm | 4 +++- .../Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm index ecaae10276a4..2ede5ab6d0d0 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm @@ -1553,7 +1553,9 @@ ucode_port_18.BCM8885X=CDGE0:core_0.18 ucode_port_19.BCM8885X=RCY0:core_0.19 -ucode_port_20.BCM8885X=OLP:core_1.20 +ucode_port_20.BCM8885X=RCY1:core_1.20 +ucode_port_21.BCM8885X=OLP:core_1.21 + serdes_lane_config_dfe_1.BCM8885X=on diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm index 142a718e080f..fd96c3ac4368 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm @@ -1553,7 +1553,9 @@ ucode_port_18.BCM8885X=CDGE0:core_0.18 ucode_port_19.BCM8885X=RCY0:core_0.19 -ucode_port_20.BCM8885X=OLP:core_1.20 +ucode_port_20.BCM8885X=RCY1:core_1.20 +ucode_port_21.BCM8885X=OLP:core_1.21 + serdes_lane_config_dfe_1.BCM8885X=on From a9a37c8ba1db35a9e7965219b5603161f8f72967 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 1 Apr 2022 16:19:48 +0800 Subject: [PATCH 079/119] [ci] Fix docker-sonic-slave-template issue for resources. (#10414) Why I did it Fix bug for wrong resources position. --- .azure-pipelines/docker-sonic-slave-arm64.yml | 7 +++++++ .azure-pipelines/docker-sonic-slave-armhf.yml | 7 +++++++ .azure-pipelines/docker-sonic-slave-template.yml | 8 -------- .azure-pipelines/docker-sonic-slave.yml | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-arm64.yml b/.azure-pipelines/docker-sonic-slave-arm64.yml index 6bb9203b49ae..2a9af06c3d01 100644 --- a/.azure-pipelines/docker-sonic-slave-arm64.yml +++ b/.azure-pipelines/docker-sonic-slave-arm64.yml @@ -3,6 +3,13 @@ # 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: Azure/sonic-buildimage + ref: master + endpoint: build schedules: - cron: "0 8 * * *" diff --git a/.azure-pipelines/docker-sonic-slave-armhf.yml b/.azure-pipelines/docker-sonic-slave-armhf.yml index 250bf7400a69..69e73479f342 100644 --- a/.azure-pipelines/docker-sonic-slave-armhf.yml +++ b/.azure-pipelines/docker-sonic-slave-armhf.yml @@ -3,6 +3,13 @@ # 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: Azure/sonic-buildimage + ref: master + endpoint: build schedules: - cron: "0 8 * * *" diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 40a937a8c89a..6b4b90f371d9 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -3,14 +3,6 @@ # 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: Azure/sonic-buildimage - ref: master - endpoint: build - parameters: - name: arch type: string diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index bf5fce77a722..8af6b8b3834f 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -3,6 +3,13 @@ # 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: Azure/sonic-buildimage + ref: master + endpoint: build schedules: - cron: "0 8 * * *" @@ -53,8 +60,15 @@ stages: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: + ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}: - template: docker-sonic-slave-template.yml parameters: pool: sonicbld arch: ${{ arch }} dist: ${{ dist }} + ${{ else }}: + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + parameters: + pool: sonicbld + arch: ${{ arch }} + dist: ${{ dist }} From 0f488a8cb61521e92879e1175948b1f961633265 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Fri, 1 Apr 2022 01:22:54 -0700 Subject: [PATCH 080/119] [azp]: Fix type in slave container cleanup (#10424) Signed-off-by: Lawrence Lee --- .azure-pipelines/template-clean-sonic-slave.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/template-clean-sonic-slave.yml b/.azure-pipelines/template-clean-sonic-slave.yml index cc995e9c2621..c67f63fff476 100644 --- a/.azure-pipelines/template-clean-sonic-slave.yml +++ b/.azure-pipelines/template-clean-sonic-slave.yml @@ -1,7 +1,7 @@ steps: - script: | containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }') - [ -n "$containers" ] && docker container rm -f containers + [ -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 From 94ec85464b00162c5ac45d6c335a12e543c6ea08 Mon Sep 17 00:00:00 2001 From: arunlk-dell <83708154+arunlk-dell@users.noreply.github.com> Date: Fri, 1 Apr 2022 20:03:08 +0530 Subject: [PATCH 081/119] DellEMC: N3248TE/N3248PXE Watchdog Support (#9398) Why I did it DellEMC : Added support for N3248TE/N3248PXE platforms How I did it Implemented the changes to enable/disable the watchdog support How to verify it watchdog_unit_test.txt Co-authored-by: Arun LK --- .../n3248pxe/modules/dell_n3248pxe_platform.c | 37 +++++++++ .../n3248pxe/sonic_platform/watchdog.py | 79 +++++++++--------- .../n3248te/modules/dell_n3248te_platform.c | 40 ++++++++- .../n3248te/sonic_platform/watchdog.py | 83 +++++++++---------- 4 files changed, 154 insertions(+), 85 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248pxe/modules/dell_n3248pxe_platform.c b/platform/broadcom/sonic-platform-modules-dell/n3248pxe/modules/dell_n3248pxe_platform.c index 1c5d07bffaba..5fb106f186b3 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248pxe/modules/dell_n3248pxe_platform.c +++ b/platform/broadcom/sonic-platform-modules-dell/n3248pxe/modules/dell_n3248pxe_platform.c @@ -853,6 +853,41 @@ static ssize_t fan_led_store(struct device *dev, struct device_attribute *devatt return count; } +static ssize_t watchdog_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + s32 ret; + u8 data = 0; + struct cpld_platform_data *pdata = dev->platform_data; + + ret = i2c_smbus_read_byte_data(pdata[cpu_cpld].client, 0x7); + if (ret < 0) + return sprintf(buf, "read error"); + data = ret; + + return sprintf(buf, "%x\n", data); +} + +static ssize_t watchdog_store(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + s32 ret, err; + unsigned long val; + u8 data = 0; + struct cpld_platform_data *pdata = dev->platform_data; + + err = kstrtoul(buf, 10, &val); + if (err) + return err; + + if (data) + { + ret = i2c_smbus_write_byte_data(pdata[cpu_cpld].client, 0x7, data); + if (ret < 0) + return ret; + } + + return count; +} static ssize_t power_good_show(struct device *dev, struct device_attribute *devattr, char *buf) @@ -947,6 +982,7 @@ static DEVICE_ATTR_RO(psu1_prs); static DEVICE_ATTR_RO(psu0_status); static DEVICE_ATTR_RO(psu1_status); static DEVICE_ATTR_RW(system_led); +static DEVICE_ATTR_RW(watchdog); static DEVICE_ATTR_RW(locator_led); static DEVICE_ATTR_RW(power_led); static DEVICE_ATTR_RW(master_led); @@ -988,6 +1024,7 @@ static struct attribute *n3248pxe_cpld_attrs[] = { &dev_attr_psu0_status.attr, &dev_attr_psu1_status.attr, &dev_attr_system_led.attr, + &dev_attr_watchdog.attr, &dev_attr_locator_led.attr, &dev_attr_power_led.attr, &dev_attr_master_led.attr, diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248pxe/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/n3248pxe/sonic_platform/watchdog.py index 876aa4beda51..00277c2872f6 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248pxe/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248pxe/sonic_platform/watchdog.py @@ -11,7 +11,6 @@ try: import ctypes - import subprocess from sonic_platform_base.watchdog_base import WatchdogBase except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -29,43 +28,53 @@ class Watchdog(WatchdogBase): Abstract base class for interfacing with a hardware watchdog module """ - TIMERS = [15,20,30,40,50,60,65,70] + 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): + 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)] + self.watchdog_reg = "watchdog" - def _get_command_result(self, cmdline): + def _get_cpld_register(self, reg_name): + # On successful read, returns the value read from given + # reg name and on failure rethrns 'ERR' + cpld_dir = "/sys/devices/platform/dell-n3248pxe-cpld.0/" + cpld_reg_file = cpld_dir + '/' + reg_name 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 + with open(cpld_reg_file, 'r') as fd: + rv = fd.read() + except IOError : return 'ERR' + return rv.strip('\r\n').lstrip(' ') - return result + 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' + + cpld_dir = "/sys/devices/platform/dell-n3248pxe-cpld.0/" + cpld_reg_file = cpld_dir + '/' + reg_name + + try: + with open(cpld_reg_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception: + rv = 'ERR' + + return rv 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) + value = self._get_cpld_register(self.watchdog_reg).strip() + if value == 'ERR': return False + + 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)) + value = self._set_cpld_register(self.watchdog_reg, val) return value def _get_time(self): @@ -93,7 +102,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,40 +110,29 @@ 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 + # Extracting 5th to 8th bits for WD timer values reg_val = self._get_reg_val() - wd_timer_offset = (reg_val >> 4) & 0x7 + wd_timer_offset = (reg_val >> 4) & 0xF if wd_timer_offset != timer_offset: - # Setting 5th to 7th bits + # Setting 5th to 8th bits # value from timer_offset self.disarm() - self._set_reg_val(reg_val | (timer_offset << 4)) + self._set_reg_val((reg_val & 0x0F) | (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 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 - + self.armed_time = self._get_time() + self.timeout = seconds return seconds def disarm(self): @@ -207,4 +205,3 @@ def get_remaining_time(self): return self.timeout - diff_time return 0 - diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/modules/dell_n3248te_platform.c b/platform/broadcom/sonic-platform-modules-dell/n3248te/modules/dell_n3248te_platform.c index f7a13c2a739f..92ee30af312f 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/modules/dell_n3248te_platform.c +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/modules/dell_n3248te_platform.c @@ -572,7 +572,7 @@ static ssize_t system_led_show(struct device *dev, struct device_attribute *deva if (ret < 0) return sprintf(buf, "read error"); - data = (u8)(ret & 0x30) >> 5; + data = (u8)(ret & 0x30) >> 4; switch (data) { @@ -878,6 +878,42 @@ static ssize_t fan_led_store(struct device *dev, struct device_attribute *devatt return count; } +static ssize_t watchdog_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + s32 ret; + u8 data = 0; + struct cpld_platform_data *pdata = dev->platform_data; + + ret = i2c_smbus_read_byte_data(pdata[cpu_cpld].client, 0x7); + if (ret < 0) + return sprintf(buf, "read error"); + data = ret; + + return sprintf(buf, "%x\n", data); +} + +static ssize_t watchdog_store(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + s32 ret, err; + unsigned long val; + u8 data = 0; + struct cpld_platform_data *pdata = dev->platform_data; + + err = kstrtoul(buf, 10, &val); + if (err) + return err; + + data = (u8) val; + if (data) + { + ret = i2c_smbus_write_byte_data(pdata[cpu_cpld].client, 0x7, data); + if (ret < 0) + return ret; + } + + return count; +} static ssize_t power_good_show(struct device *dev, struct device_attribute *devattr, char *buf) @@ -974,6 +1010,7 @@ static DEVICE_ATTR_RO(psu1_prs); static DEVICE_ATTR_RO(psu0_status); static DEVICE_ATTR_RO(psu1_status); static DEVICE_ATTR_RW(system_led); +static DEVICE_ATTR_RW(watchdog); static DEVICE_ATTR_RW(locator_led); static DEVICE_ATTR_RW(power_led); static DEVICE_ATTR_RW(master_led); @@ -1017,6 +1054,7 @@ static struct attribute *n3248te_cpld_attrs[] = { &dev_attr_psu0_status.attr, &dev_attr_psu1_status.attr, &dev_attr_system_led.attr, + &dev_attr_watchdog.attr, &dev_attr_locator_led.attr, &dev_attr_power_led.attr, &dev_attr_master_led.attr, diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/watchdog.py index ebd4706b4215..1e077e45d122 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/watchdog.py @@ -11,7 +11,6 @@ try: import ctypes - import subprocess from sonic_platform_base.watchdog_base import WatchdogBase except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -29,43 +28,53 @@ class Watchdog(WatchdogBase): Abstract base class for interfacing with a hardware watchdog module """ - TIMERS = [15,20,30,40,50,60,65,70] + 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): + 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)] + self.watchdog_reg = "watchdog" - def _get_command_result(self, cmdline): + def _get_cpld_register(self, reg_name): + # On successful read, returns the value read from given + # reg name and on failure rethrns 'ERR' + cpld_dir = "/sys/devices/platform/dell-n3248te-cpld.0/" + cpld_reg_file = cpld_dir + '/' + reg_name 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 + with open(cpld_reg_file, 'r') as fd: + rv = fd.read() + except IOError : return 'ERR' + return rv.strip('\r\n').lstrip(' ') - return result + 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' + + cpld_dir = "/sys/devices/platform/dell-n3248te-cpld.0/" + cpld_reg_file = cpld_dir + '/' + reg_name + + try: + with open(cpld_reg_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception: + rv = 'ERR' + + return rv 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) + value = self._get_cpld_register(self.watchdog_reg).strip() + if value == 'ERR': return False + + 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)) + value = self._set_cpld_register(self.watchdog_reg, val) return value def _get_time(self): @@ -93,7 +102,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,41 +110,30 @@ 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 + # Extracting 5th to 8th bits for WD timer values reg_val = self._get_reg_val() - wd_timer_offset = (reg_val >> 4) & 0x7 + wd_timer_offset = (reg_val >> 4) & 0xF if wd_timer_offset != timer_offset: - # Setting 5th to 7th bits + # Setting 5th to 8th bits # value from timer_offset self.disarm() - self._set_reg_val(reg_val | (timer_offset << 4)) + self._set_reg_val((reg_val & 0x0F) | (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 + self.armed_time = self._get_time() + self.timeout = seconds + return seconds def disarm(self): """ @@ -183,7 +181,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. + N3248PXE 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. @@ -207,4 +205,3 @@ def get_remaining_time(self): return self.timeout - diff_time return 0 - From a9e86c3b82a0e7d4fe5a77d1b685cf101a0806c6 Mon Sep 17 00:00:00 2001 From: arunlk-dell <83708154+arunlk-dell@users.noreply.github.com> Date: Fri, 1 Apr 2022 20:04:31 +0530 Subject: [PATCH 082/119] DellEMC: N3248TE platform API2.0 changes (#10400) DellEMC: N3248TE platform API2.0 changes Why I did it N3248TE Platform API 2.0 changes How I did it Implemented the functional API's needed for Platform API 2.0 Added system_health_monitoring_config.json file How to verify it Used the API 2.0 test suite to validate the test cases. Co-authored-by: Arun LK --- .../system_health_monitoring_config.json | 11 ++++ .../n3248te/sonic_platform/chassis.py | 3 +- .../n3248te/sonic_platform/fan.py | 26 +++++++- .../n3248te/sonic_platform/psu.py | 6 +- .../n3248te/sonic_platform/sfp.py | 63 +++++++++++++++++-- 5 files changed, 99 insertions(+), 10 deletions(-) create mode 100644 device/dell/x86_64-dellemc_n3248te_c3338-r0/system_health_monitoring_config.json diff --git a/device/dell/x86_64-dellemc_n3248te_c3338-r0/system_health_monitoring_config.json b/device/dell/x86_64-dellemc_n3248te_c3338-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..dc20d412147f --- /dev/null +++ b/device/dell/x86_64-dellemc_n3248te_c3338-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": ["fan.speed","psu.temperature","psu.voltage","asic"], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault" : "blink_yellow", + "normal" : "green", + "booting": "blink_green" + } +} diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py index d2922eac1fa5..ddc254881ca3 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py @@ -118,7 +118,8 @@ def _get_cpld_register(self, reg_name): # reg name and on failure rethrns 'ERR' cpld_reg_file = self.CPLD_DIR + '/' + reg_name try: - rv = open(cpld_reg_file, 'r').read() + with open(cpld_reg_file, 'r') as fd: + rv = fd.read() except IOError : return 'ERR' return rv.strip('\r\n').lstrip(' ') diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py index ff8ea160b95d..e82dc91cc686 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py @@ -47,7 +47,8 @@ def _get_cpld_register(self, reg_name): cpld_dir = "/sys/devices/platform/dell-n3248te-cpld.0/" cpld_reg_file = cpld_dir + '/' + reg_name try: - buf = open(cpld_reg_file, 'r').read() + with open(cpld_reg_file, 'r')as fd: + buf = fd.read() except (IOError, AttributeError): return 'ERR' return buf.strip('\r\n').lstrip(' ') @@ -228,7 +229,26 @@ def set_status_led(self, color): Returns: bool: True if set success, False if fail. """ - # Fan tray status LED controlled by HW - # Return True to avoid thermalctld alarm + # N3248TE has led only on FanTray and not available for seperate fans return True + def get_status_led(self): + """ + Gets the current system LED color + + Returns: + A string that represents the supported color + """ + + return None + + 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) + """ + # Return current speed to avoid false thermalctld alarm. + return self.get_speed() + diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py index 617b2ce7f966..b2f06785f0dc 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py @@ -38,7 +38,8 @@ def _get_cpld_register(self, reg_name): cpld_dir = "/sys/devices/platform/dell-n3248te-cpld.0/" cpld_reg_file = cpld_dir + '/' + reg_name try: - rv = open(cpld_reg_file, 'r').read() + with open(cpld_reg_file, 'r') as fd: + rv = fd.read() except IOError : return 'ERR' return rv.strip('\r\n').lstrip(' ') @@ -46,7 +47,8 @@ def _get_dps_register(self, reg_name): try : dps_dir = self.dps_hwmon + '/' + os.listdir(self.dps_hwmon)[0] dps_reg_file = dps_dir + '/' + reg_name - rv = open(dps_reg_file, 'r').read() + with open(dps_reg_file, 'r') as fd: + rv = fd.read() except (IOError, OSError) : return 'ERR' return rv diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py index 0a30ae272d76..3a6b0a4cd4cc 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py @@ -20,6 +20,22 @@ SFP_PORT_START = 49 SFP_PORT_END = 54 +QSFP_INFO_OFFSET = 128 +SFP_INFO_OFFSET = 0 +QSFP_DD_PAGE0 = 0 + +SFP_TYPE_LIST = [ + '0x3' # SFP/SFP+/SFP28 and later +] +QSFP_TYPE_LIST = [ + '0xc', # QSFP + '0xd', # QSFP+ or later + '0x11' # QSFP28 or later +] +QSFP_DD_TYPE_LIST = [ + '0x18' #QSFP_DD Type +] + class Sfp(SfpOptoeBase): """ DELLEMC Platform-specific Sfp class @@ -35,7 +51,7 @@ def get_eeprom_path(self): return self.eeprom_path def get_name(self): - return "SFP/SFP+/SFP28" + return "SFP/SFP+/SFP28" if self.index < 53 else "QSFP+ or later" def pci_mem_read(self, mm, offset): mm.seek(offset) @@ -70,7 +86,8 @@ def pci_get_value(self, resource, offset): def _get_cpld_register(self, reg): reg_file = '/sys/devices/platform/dell-n3248te-cpld.0/' + reg try: - rv = open(reg_file, 'r').read() + with open(reg_file, 'r') as fd: + rv = fd.read() except IOError : return 'ERR' return rv.strip('\r\n').lstrip(' ') @@ -109,7 +126,7 @@ def reset(self): """ Reset the SFP and returns all user settings to their default state """ - return True + return False def set_lpmode(self, lpmode): """ @@ -128,4 +145,42 @@ def get_max_port_power(self): """ Retrieves the maximumum power allowed on the port in watts """ - return 2.5 + return 5.0 if self.sfp_type == 'QSFP' else 2.5 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is 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 + else: + if not os.path.isfile(self.eeprom_path): + return "EEPROM driver is not attached" + + if self.sfp_type == 'SFP': + offset = SFP_INFO_OFFSET + elif self.sfp_type == 'QSFP': + offset = QSFP_INFO_OFFSET + elif self.sfp_type == 'QSFP_DD': + offset = QSFP_DD_PAGE0 + + try: + with open(self.eeprom_path, mode="rb", buffering=0) as eeprom: + eeprom.seek(offset) + eeprom.read(1) + except OSError as e: + return "EEPROM read failed ({})".format(e.strerror) + + return self.SFP_STATUS_OK From ddc269ac81178894ec053c15d13f33c881e1212c Mon Sep 17 00:00:00 2001 From: arunlk-dell <83708154+arunlk-dell@users.noreply.github.com> Date: Fri, 1 Apr 2022 20:05:07 +0530 Subject: [PATCH 083/119] DellEMC: Added platform.json file for N3248TE (#9404) Why I did it Added platform.json file for N3248TE How I did it Defined the platform.json file with the required components under chassis. How to verify it validated the API 2.0 test suite Co-authored-by: Arun LK --- .../platform.json | 350 ++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 device/dell/x86_64-dellemc_n3248te_c3338-r0/platform.json diff --git a/device/dell/x86_64-dellemc_n3248te_c3338-r0/platform.json b/device/dell/x86_64-dellemc_n3248te_c3338-r0/platform.json new file mode 100644 index 000000000000..0bb2391ca3df --- /dev/null +++ b/device/dell/x86_64-dellemc_n3248te_c3338-r0/platform.json @@ -0,0 +1,350 @@ +{ + "chassis": { + "name": "N3248TE-ON", + "status_led": { + "controllable": true, + "colors": ["green", "blink_green", "yellow", "blink_yellow"] + }, + "thermal_manager" : false, + "components": [ + { + "name": "BIOS" + }, + { + "name": "CPU CPLD" + }, + { + "name": "SYS CPLD" + } + ], + "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 + } + } + ], + "fan_drawers":[ + { + "name": "FanTray1", + "status_led": { + "controllable": true, + "colors": ["off", "green", "yellow"] + }, + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable":false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray2", + "status_led": { + "controllable": true, + "colors": ["off", "green", "yellow"] + }, + "fans": [ + { + "name": "FanTray2-Fan1", + "speed": { + "controllable":false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray3", + "status_led": { + "controllable": true, + "colors": ["off", "green", "yellow"] + }, + "fans": [ + { + "name": "FanTray3-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": "Front Panel PHY Temperature", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Middle Fan Tray Temperature", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Near Front Panel Temperature", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Switch Near Temperature", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Switch Rear Temperature", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + } + ], + "modules": [], + "sfps": [ + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "1GSFPCu" + }, + { + "name": "SFP/SFP+/SFP28" + }, + { + "name": "SFP/SFP+/SFP28" + }, + { + "name": "SFP/SFP+/SFP28" + }, + { + "name": "SFP/SFP+/SFP28" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + } + ] + }, + "interfaces": {} +} From b39b7a3f2d6f8c2df0b7db5b385e189726e746b7 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Sat, 2 Apr 2022 00:55:04 +0800 Subject: [PATCH 084/119] [Accton/PDDF] Support pddf to as4630/as7816/as7326 (#10340) Why I did it Support pddf to as4630/as7816/as7326 How I did it Send needed file to the PR for these platform How to verify it Test sensors and show platform cmd. root@as7326-56x-3:/home/admin# show platform psustatus PSU Model Serial HW Rev Voltage (V) Current (A) Power (W) Status LED PSU 1 FSF045-611 FSF0451912000505 N/A 12.06 5.50 66.00 OK green PSU 2 FSF045-611 FSF0451912000568 N/A 12.00 5.50 66.00 OK green root@as7326-56x-3:/home/admin# sensors lm75-i2c-15-4a Adapter: i2c-1-mux (chan_id 6) Main Board Temperature: +35.5 C (high = +80.0 C, hyst = +75.0 C) lm75-i2c-15-4b Adapter: i2c-1-mux (chan_id 6) CPU Board Temperature: +29.0 C (high = +80.0 C, hyst = +75.0 C) fan_ctrl-i2c-11-66 Adapter: i2c-1-mux (chan_id 2) fan1: 9100 RPM fan2: 9400 RPM fan3: 9300 RPM fan4: 9600 RPM fan5: 9000 RPM fan6: 9100 RPM fan7: 9100 RPM fan8: 9300 RPM fan9: 9200 RPM fan10: 9400 RPM fan11: 9200 RPM fan12: 9400 RPM pch_haswell-virtual-0 Adapter: Virtual device temp1: +43.0 C psu_pmbus-i2c-17-59 Adapter: i2c-1-mux (chan_id 0) in3: +12.06 V fan1: 6272 RPM temp1: +37.0 C power2: 60.00 W curr2: +6.00 A lm75-i2c-15-49 Adapter: i2c-1-mux (chan_id 6) Main Board Temperature: +40.0 C (high = +80.0 C, hyst = +75.0 C) lm75-i2c-15-48 Adapter: i2c-1-mux (chan_id 6) Main Board Temperature: +39.0 C (high = +80.0 C, hyst = +75.0 C) psu_pmbus-i2c-13-5b Adapter: i2c-1-mux (chan_id 4) in3: +12.00 V fan1: 6144 RPM temp1: +36.0 C power2: 66.00 W curr2: +5.50 A coretemp-isa-0000 Adapter: ISA adapter Package id 0: +50.0 C (high = +82.0 C, crit = +104.0 C) Core 0: +50.0 C (high = +82.0 C, crit = +104.0 C) Core 1: +50.0 C (high = +82.0 C, crit = +104.0 C) Core 2: +50.0 C (high = +82.0 C, crit = +104.0 C) Core 3: +50.0 C (high = +82.0 C, crit = +104.0 C) Signed-off-by: Jostar Yang --- .../pddf/pd-plugin.json | 66 + .../x86_64-accton_as4630_54pe-r0/pddf_support | 0 .../pddf/pd-plugin.json | 67 + .../pddf/pddf-device.json | 2944 +++++++++++++++++ .../x86_64-accton_as7326_56x-r0/pddf_support | 0 .../pddf/pd-plugin.json | 2 +- .../pddf/pd-plugin.json | 64 + .../pddf/pddf-device.json | 22 +- .../x86_64-accton_as7816_64x-r0/pddf_support | 0 .../service/pddf-platform-init.service | 1 + .../as4630-54pe/sonic_platform_setup.py | 13 +- .../as7326-56x/modules/Makefile | 7 +- .../as7326-56x/modules/pddf_custom_psu.c | 206 ++ .../as7326-56x-pddf-platform-monitor.service | 16 + .../service/pddf-platform-init.service | 1 + .../as7326-56x/sonic_platform_setup.py | 9 +- .../utils/pddf_post_driver_install.sh | 23 + .../utils/pddf_post_driver_install.sh | 4 +- .../as7816-pddf-platform-monitor.service | 16 + .../service/pddf-platform-init.service | 1 + .../as7816-64x/sonic_platform_setup.py | 11 +- .../utils/pddf_post_driver_install.sh | 23 + .../utils/pddf_post_driver_install.sh | 4 +- .../sonic-platform-accton-as4630-54pe.install | 2 +- ...sonic-platform-accton-as4630-54pe.postinst | 8 + .../sonic-platform-accton-as7326-56x.install | 3 +- .../sonic-platform-accton-as7726-32x.postinst | 2 + .../sonic-platform-accton-as7816-64x.install | 3 +- 28 files changed, 3467 insertions(+), 51 deletions(-) create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf_support create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json create mode 100644 device/accton/x86_64-accton_as7326_56x-r0/pddf_support create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json create mode 100644 device/accton/x86_64-accton_as7816_64x-r0/pddf_support create mode 120000 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/pddf_custom_psu.c create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service create mode 120000 platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service create mode 100755 platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pddf_post_driver_install.sh create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service create mode 120000 platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service create mode 100755 platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pddf_post_driver_install.sh create mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json new file mode 100644 index 000000000000..0abf66aab7a5 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json @@ -0,0 +1,66 @@ +{ + "XCVR": + { + "xcvr_present": + { + "i2c": + { + "valmap-SFP28": {"1":true, "0":false }, + "valmap-QSFP28": {"1":true, "0":false} + } + } + }, + + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } + } + }, + + "PSU_FAN_MAX_SPEED":"18000" + }, + + "FAN": + { + "direction": + { + "i2c": + { + "valmap": {"1":"EXHAUST", "0":"INTAKE"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + } + }, + + "duty_cycle_to_pwm": "lambda dc: ((dc*100.0)/625)", + + "pwm_to_duty_cycle": "lambda pwm: ((pwm*625.0)/100)" + } + +} diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf_support b/device/accton/x86_64-accton_as4630_54pe-r0/pddf_support new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json new file mode 100644 index 000000000000..317cf23b7362 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/pddf/pd-plugin.json @@ -0,0 +1,67 @@ +{ + + "XCVR": + { + "xcvr_present": + { + "i2c": + { + "valmap-SFP": {"1":true, "0":false }, + "valmap-SFP28": {"1":true, "0":false }, + "valmap-QSFP28": {"1":true, "0":false} + } + } + }, + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } + } + }, + + "PSU_FAN_MAX_SPEED":"18000" + }, + + "FAN": + { + "direction": + { + "i2c": + { + "valmap": {"1":"INTAKE", "0":"EXHAUST"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + } + }, + + "duty_cycle_to_pwm": "lambda dc: ((dc*100)/625 -1)", + + "pwm_to_duty_cycle": "lambda pwm: (((pwm+1)*625+75)/100)" + } + +} diff --git a/device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json new file mode 100644 index 000000000000..a8bd6d0c4043 --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json @@ -0,0 +1,2944 @@ +{ + "PLATFORM": + { + "num_psus":2, + "num_fantrays":6, + "num_fans_pertray":2, + "num_ports":58, + "num_temps": 4, + "pddf_dev_types": + { + "description":"AS7326-56X - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", + "CPLD": + [ + "i2c_cpld" + ], + "PSU": + [ + "psu_eeprom", + "psu_pmbus" + ], + "FAN": + [ + "fan_ctrl", + "fan_eeprom" + ], + "PORT_MODULE": + [ + "pddf_xcvr" + ] + }, + "std_kos": + [ + "i2c-i801", + "i2c_dev", + "i2c_mux_pca954x", + "optoe" + ], + "pddf_kos": + [ + "pddf_client_module", + "pddf_cpld_module", + "pddf_cpld_driver", + "pddf_mux_module", + "pddf_xcvr_module", + "pddf_xcvr_driver_module", + "pddf_psu_driver_module", + "pddf_psu_module", + "pddf_fan_driver_module", + "pddf_fan_module", + "pddf_led_module", + "pddf_sysstatus_module" + ], + "custom_kos": + [ + "pddf_custom_psu" + ] + }, + + "SYSTEM": + { + "dev_info": {"device_type":"CPU", "device_name":"ROOT_COMPLEX", "device_parent":null}, + "i2c": + { + "CONTROLLERS": + [ + { "dev_name":"i2c-0", "dev":"SMBUS0" } + ] + } + }, + + "SMBUS0": + { + "dev_info": {"device_type": "SMBUS", "device_name": "SMBUS0", "device_parent": "SYSTEM"}, + "i2c": + { + "topo_info": {"dev_addr": "0x0"}, + "DEVICES": + [ + {"dev": "EEPROM1"}, + {"dev": "CPU_CPLD"}, + {"dev": "MUX1"} + ] + } + }, + + "EEPROM1": + { + "dev_info": {"device_type": "EEPROM", "device_name": "EEPROM1", "device_parent": "SMBUS0"}, + "i2c": + { + "topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c04"}, + "dev_attr": {"access_mode": "BLOCK"}, + "attr_list": [ + {"attr_name": "eeprom"} + ] + } + }, + + "CPU_CPLD": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPU_CPLD", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x65", "dev_type":"i2c_cpld"}, + "dev_attr": { } + } + }, + + "MUX1": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX1", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x77", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x1", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"MUX2" }, + { "chn":"0", "dev":"MUX3" }, + { "chn":"1", "dev":"MUX4" } + + ] + } + }, + "MUX2": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX2", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1", "dev_addr":"0x70", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x9", "idle_state":"-2"}, + "channel": + [ + { "chn":"2", "dev":"FAN-CTRL" }, + { "chn":"3", "dev":"CPLD2" }, + { "chn":"4", "dev":"PSU2" } , + { "chn":"6", "dev":"TEMP1" }, + { "chn":"6", "dev":"TEMP2" }, + { "chn":"6", "dev":"TEMP3" }, + { "chn":"6", "dev":"TEMP4" } + ] + } + }, + "MUX3": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX3", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1", "dev_addr":"0x71", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x11", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PSU1" }, + { "chn":"1", "dev":"CPLD1" }, + { "chn":"2", "dev":"CPLD3" }, + { "chn":"5", "dev":"PORT57" }, + { "chn":"6", "dev":"PORT58" }, + { "chn":"7", "dev":"MUX11" } + ] + } + }, + "MUX4": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX4", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2", "dev_addr":"0x70", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x21", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"MUX5" }, + { "chn":"1", "dev":"MUX6" }, + { "chn":"2", "dev":"MUX7" }, + { "chn":"3", "dev":"MUX8" }, + { "chn":"4", "dev":"MUX9" }, + { "chn":"5", "dev":"MUX10" } + ] + } + }, + "PSU2": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU2", "device_parent":"MUX2" }, + "dev_attr": { "dev_idx":"2", "num_psu_fans":"1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU2-PMBUS"}, + { "itf":"eeprom", "dev":"PSU2-EEPROM" } + ] + } + }, + + "PSU2-PMBUS": + { + "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU2-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xd", "dev_addr":"0x5b", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "PSU2-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU2-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xd", "dev_addr":"0x53", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_model_name", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"11" }, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x2e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"17" } + + ] + } + }, + "PSU1": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU1", "device_parent":"MUX3" }, + "dev_attr": { "dev_idx":"1", "num_psu_fans":"1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU1-PMBUS"}, + { "itf":"eeprom", "dev":"PSU1-EEPROM" } + ] + } + }, + + "PSU1-PMBUS": + { + "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU1-PMBUS", "device_parent":"MUX3", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x11", "dev_addr":"0x59", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + "PSU1-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU1-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0x11", "dev_addr":"0x51", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_model_name", "attr_devaddr":"0x51", "attr_devtype":"eeprom", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"11" }, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x51", "attr_devtype":"eeprom", "attr_offset":"0x2e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"17" } + ] + } + }, + "CPLD1": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD1", "device_parent":"MUX3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x60", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + "CPLD2": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD2", "device_parent":"MUX2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xc", "dev_addr":"0x62", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + "CPLD3": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD3", "device_parent":"MUX3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x64", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + "TEMP1" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xf", "dev_addr":"0x48", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "TEMP2" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xf", "dev_addr":"0x49", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "TEMP3" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xf", "dev_addr":"0x4A", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "TEMP4" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xf", "dev_addr":"0x4B", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "FAN-CTRL": + { + "dev_info": { "device_type":"FAN", "device_name":"FAN-CTRL", "device_parent":"MUX2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xb", "dev_addr":"0x66", "dev_type":"fan_ctrl"}, + "dev_attr": { "num_fantrays":"5"}, + "attr_list": + [ + { "attr_name":"fan1_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan2_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan3_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan4_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan5_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan6_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan7_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan8_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan9_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan10_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan11_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan12_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0f", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan1_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"fan2_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"fan3_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"fan4_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"fan5_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"fan6_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"fan7_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"fan8_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"fan9_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan10_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan11_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"fan12_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"fan1_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x12", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan2_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x22", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan3_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x13", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan4_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x23", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan5_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x14", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan6_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x24", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan7_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x15", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan8_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x25", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan9_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x16", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan10_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x26", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan11_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x17", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan12_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x27", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan1_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan2_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan3_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan4_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan5_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan6_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan7_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan8_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan9_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan10_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan11_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" }, + { "attr_name":"fan12_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0xF", "attr_len":"1" } + ] + } + }, + "PORT57": + { + "dev_info": { "device_type":"SFP", "device_name":"PORT57", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"57"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT57-EEPROM" }, + { "itf":"control", "dev":"PORT57-CTRL" } + ] + } + }, + "PORT57-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT57-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT57"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT57-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT57-CTRL", "device_parent":"MUX3", "virt_parent":"PORT57"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1c", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + "PORT58": + { + "dev_info": { "device_type":"SFP", "device_name":"PORT58", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"58"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT58-EEPROM" }, + { "itf":"control", "dev":"PORT58-CTRL" } + ] + } + }, + "PORT58-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT58-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT58"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT58-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT58-CTRL", "device_parent":"MUX3", "virt_parent":"PORT58"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1c", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + "MUX5": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX5", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x21", "dev_addr":"0x71", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x29", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT2" }, + { "chn":"1", "dev":"PORT1" }, + { "chn":"2", "dev":"PORT4" }, + { "chn":"3", "dev":"PORT3" }, + { "chn":"4", "dev":"PORT6" }, + { "chn":"5", "dev":"PORT7" }, + { "chn":"6", "dev":"PORT5" }, + { "chn":"7", "dev":"PORT9" } + ] + } + }, + "MUX6": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX6", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x22", "dev_addr":"0x72", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x31", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT10" }, + { "chn":"1", "dev":"PORT8" }, + { "chn":"2", "dev":"PORT12" }, + { "chn":"3", "dev":"PORT11" }, + { "chn":"4", "dev":"PORT13" }, + { "chn":"5", "dev":"PORT16" }, + { "chn":"6", "dev":"PORT15" }, + { "chn":"7", "dev":"PORT14" } + ] + } + }, + "MUX7": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX7", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x23", "dev_addr":"0x73", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x39", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT18" }, + { "chn":"1", "dev":"PORT17" }, + { "chn":"2", "dev":"PORT20" }, + { "chn":"3", "dev":"PORT19" }, + { "chn":"4", "dev":"PORT21" }, + { "chn":"5", "dev":"PORT23" }, + { "chn":"6", "dev":"PORT22" }, + { "chn":"7", "dev":"PORT24" } + ] + } + }, + "MUX8": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX8", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x24", "dev_addr":"0x74", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x41", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT27" }, + { "chn":"1", "dev":"PORT25" }, + { "chn":"2", "dev":"PORT28" }, + { "chn":"3", "dev":"PORT26" }, + { "chn":"4", "dev":"PORT29" }, + { "chn":"5", "dev":"PORT32" }, + { "chn":"6", "dev":"PORT30" }, + { "chn":"7", "dev":"PORT31" } + ] + } + }, + "MUX9": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX9", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x25", "dev_addr":"0x75", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x49", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT34" }, + { "chn":"1", "dev":"PORT33" }, + { "chn":"2", "dev":"PORT36" }, + { "chn":"3", "dev":"PORT35" }, + { "chn":"4", "dev":"PORT37" }, + { "chn":"5", "dev":"PORT39" }, + { "chn":"6", "dev":"PORT38" }, + { "chn":"7", "dev":"PORT40" } + ] + } + }, + "MUX10": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX10", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x26", "dev_addr":"0x76", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x51", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT41" }, + { "chn":"1", "dev":"PORT42" }, + { "chn":"2", "dev":"PORT45" }, + { "chn":"3", "dev":"PORT43" }, + { "chn":"4", "dev":"PORT44" }, + { "chn":"5", "dev":"PORT48" }, + { "chn":"6", "dev":"PORT46" }, + { "chn":"7", "dev":"PORT47" } + ] + } + }, + "MUX11": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX11", "device_parent":"MUX3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x18", "dev_addr":"0x72", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x19", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT49" }, + { "chn":"1", "dev":"PORT50" }, + { "chn":"2", "dev":"PORT51" }, + { "chn":"3", "dev":"PORT52" }, + { "chn":"4", "dev":"PORT53" }, + { "chn":"5", "dev":"PORT54" }, + { "chn":"6", "dev":"PORT55" }, + { "chn":"7", "dev":"PORT56" } + ] + } + }, + + + + "PORT2": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT2", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"2"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT2-EEPROM" }, + { "itf":"control", "dev":"PORT2-CTRL" } + ] + } + }, + "PORT2-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT2-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x29", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT2-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT2-CTRL", "device_parent":"MUX5", "virt_parent":"PORT2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x29", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xb", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + "PORT1": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT1", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"1"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT1-EEPROM" }, + { "itf":"control", "dev":"PORT1-CTRL" } + ] + } + }, + "PORT1-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT1-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT1-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT1-CTRL", "device_parent":"MUX5", "virt_parent":"PORT1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xb", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + "PORT4": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT4", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"4"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT4-EEPROM" }, + { "itf":"control", "dev":"PORT4-CTRL" } + ] + } + }, + "PORT4-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT4-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT4-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT4-CTRL", "device_parent":"MUX5", "virt_parent":"PORT4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + "PORT3": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT3", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"3"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT3-EEPROM" }, + { "itf":"control", "dev":"PORT3-CTRL" } + ] + } + }, + "PORT3-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT3-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT3-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT3-CTRL", "device_parent":"MUX5", "virt_parent":"PORT3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + "PORT6": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT6", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"6"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT6-EEPROM" }, + { "itf":"control", "dev":"PORT6-CTRL" } + ] + } + }, + "PORT6-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT6-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT6"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT6-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT6-CTRL", "device_parent":"MUX5", "virt_parent":"PORT6"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + "PORT7": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT7", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"7"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT7-EEPROM" }, + { "itf":"control", "dev":"PORT7-CTRL" } + ] + } + }, + "PORT7-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT7-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT7"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT7-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT7-CTRL", "device_parent":"MUX5", "virt_parent":"PORT7"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + "PORT5": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT5", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"5"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT5-EEPROM" }, + { "itf":"control", "dev":"PORT5-CTRL" } + ] + } + }, + "PORT5-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT5-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT5-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT5-CTRL", "device_parent":"MUX5", "virt_parent":"PORT5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0xB", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + "PORT9": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT9", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"9"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT9-EEPROM" }, + { "itf":"control", "dev":"PORT9-CTRL" } + ] + } + }, + "PORT9-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT9-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT9"}, + "i2c": + { + "topo_info": { "parent_bus":"0x30", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT9-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT9-CTRL", "device_parent":"MUX5", "virt_parent":"PORT9"}, + "i2c": + { + "topo_info": { "parent_bus":"0x30", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + "PORT10": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT10", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"10"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT10-EEPROM" }, + { "itf":"control", "dev":"PORT10-CTRL" } + ] + } + }, + "PORT10-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT10-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT10"}, + "i2c": + { + "topo_info": { "parent_bus":"0x31", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT10-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT10-CTRL", "device_parent":"MUX6", "virt_parent":"PORT10"}, + "i2c": + { + "topo_info": { "parent_bus":"0x31", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + "PORT8": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT8", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"8"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT8-EEPROM" }, + { "itf":"control", "dev":"PORT8-CTRL" } + ] + } + }, + "PORT8-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT8-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT8"}, + "i2c": + { + "topo_info": { "parent_bus":"0x32", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT8-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT8-CTRL", "device_parent":"MUX6", "virt_parent":"PORT8"}, + "i2c": + { + "topo_info": { "parent_bus":"0x32", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xF", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x3", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x7", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xB", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + "PORT12": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT12", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"12"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT12-EEPROM" }, + { "itf":"control", "dev":"PORT12-CTRL" } + ] + } + }, + "PORT12-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT12-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT12"}, + "i2c": + { + "topo_info": { "parent_bus":"0x33", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT12-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT12-CTRL", "device_parent":"MUX6", "virt_parent":"PORT12"}, + "i2c": + { + "topo_info": { "parent_bus":"0x33", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + "PORT11": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT11", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"11"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT11-EEPROM" }, + { "itf":"control", "dev":"PORT11-CTRL" } + ] + } + }, + "PORT11-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT11-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT11"}, + "i2c": + { + "topo_info": { "parent_bus":"0x34", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT11-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT11-CTRL", "device_parent":"MUX6", "virt_parent":"PORT11"}, + "i2c": + { + "topo_info": { "parent_bus":"0x34", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + "PORT13": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT13", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"13"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT13-EEPROM" }, + { "itf":"control", "dev":"PORT13-CTRL" } + ] + } + }, + "PORT13-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT13-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT13"}, + "i2c": + { + "topo_info": { "parent_bus":"0x35", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT13-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT13-CTRL", "device_parent":"MUX6", "virt_parent":"PORT13"}, + "i2c": + { + "topo_info": { "parent_bus":"0x35", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + "PORT16": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT16", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"16"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT16-EEPROM" }, + { "itf":"control", "dev":"PORT16-CTRL" } + ] + } + }, + "PORT16-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT16-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT16"}, + "i2c": + { + "topo_info": { "parent_bus":"0x36", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT16-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT16-CTRL", "device_parent":"MUX6", "virt_parent":"PORT16"}, + "i2c": + { + "topo_info": { "parent_bus":"0x36", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + "PORT15": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT15", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"15"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT15-EEPROM" }, + { "itf":"control", "dev":"PORT15-CTRL" } + ] + } + }, + "PORT15-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT15-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT15"}, + "i2c": + { + "topo_info": { "parent_bus":"0x37", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT15-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT15-CTRL", "device_parent":"MUX6", "virt_parent":"PORT15"}, + "i2c": + { + "topo_info": { "parent_bus":"0x37", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + "PORT14": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT14", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"14"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT14-EEPROM" }, + { "itf":"control", "dev":"PORT14-CTRL" } + ] + } + }, + "PORT14-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT14-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT14"}, + "i2c": + { + "topo_info": { "parent_bus":"0x38", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT14-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT14-CTRL", "device_parent":"MUX6", "virt_parent":"PORT14"}, + "i2c": + { + "topo_info": { "parent_bus":"0x38", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x4", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xC", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + "PORT18": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT18", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"18"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT18-EEPROM" }, + { "itf":"control", "dev":"PORT18-CTRL" } + ] + } + }, + "PORT18-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT18-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT18"}, + "i2c": + { + "topo_info": { "parent_bus":"0x39", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT18-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT18-CTRL", "device_parent":"MUX7", "virt_parent":"PORT18"}, + "i2c": + { + "topo_info": { "parent_bus":"0x39", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT17": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT17", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"17"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT17-EEPROM" }, + { "itf":"control", "dev":"PORT17-CTRL" } + ] + } + }, + "PORT17-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT17-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT17"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3a", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT17-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT17-CTRL", "device_parent":"MUX7", "virt_parent":"PORT17"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT20": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT20", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"20"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT20-EEPROM" }, + { "itf":"control", "dev":"PORT20-CTRL" } + ] + } + }, + "PORT20-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT20-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT20"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3b", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT20-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT20-CTRL", "device_parent":"MUX7", "virt_parent":"PORT20"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT19": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT19", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"19"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT19-EEPROM" }, + { "itf":"control", "dev":"PORT19-CTRL" } + ] + } + }, + "PORT19-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT19-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT19"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3c", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT19-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT19-CTRL", "device_parent":"MUX7", "virt_parent":"PORT19"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT21": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT21", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"21"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT21-EEPROM" }, + { "itf":"control", "dev":"PORT21-CTRL" } + ] + } + }, + "PORT21-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT21-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT21"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3d", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT21-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT21-CTRL", "device_parent":"MUX7", "virt_parent":"PORT21"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT23": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT23", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"23"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT23-EEPROM" }, + { "itf":"control", "dev":"PORT23-CTRL" } + ] + } + }, + "PORT23-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT23-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT23"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3e", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT23-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT23-CTRL", "device_parent":"MUX7", "virt_parent":"PORT23"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT22": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT22", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"22"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT22-EEPROM" }, + { "itf":"control", "dev":"PORT22-CTRL" } + ] + } + }, + "PORT22-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT22-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT22"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3f", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT22-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT22-CTRL", "device_parent":"MUX7", "virt_parent":"PORT22"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + "PORT24": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT24", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"24"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT24-EEPROM" }, + { "itf":"control", "dev":"PORT24-CTRL" } + ] + } + }, + "PORT24-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT24-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT24"}, + "i2c": + { + "topo_info": { "parent_bus":"0x40", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT24-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT24-CTRL", "device_parent":"MUX7", "virt_parent":"PORT24"}, + "i2c": + { + "topo_info": { "parent_bus":"0x40", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x5", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x9", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xD", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + "PORT27": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT27", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"27"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT27-EEPROM" }, + { "itf":"control", "dev":"PORT27-CTRL" } + ] + } + }, + "PORT27-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT27-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT27"}, + "i2c": + { + "topo_info": { "parent_bus":"0x41", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT27-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT27-CTRL", "device_parent":"MUX8", "virt_parent":"PORT27"}, + "i2c": + { + "topo_info": { "parent_bus":"0x41", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + "PORT25": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT25", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"25"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT25-EEPROM" }, + { "itf":"control", "dev":"PORT25-CTRL" } + ] + } + }, + "PORT25-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT25-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT25"}, + "i2c": + { + "topo_info": { "parent_bus":"0x42", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT25-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT25-CTRL", "device_parent":"MUX8", "virt_parent":"PORT25"}, + "i2c": + { + "topo_info": { "parent_bus":"0x42", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT28": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT28", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"28"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT28-EEPROM" }, + { "itf":"control", "dev":"PORT28-CTRL" } + ] + } + }, + "PORT28-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT28-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT28"}, + "i2c": + { + "topo_info": { "parent_bus":"0x43", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT28-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT28-CTRL", "device_parent":"MUX8", "virt_parent":"PORT28"}, + "i2c": + { + "topo_info": { "parent_bus":"0x43", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + "PORT26": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT26", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"26"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT26-EEPROM" }, + { "itf":"control", "dev":"PORT26-CTRL" } + ] + } + }, + "PORT26-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT26-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT26"}, + "i2c": + { + "topo_info": { "parent_bus":"0x44", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT26-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT26-CTRL", "device_parent":"MUX8", "virt_parent":"PORT26"}, + "i2c": + { + "topo_info": { "parent_bus":"0x44", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + "PORT29": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT29", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"29"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT29-EEPROM" }, + { "itf":"control", "dev":"PORT29-CTRL" } + ] + } + }, + "PORT29-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT29-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT29"}, + "i2c": + { + "topo_info": { "parent_bus":"0x45", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT29-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT29-CTRL", "device_parent":"MUX8", "virt_parent":"PORT29"}, + "i2c": + { + "topo_info": { "parent_bus":"0x45", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT32": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT32", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"32"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT32-EEPROM" }, + { "itf":"control", "dev":"PORT32-CTRL" } + ] + } + }, + "PORT32-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT32-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT32"}, + "i2c": + { + "topo_info": { "parent_bus":"0x46", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT32-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT32-CTRL", "device_parent":"MUX8", "virt_parent":"PORT32"}, + "i2c": + { + "topo_info": { "parent_bus":"0x46", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + "PORT30": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT30", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"30"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT30-EEPROM" }, + { "itf":"control", "dev":"PORT30-CTRL" } + ] + } + }, + "PORT30-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT30-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT30"}, + "i2c": + { + "topo_info": { "parent_bus":"0x47", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT30-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT30-CTRL", "device_parent":"MUX8", "virt_parent":"PORT30"}, + "i2c": + { + "topo_info": { "parent_bus":"0x47", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x6", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xA", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0xE", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT31": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT31", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"31"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT31-EEPROM" }, + { "itf":"control", "dev":"PORT31-CTRL" } + ] + } + }, + "PORT31-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT31-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT31"}, + "i2c": + { + "topo_info": { "parent_bus":"0x48", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT31-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT31-CTRL", "device_parent":"MUX8", "virt_parent":"PORT31"}, + "i2c": + { + "topo_info": { "parent_bus":"0x48", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT34": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT34", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"34"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT34-EEPROM" }, + { "itf":"control", "dev":"PORT34-CTRL" } + ] + } + }, + "PORT34-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT34-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT34"}, + "i2c": + { + "topo_info": { "parent_bus":"0x49", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT34-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT34-CTRL", "device_parent":"MUX9", "virt_parent":"PORT34"}, + "i2c": + { + "topo_info": { "parent_bus":"0x49", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT33": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT33", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"33"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT33-EEPROM" }, + { "itf":"control", "dev":"PORT33-CTRL" } + ] + } + }, + "PORT33-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT33-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT33"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4a", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT33-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT33-CTRL", "device_parent":"MUX9", "virt_parent":"PORT33"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT36": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT36", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"36"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT36-EEPROM" }, + { "itf":"control", "dev":"PORT36-CTRL" } + ] + } + }, + "PORT36-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT36-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT36"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4b", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT36-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT36-CTRL", "device_parent":"MUX9", "virt_parent":"PORT36"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT35": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT35", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"35"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT35-EEPROM" }, + { "itf":"control", "dev":"PORT35-CTRL" } + ] + } + }, + "PORT35-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT35-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT35"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4c", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT35-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT35-CTRL", "device_parent":"MUX9", "virt_parent":"PORT35"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT37": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT37", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"37"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT37-EEPROM" }, + { "itf":"control", "dev":"PORT37-CTRL" } + ] + } + }, + "PORT37-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT37-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT37"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4d", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT37-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT37-CTRL", "device_parent":"MUX9", "virt_parent":"PORT37"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT39": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT39", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"39"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT39-EEPROM" }, + { "itf":"control", "dev":"PORT39-CTRL" } + ] + } + }, + "PORT39-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT39-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT39"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4e", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT39-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT39-CTRL", "device_parent":"MUX9", "virt_parent":"PORT39"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT38": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT38", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"38"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT38-EEPROM" }, + { "itf":"control", "dev":"PORT38-CTRL" } + ] + } + }, + "PORT38-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT38-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT38"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4f", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT38-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT38-CTRL", "device_parent":"MUX9", "virt_parent":"PORT38"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1A", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x14", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x17", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + + "PORT40": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT40", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"40"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT40-EEPROM" }, + { "itf":"control", "dev":"PORT40-CTRL" } + ] + } + }, + "PORT40-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT40-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT40"}, + "i2c": + { + "topo_info": { "parent_bus":"0x50", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT40-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT40-CTRL", "device_parent":"MUX9", "virt_parent":"PORT40"}, + "i2c": + { + "topo_info": { "parent_bus":"0x50", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + "PORT41": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT41", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"41"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT41-EEPROM" }, + { "itf":"control", "dev":"PORT41-CTRL" } + ] + } + }, + "PORT41-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT41-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT41"}, + "i2c": + { + "topo_info": { "parent_bus":"0x51", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT41-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT41-CTRL", "device_parent":"MUX10", "virt_parent":"PORT41"}, + "i2c": + { + "topo_info": { "parent_bus":"0x51", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + "PORT42": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT42", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"42"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT42-EEPROM" }, + { "itf":"control", "dev":"PORT42-CTRL" } + ] + } + }, + "PORT42-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT42-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT42"}, + "i2c": + { + "topo_info": { "parent_bus":"0x52", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT42-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT42-CTRL", "device_parent":"MUX10", "virt_parent":"PORT42"}, + "i2c": + { + "topo_info": { "parent_bus":"0x52", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + "PORT45": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT45", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"45"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT45-EEPROM" }, + { "itf":"control", "dev":"PORT45-CTRL" } + ] + } + }, + "PORT45-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT45-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT45"}, + "i2c": + { + "topo_info": { "parent_bus":"0x53", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT45-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT45-CTRL", "device_parent":"MUX10", "virt_parent":"PORT45"}, + "i2c": + { + "topo_info": { "parent_bus":"0x53", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + "PORT43": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT43", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"43"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT43-EEPROM" }, + { "itf":"control", "dev":"PORT43-CTRL" } + ] + } + }, + "PORT43-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT43-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT43"}, + "i2c": + { + "topo_info": { "parent_bus":"0x54", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT43-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT43-CTRL", "device_parent":"MUX10", "virt_parent":"PORT43"}, + "i2c": + { + "topo_info": { "parent_bus":"0x54", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + "PORT44": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT44", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"44"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT44-EEPROM" }, + { "itf":"control", "dev":"PORT44-CTRL" } + ] + } + }, + "PORT44-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT44-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT44"}, + "i2c": + { + "topo_info": { "parent_bus":"0x55", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT44-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT44-CTRL", "device_parent":"MUX10", "virt_parent":"PORT44"}, + "i2c": + { + "topo_info": { "parent_bus":"0x55", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1B", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1","attr_offset":"0x15", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x18", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + "PORT48": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT48", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"48"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT48-EEPROM" }, + { "itf":"control", "dev":"PORT48-CTRL" } + ] + } + }, + "PORT48-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT48-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT48"}, + "i2c": + { + "topo_info": { "parent_bus":"0x56", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT48-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT48-CTRL", "device_parent":"MUX10", "virt_parent":"PORT48"}, + "i2c": + { + "topo_info": { "parent_bus":"0x56", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1C", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + "PORT46": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT46", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"46"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT46-EEPROM" }, + { "itf":"control", "dev":"PORT46-CTRL" } + ] + } + }, + "PORT46-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT46-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT46"}, + "i2c": + { + "topo_info": { "parent_bus":"0x57", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT46-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT46-CTRL", "device_parent":"MUX10", "virt_parent":"PORT46"}, + "i2c": + { + "topo_info": { "parent_bus":"0x57", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1","attr_offset":"0x1B", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0x15", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1","attr_offset":"0x18", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + "PORT47": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT47", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"47"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT47-EEPROM" }, + { "itf":"control", "dev":"PORT47-CTRL" } + ] + } + }, + "PORT47-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT47-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT47"}, + "i2c": + { + "topo_info": { "parent_bus":"0x58", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT47-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT47-CTRL", "device_parent":"MUX10", "virt_parent":"PORT47"}, + "i2c": + { + "topo_info": { "parent_bus":"0x58", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1C", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x16", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x19", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT49": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT49", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"49"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT49-EEPROM" }, + { "itf":"control", "dev":"PORT49-CTRL" } + ] + } + }, + "PORT49-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT49-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT49"}, + "i2c": + { + "topo_info": { "parent_bus":"0x19", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT49-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT49-CTRL", "device_parent":"MUX11", "virt_parent":"PORT49"}, + "i2c": + { + "topo_info": { "parent_bus":"0x19", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT50": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT50", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"50"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT50-EEPROM" }, + { "itf":"control", "dev":"PORT50-CTRL" } + ] + } + }, + "PORT50-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT50-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT50"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT50-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT50-CTRL", "device_parent":"MUX11", "virt_parent":"PORT50"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT51": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT51", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"51"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT51-EEPROM" }, + { "itf":"control", "dev":"PORT51-CTRL" } + ] + } + }, + "PORT51-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT51-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT51"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT51-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT51-CTRL", "device_parent":"MUX11", "virt_parent":"PORT51"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT52": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT52", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"52"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT52-EEPROM" }, + { "itf":"control", "dev":"PORT52-CTRL" } + ] + } + }, + "PORT52-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT52-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT52"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT52-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT52-CTRL", "device_parent":"MUX11", "virt_parent":"PORT52"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT53": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT53", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"53"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT53-EEPROM" }, + { "itf":"control", "dev":"PORT53-CTRL" } + ] + } + }, + "PORT53-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT53-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT53"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT53-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT53-CTRL", "device_parent":"MUX11", "virt_parent":"PORT53"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT54": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT54", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"54"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT54-EEPROM" }, + { "itf":"control", "dev":"PORT54-CTRL" } + ] + } + }, + "PORT54-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT54-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT54"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1e", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT54-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT54-CTRL", "device_parent":"MUX11", "virt_parent":"PORT54"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT55": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT55", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"55"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT55-EEPROM" }, + { "itf":"control", "dev":"PORT55-CTRL" } + ] + } + }, + "PORT55-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT55-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT55"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1f", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT55-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT55-CTRL", "device_parent":"MUX11", "virt_parent":"PORT55"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + + "PORT56": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT56", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"56"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT56-EEPROM" }, + { "itf":"control", "dev":"PORT56-CTRL" } + ] + } + }, + "PORT56-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT56-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT56"}, + "i2c": + { + "topo_info": { "parent_bus":"0x20", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT56-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT56-CTRL", "device_parent":"MUX11", "virt_parent":"PORT56"}, + "i2c": + { + "topo_info": { "parent_bus":"0x20", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x4", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld","attr_devname":"CPLD1", "attr_offset":"0xA", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"} + + ] + } + }, + "LOC_LED": + { + "dev_info": { "device_type":"LED", "device_name":"LOC_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : + { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_BLUE_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x27", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, + {"attr_name":"STATUS_LED_COLOR_GREEN_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x17", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, + {"attr_name":"STATUS_LED_COLOR_AMBER_BLINK", "descr": "" , "bits" : "5:0", "value" : "0xf", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, + {"attr_name":"STATUS_LED_COLOR_BLUE", "descr": "" , "bits" : "5:0", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, + {"attr_name":"STATUS_LED_COLOR_GREEN", "descr": "" , "bits" : "5:0", "value" : "0x5", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, + {"attr_name":"STATUS_LED_COLOR_AMBER", "descr": "" , "bits" : "5:0", "value" : "0x6", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "descr": "" , "bits" : "5:0", "value" : "0xf", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"} + ] + } + }, + "DIAG_LED": + { + "dev_info": { "device_type":"LED", "device_name":"DIAG_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : + { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_BLUE_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x27", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, + {"attr_name":"STATUS_LED_COLOR_GREEN_BLINK", "descr": "" , "bits" : "5:0", "value" : "0x17", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, + {"attr_name":"STATUS_LED_COLOR_AMBER_BLINK", "descr": "" , "bits" : "5:0", "value" : "0xf", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, + {"attr_name":"STATUS_LED_COLOR_BLUE", "descr": "" , "bits" : "5:0", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, + {"attr_name":"STATUS_LED_COLOR_GREEN", "descr": "" , "bits" : "5:0", "value" : "0x5", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, + {"attr_name":"STATUS_LED_COLOR_AMBER", "descr": "" , "bits" : "5:0", "value" : "0x6", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "descr": "" , "bits" : "5:0", "value" : "0x7", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x24"} + + ] + } + } +} diff --git a/device/accton/x86_64-accton_as7326_56x-r0/pddf_support b/device/accton/x86_64-accton_as7326_56x-r0/pddf_support new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json index 4d253635cc95..7df46b922ec3 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json +++ b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json @@ -48,7 +48,7 @@ "duty_cycle_to_pwm": "lambda dc: ((dc*100.0)/625 - 1)", - "pwm_to_duty_cycle": "lambda pwm: math.ceil(((pwm+1)*625.0)/100)" + "pwm_to_duty_cycle": "lambda pwm: (((pwm+1)*625.0)/100)" } } diff --git a/device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json new file mode 100644 index 000000000000..eae22f99e394 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/pddf/pd-plugin.json @@ -0,0 +1,64 @@ +{ + + "XCVR": + { + "xcvr_present": + { + "i2c": + { + "valmap-QSFP28": {"1":true, "0":false} + } + } + }, + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } + } + }, + + "PSU_FAN_MAX_SPEED":"18000" + }, + + "FAN": + { + "direction": + { + "i2c": + { + "valmap": {"1":"INTAKE", "0":"EXHAUST"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + } + }, + + "duty_cycle_to_pwm": "lambda dc: ((dc - 10) / 6)", + "pwm_to_duty_cycle": "lambda pwm: ( (pwm * 6) + 10)" + } + +} diff --git a/device/accton/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json index 12d6c3a115e2..27d181da1829 100644 --- a/device/accton/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json @@ -114,7 +114,7 @@ "i2c": { "topo_info": { "parent_bus":"0x0", "dev_addr":"0x77", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x1"}, + "dev_attr": { "virt_bus":"0x1", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"MUX2" }, @@ -137,7 +137,7 @@ "i2c": { "topo_info": { "parent_bus":"0x1", "dev_addr":"0x71", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x9"}, + "dev_attr": { "virt_bus":"0x9", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PSU2"}, @@ -249,7 +249,7 @@ "i2c": { "topo_info": { "parent_bus":"0x1", "dev_addr":"0x76", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x11"}, + "dev_attr": { "virt_bus":"0x11", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"TEMP1" }, @@ -464,7 +464,7 @@ "i2c": { "topo_info": { "parent_bus":"0x1", "dev_addr":"0x73", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x19"}, + "dev_attr": { "virt_bus":"0x19", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT61" }, @@ -484,7 +484,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x70", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x21"}, + "dev_attr": { "virt_bus":"0x21", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT9" }, @@ -504,7 +504,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x71", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x29"}, + "dev_attr": { "virt_bus":"0x29", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT6" }, @@ -524,7 +524,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x72", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x31"}, + "dev_attr": { "virt_bus":"0x31", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT17" }, @@ -544,7 +544,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x73", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x39"}, + "dev_attr": { "virt_bus":"0x39", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT29" }, @@ -564,7 +564,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x74", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x41"}, + "dev_attr": { "virt_bus":"0x41", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT41" }, @@ -584,7 +584,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x75", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x49"}, + "dev_attr": { "virt_bus":"0x49", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT45" }, @@ -604,7 +604,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x76", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x51"}, + "dev_attr": { "virt_bus":"0x51", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT57" }, diff --git a/device/accton/x86_64-accton_as7816_64x-r0/pddf_support b/device/accton/x86_64-accton_as7816_64x-r0/pddf_support new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service new file mode 120000 index 000000000000..0fd9f25b6c5e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py index 553325484a92..59dad237f3b4 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py @@ -1,23 +1,14 @@ from setuptools import setup -DEVICE_NAME = 'accton' -HW_SKU = 'x86_64-accton_as4630_54pe-r0' - setup( name='sonic-platform', version='1.0', - description='SONiC platform API implementation on Accton Platforms', + description='SONiC platform API implementation on Accton Platforms using PDDF', 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)}, + packages=['sonic_platform'], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/Makefile index 85c066571c2f..6789630def0b 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/Makefile @@ -1,7 +1,12 @@ ifneq ($(KERNELRELEASE),) obj-m:= accton_i2c_cpld.o \ accton_as7326_56x_fan.o accton_as7326_56x_leds.o \ - accton_as7326_56x_psu.o ym2651y.o + accton_as7326_56x_psu.o ym2651y.o \ + pddf_custom_psu.o + + +CFLAGS_pddf_custom_psu.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF else ifeq (,$(KERNEL_SRC)) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/pddf_custom_psu.c b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/pddf_custom_psu.c new file mode 100644 index 000000000000..18c3edf72a8c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/pddf_custom_psu.c @@ -0,0 +1,206 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pddf_psu_defs.h" + +ssize_t pddf_get_custom_psu_model_name(struct device *dev, struct device_attribute *da, char *buf); +ssize_t pddf_get_custom_psu_serial_num(struct device *dev, struct device_attribute *da, char *buf); +extern PSU_SYSFS_ATTR_DATA access_psu_model_name; +extern PSU_SYSFS_ATTR_DATA access_psu_serial_num; + +#define MAX_MODEL_NAME 16 +#define MAX_SERIAL_NUMBER 19 + +enum psu_type { + PSU_TYPE_AC_110V, + PSU_TYPE_DC_48V, + PSU_TYPE_DC_12V, + PSU_TYPE_AC_ACBEL_FSF019, + PSU_TYPE_AC_ACBEL_FSF045 +}; + +struct model_name_info { + enum psu_type type; + u8 offset; + u8 length; + u8 chk_length; + char* model_name; +}; + +struct serial_number_info { + enum psu_type type; + u8 offset; + u8 length; + u8 chk_length; + char* serial_number; +}; + +struct model_name_info models[] = { +{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"}, +{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"}, +{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"}, +{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}, +{PSU_TYPE_AC_ACBEL_FSF045, 0x15, 10, 7, "FSF045-"} + +}; + +struct serial_number_info serials[] = { +{PSU_TYPE_AC_110V, 0x2e, 18, 18, "YM-2651Y"}, +{PSU_TYPE_DC_48V, 0x2e, 18, 18, "YM-2651V"}, +{PSU_TYPE_DC_12V, 0x2e, 18, 18, "PSU-12V-750"}, +{PSU_TYPE_AC_ACBEL_FSF019, 0x2e, 16, 16, "FSF019-"}, +{PSU_TYPE_AC_ACBEL_FSF019, 0x2e, 16, 16, "FSF045-"} + +}; + +struct pddf_psu_data { + char model_name[MAX_MODEL_NAME+1]; + char serial_number[MAX_SERIAL_NUMBER+1]; +}; + + +static int pddf_psu_read_block(struct i2c_client *client, u8 command, u8 *data, + int data_len) +{ + int result = 0; + int retry_count = 10; + + 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; +} + +ssize_t pddf_get_custom_psu_serial_num(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct pddf_psu_data data; + int i, status; + + for (i = 0; i < ARRAY_SIZE(models); i++) { + memset(data.serial_number, 0, sizeof(data.serial_number)); + + status = pddf_psu_read_block(client, models[i].offset, + data.model_name, models[i].length); + if (status < 0) { + data.model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x) offset(0x%x)\n", + client->addr, models[i].offset); + return status; + } + else { + data.model_name[models[i].length] = '\0'; + } + + /* Determine if the model name is known, if not, read next index + */ + if (strncmp(data.model_name, models[i].model_name, models[i].chk_length) == 0) { + status = pddf_psu_read_block(client, serials[i].offset, + data.serial_number, serials[i].length); + + if (status < 0) { + data.serial_number[0] = '\0'; + dev_dbg(&client->dev, "unable to read serial num from (0x%x) offset(0x%x)\n", + client->addr, serials[i].offset); + return status; + } + else { + data.serial_number[serials[i].length] = '\0'; + return sprintf(buf, "%s\n", data.serial_number); + } + + return 0; + } + else { + data.serial_number[0] = '\0'; + } + } + + return -ENODATA; + + +} + +ssize_t pddf_get_custom_psu_model_name(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct pddf_psu_data data; + int i, status; + + for (i = 0; i < ARRAY_SIZE(models); i++) { + memset(data.model_name, 0, sizeof(data.model_name)); + + status = pddf_psu_read_block(client, models[i].offset, + data.model_name, models[i].length); + if (status < 0) { + data.model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x) offset(0x%x)\n", + client->addr, models[i].offset); + return status; + } + else { + data.model_name[models[i].length] = '\0'; + } + + /* Determine if the model name is known, if not, read next index + */ + if (strncmp(data.model_name, models[i].model_name, models[i].chk_length) == 0) { + return sprintf(buf, "%s\n", data.model_name); + } + else { + data.model_name[0] = '\0'; + } + } + + return -ENODATA; + +} + +static int __init pddf_custom_psu_init(void) +{ + access_psu_serial_num.show = pddf_get_custom_psu_serial_num; + access_psu_serial_num.do_get = NULL; + + access_psu_model_name.show = pddf_get_custom_psu_model_name; + access_psu_model_name.do_get = NULL; + + return 0; +} + +static void __exit pddf_custom_psu_exit(void) +{ + return; +} + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("pddf custom psu api"); +MODULE_LICENSE("GPL"); + +module_init(pddf_custom_psu_init); +module_exit(pddf_custom_psu_exit); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service new file mode 100644 index 000000000000..03351824b7b4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/as7326-56x-pddf-platform-monitor.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS7326-56X Platform Monitoring service +Before=pmon.service +After=pddf-platform-init.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as7326_pddf_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service new file mode 120000 index 000000000000..0fd9f25b6c5e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py index 15806d24fff0..22bd354ea686 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/sonic_platform_setup.py @@ -1,8 +1,5 @@ from setuptools import setup -DEVICE_NAME = 'accton' -HW_SKU = 'x86_64-accton_as7326_56x-r0' - setup( name='sonic-platform', version='1.0', @@ -11,11 +8,7 @@ author='SONiC Team', author_email='linuxnetdev@microsoft.com', url='https://github.com/Azure/sonic-buildimage', - packages=[ - 'sonic_platform' - ], - package_dir={ - 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + packages=['sonic_platform'], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pddf_post_driver_install.sh new file mode 100755 index 000000000000..b2dc4ded1f6d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pddf_post_driver_install.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +dis_i2c_ir3570a() +{ + local addr=$1 + + i2cset -y -a 0 $addr 0xE5 0x01 &>/dev/null + i2cset -y -a 0 $addr 0x12 0x02 &>/dev/null +} + + +ir3570_check() +{ + dump=`i2cdump -y 0 0x42 s 0x9a |awk 'END {print $2}'` + if [ $dump -eq 24 ]; then + echo "Disabling i2c function of ir3570a" + dis_i2c_ir3570a 0x4 + fi +} + +ir3570_check + +echo "AS7326 post PDDF driver install completed" diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/pddf_post_driver_install.sh index c33f0b0c9797..484e5c976b4c 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/pddf_post_driver_install.sh +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/pddf_post_driver_install.sh @@ -4,8 +4,8 @@ dis_i2c_ir3570a() { local addr=$1 - i2cset -y 0 $addr 0xE5 0x01 &>/dev/null - i2cset -y 0 $addr 0x12 0x02 &>/dev/null + i2cset -y -a 0 $addr 0xE5 0x01 &>/dev/null + i2cset -y -a 0 $addr 0x12 0x02 &>/dev/null } diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service new file mode 100644 index 000000000000..7b6db7ddac01 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/as7816-pddf-platform-monitor.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS7816-64X Platform Monitoring service +Before=pmon.service +After=pddf-platform-init.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as7816_pddf_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service new file mode 120000 index 000000000000..0fd9f25b6c5e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py index 607a9ef78dd9..22bd354ea686 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/sonic_platform_setup.py @@ -1,8 +1,5 @@ from setuptools import setup -DEVICE_NAME = 'accton' -HW_SKU = 'x86_64-accton_as7816_64x-r0' - setup( name='sonic-platform', version='1.0', @@ -11,13 +8,7 @@ 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)}, + packages=['sonic_platform'], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pddf_post_driver_install.sh new file mode 100755 index 000000000000..9783c323b606 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pddf_post_driver_install.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +dis_i2c_ir3570a() +{ + local addr=$1 + + i2cset -y -a 0 $addr 0xE5 0x01 &>/dev/null + i2cset -y -a 0 $addr 0x12 0x02 &>/dev/null +} + + +ir3570_check() +{ + dump=`i2cdump -y 0 0x42 s 0x9a |awk 'END {print $2}'` + if [ $dump -eq 24 ]; then + echo "Disabling i2c function of ir3570a" + dis_i2c_ir3570a 0x4 + fi +} + +ir3570_check + +echo "AS7816 post PDDF driver install completed" diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh index 484a5f039c0f..61eb4c0fd5c7 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh @@ -4,8 +4,8 @@ dis_i2c_ir3570a() { local addr=$1 - i2cset -y 0 $addr 0xE5 0x01 &>/dev/null - i2cset -y 0 $addr 0x12 0x02 &>/dev/null + i2cset -y -a 0 $addr 0xE5 0x01 &>/dev/null + i2cset -y -a 0 $addr 0x12 0x02 &>/dev/null } diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install index a87ebb5b046a..4ba26bed2625 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install @@ -1 +1 @@ -as4630-54pe/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as4630_54pe-r0 +as4630-54pe/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as4630_54pe-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst new file mode 100644 index 000000000000..23bebd3b295c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst @@ -0,0 +1,8 @@ +# Special arrangement to make PDDF mode default +# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) +# Enable pddf-platform-monitor +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service +systemctl enable as4630-54pe-pddf-platform-monitor.service +systemctl start as4630-54pe-pddf-platform-monitor.service diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install index a6b7094e0e03..1d9885d22d27 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.install @@ -1,2 +1 @@ -as7326-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7326_56x-r0 - +as7326-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.postinst index efe159144770..b1c403623c95 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.postinst +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.postinst @@ -2,6 +2,8 @@ # Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) # Enable pddf-platform-monitor depmod -a +systemctl enable as7726-32x-platform-handle_mac.service +systemctl start as7726-32x-platform-handle_mac.service systemctl enable pddf-platform-init.service systemctl start pddf-platform-init.service systemctl enable as7726-32x-pddf-platform-monitor.service diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install index 8f214208a6b8..01b33cc19e54 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.install @@ -1,2 +1 @@ -as7816-64x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7816_64x-r0 - +as7816-64x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf From 588ed0b760357ae2ba65f7789407730d2fc71ed4 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Fri, 1 Apr 2022 16:12:43 -0700 Subject: [PATCH 085/119] Upgrade router-advertiser container to Bullseye (#10374) Change the base image from `docker-config-engine-buster` to `docker-config-engine-bullseye`, and remove the hardcoded `radvd` version from the Dockerfile. Signed-off-by: Saikrishna Arcot --- dockers/docker-router-advertiser/Dockerfile.j2 | 4 ++-- rules/docker-router-advertiser.mk | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dockers/docker-router-advertiser/Dockerfile.j2 b/dockers/docker-router-advertiser/Dockerfile.j2 index 7d225cbd4e79..44e2430077cb 100644 --- a/dockers/docker-router-advertiser/Dockerfile.j2 +++ b/dockers/docker-router-advertiser/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-config-engine-bullseye ARG docker_container_name ARG image_version @@ -15,7 +15,7 @@ ENV IMAGE_VERSION=$image_version RUN apt-get update # Install radvd Debian package -RUN apt-get -y install radvd=1:2.17-2 +RUN apt-get -y install radvd {% if docker_router_advertiser_debs.strip() -%} # Copy built Debian packages diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index c2a5f9bf5d3c..6d5b9e4717bd 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -6,12 +6,12 @@ DOCKER_ROUTER_ADVERTISER_DBG = $(DOCKER_ROUTER_ADVERTISER_STEM)-$(DBG_IMAGE_MARK $(DOCKER_ROUTER_ADVERTISER)_PATH = $(DOCKERS_PATH)/$(DOCKER_ROUTER_ADVERTISER_STEM) -$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) +$(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) $(DOCKER_ROUTER_ADVERTISER)_DBG_DEPENDS += $(RADVD_DBG) -$(DOCKER_ROUTER_ADVERTISER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_ROUTER_ADVERTISER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) -$(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BUSTER) +$(DOCKER_ROUTER_ADVERTISER)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BULLSEYE) $(DOCKER_ROUTER_ADVERTISER)_VERSION = 1.0.0 $(DOCKER_ROUTER_ADVERTISER)_PACKAGE_NAME = radv @@ -29,6 +29,3 @@ $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --privileged -t $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_ROUTER_ADVERTISER)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) - -SONIC_BUSTER_DOCKERS += $(DOCKER_ROUTER_ADVERTISER) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_ROUTER_ADVERTISER_DBG) From a8f72e5d452edc85c441ef5e19125d4373de1664 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Sat, 2 Apr 2022 07:32:01 +0800 Subject: [PATCH 086/119] [yang] Update device_metadata to add dhcp_server (#10382) Why I did it dhcp_server is introduced, and need to update yang model. How I did it Update yang models and add unit test. How to verify it Run unit test for sonic-yang-models. Signed-off-by: Gang Lv ganglv@microsoft.com --- .../tests/files/sample_config_db.json | 3 ++- .../tests/device_metadata.json | 7 +++++++ .../tests_config/device_metadata.json | 18 ++++++++++++++++++ .../yang-models/sonic-device_metadata.yang | 5 +++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index d33cf20e2038..e40d75e8f2c5 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -304,7 +304,8 @@ "switch_id": "2", "switch_type": "voq", "max_cores": "8", - "sub_role": "FrondEnd" + "sub_role": "FrondEnd", + "dhcp_server": "disabled" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index ecfff6f69a6f..7f0ddd38496f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -103,6 +103,13 @@ }, "DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": { "desc": "Verifying valid sub_role configuration." + }, + "DEVICE_METADATA_VALID_DHCP_SERVER": { + "desc": "Verifying dhcp_server configuration." + }, + "DEVICE_METADATA_INVALID_DHCP_SERVER": { + "desc": "Verifying invalid dhcp_server configuration.", + "eStrKey": "InvalidValue" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index de0d4e15dcee..a921e9ef41b2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -283,5 +283,23 @@ } } } + }, + "DEVICE_METADATA_VALID_DHCP_SERVER": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "dhcp_server": "enabled" + } + } + } + }, + "DEVICE_METADATA_INVALID_DHCP_SERVER": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "dhcp_server": "invalid" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 87170850d895..618ed19cd81f 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -183,6 +183,11 @@ module sonic-device_metadata { type uint8; description "Maximum number of cores in a VoQ Switch (chassis)."; } + + leaf dhcp_server { + type stypes:admin_mode; + description "Indicate whether enable the embedded DHCP server."; + } } /* end of container localhost */ } From 12cfb2b8f4faa442353f0b31600c6d2cd0460ba6 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Sat, 2 Apr 2022 07:48:44 +0800 Subject: [PATCH 087/119] [ci] Set default ACR in UpgrateVersion/PR/official pipeline. (#10341) Why I did it docker hub will limit the pull rate. Use ACR instead to pull debian related docker image. How I did it Set DEFAULT_CONTAINER_REGISTRY in pipeline. --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 7 +++++-- .azure-pipelines/docker-sonic-slave-template.yml | 5 ++++- .azure-pipelines/official-build.yml | 11 +++++++++++ .azure-pipelines/template-clean-sonic-slave.yml | 4 +++- .azure-pipelines/template-variables.yml | 2 ++ azure-pipelines.yml | 9 +++++++++ 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .azure-pipelines/template-variables.yml diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 03593c551cff..6e11e3826e58 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -45,8 +45,11 @@ parameters: stages: - stage: Build variables: - CACHE_MODE: none - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=' + - name: CACHE_MODE + value: none + - name: VERSION_CONTROL_OPTIONS + value: 'SONIC_VERSION_CONTROL_COMPONENTS=' + - template: .azure-pipelines/template-variables.yml@buildimage jobs: - template: azure-pipelines-build.yml parameters: diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 6b4b90f371d9..2a9421dda338 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -37,7 +37,10 @@ jobs: pool: ${{ parameters.pool }} steps: - template: cleanup.yml - - template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage + - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - template: template-clean-sonic-slave.yml + - ${{ else }}: + - template: .azure-pipelines/template-variables.yml@buildimage - checkout: self clean: true submodules: recursive diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index f43c6521fc50..fb986cf67039 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -18,9 +18,20 @@ schedules: - 201911 - 201811 +resources: + repositories: + - repository: buildimage + type: github + name: Azure/sonic-buildimage + ref: master + endpoint: build + trigger: none pr: none +variables: +- template: .azure-pipelines/template-variables.yml@buildimage + stages: - stage: Build pool: sonicbld diff --git a/.azure-pipelines/template-clean-sonic-slave.yml b/.azure-pipelines/template-clean-sonic-slave.yml index c67f63fff476..ddb8c8e48f6a 100644 --- a/.azure-pipelines/template-clean-sonic-slave.yml +++ b/.azure-pipelines/template-clean-sonic-slave.yml @@ -1,8 +1,10 @@ steps: - script: | - containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }') + set -x + containers=$(docker container ls -aq) [ -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 + exit 0 displayName: 'Cleanup sonic slave' diff --git a/.azure-pipelines/template-variables.yml b/.azure-pipelines/template-variables.yml new file mode 100644 index 000000000000..f28768e39efe --- /dev/null +++ b/.azure-pipelines/template-variables.yml @@ -0,0 +1,2 @@ +variables: + DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 557ce3beff82..27836a49b1ab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,9 +30,18 @@ resources: type: github name: Azure/sonic-mgmt endpoint: build + - repository: buildimage + type: github + name: Azure/sonic-buildimage + endpoint: build + ref: master variables: - template: .azure-pipelines/azure-pipelines-repd-build-variables.yml +- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - template: .azure-pipelines/template-variables.yml +- ${{ else }}: + - template: .azure-pipelines/template-variables.yml@buildimage - name: CACHE_MODE value: rcache From 28939e95ef60e8894d81d23746807a007182ee22 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Sat, 2 Apr 2022 03:14:45 +0300 Subject: [PATCH 088/119] [submodule]: Advance sonic-swss-common and sonic-linkmgrd submodules (#10406) #### Why I did it To take the following into sonic-buildimage 36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (#587) [sonic-swss-common](https://github.com/Azure/sonic-swss-common) ``` 36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (#587) 556f4ad Add SAI copy action to ACL schema (#591) db18c3a Fix bitwidth of mac address in SAI ACL schema (#590) e9442bb [ConfigDBPipeConnector]: Added set_entry API (#586) 6c007c0 Update README for gmock (#562) ``` [sonic-linkmgrd](https://github.com/Azure/sonic-linkmgrd) ``` 83dfc99 Enforce uniform file/class naming convention (#52) 83004bf Shutdown ICMP heartbeats when default route state is missing and ToR is in `auto` mode (#44) b81ea31 Add `LinkProberStateMachineActiveActive` (#47) c43cf7a Decrease link probing interval after switchover to better determine the overhead of a toggle (#43) 2239fbe Enhance clang format (#46) ``` #### How I did it * Advanced submodules pointers #### How to verify it 1. make configure PLATFORM=mellanox 2. make target/sonic-mellanox.bin --- src/linkmgrd | 2 +- src/sonic-swss-common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linkmgrd b/src/linkmgrd index f00efefd3099..83dfc992d1b2 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit f00efefd30995de447fd6932369cb5be250ddf90 +Subproject commit 83dfc992d1b24b01bb9b125cc86a8ce63ba060f6 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 9eac0ae78093..36e1f61691df 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 9eac0ae7809350f38650ebb29456fe41a93bbf35 +Subproject commit 36e1f61691df7aa44782a377e4082cc4380f1018 From 8edc53462977accf1190822f9e19ed2d63ea712b Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Sat, 2 Apr 2022 13:53:40 +0800 Subject: [PATCH 089/119] Advance sonic-sairedis submodule (#10417) Signed-off-by: bingwang --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 1ccda8d1d982..473c99067c81 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 1ccda8d1d9821a65f73eb5c8f88f9abea0623c0b +Subproject commit 473c99067c8132f8e5b3f8f2abd672b474b42b5a From 1bf8bc6091d6e251da57bb3a7ac59c731f255003 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 2 Apr 2022 22:37:34 +0800 Subject: [PATCH 090/119] [ci] Fix the generating version file failure issue caused by artifacts folder change (#7464) (#10451) Fix the generating version file failure issue caused by artifacts folder change. When changing to use the same template for PR build, official build and packages version upgrade, the artifacts folder adding a "target" folder, the version upgrade task should be changed accordingly. --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 6e11e3826e58..35988f71b9b4 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -80,14 +80,14 @@ stages: 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}/versions target/ + 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/versions target/ + cp -r $artifact/target/versions target/ OPTIONS="-a -d" [[ "$artifact" == *arm64* || "$artifact" == *armhf* ]] && OPTIONS="-d" make freeze FREEZE_VERSION_OPTIONS="$OPTIONS" From 551dbfdcd2ba45e071f2d31d7af40ae79ee5415a Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 2 Apr 2022 23:07:10 +0800 Subject: [PATCH 091/119] [Security]: Enable hardening build options (#10369) [Security]: Enable hardening build options --- slave.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/slave.mk b/slave.mk index 641b732db64e..185574e61808 100644 --- a/slave.mk +++ b/slave.mk @@ -268,6 +268,11 @@ export SONIC_ROUTING_STACK export FRR_USER_UID export FRR_USER_GID +############################################################################### +## Build Options +############################################################################### +export DEB_BUILD_OPTIONS = hardening=+all + ############################################################################### ## Dumping key config attributes associated to current building exercise ############################################################################### From a5018e73a71ecc9f98b7eacf42b7e23a3312d507 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Sat, 2 Apr 2022 10:30:21 -0700 Subject: [PATCH 092/119] [Submodule update] sonic-py-swssdk (#10440) *[Submodule update] sonic-py-swssdk 78f167e4728f939712b3f3ea550949e2ea675fec With the changes in PR:https://github.com/Azure/sonic-buildimage/pull/5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: https://github.com/Azure/sonic-buildimage/pull/7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi --- src/sonic-py-swsssdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 96c05900fc6e..653bdba51750 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 96c05900fc6e4063c51e3f6256f8a8e765605be4 +Subproject commit 653bdba51750cac95feb3dd47904bf4de2353fec From e1c36dbfc111dc9dded6453bd33e29458daa6e83 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 4 Apr 2022 07:06:44 +0800 Subject: [PATCH 093/119] [Ci]: Fix an azp template syntax error (#10446) Why I did it [Ci]: Fix an azp template syntax error See https://dev.azure.com/mssonic/build/_build/results?buildId=86535&view=results /.azure-pipelines/docker-sonic-slave.yml (Line: 62, Col: 47): Expected a mapping --- .azure-pipelines/docker-sonic-slave.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 8af6b8b3834f..a6a9750a3808 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -60,15 +60,15 @@ stages: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}: - - template: docker-sonic-slave-template.yml - parameters: - pool: sonicbld - arch: ${{ arch }} - dist: ${{ dist }} - ${{ else }}: - - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage - parameters: - pool: sonicbld - arch: ${{ arch }} - dist: ${{ dist }} + - ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}: + - template: docker-sonic-slave-template.yml + parameters: + pool: sonicbld + arch: ${{ arch }} + dist: ${{ dist }} + - ${{ else }}: + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + parameters: + pool: sonicbld + arch: ${{ arch }} + dist: ${{ dist }} From 13aa2332e8ed17dd905446440818cc130612a95a Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:55:33 +0800 Subject: [PATCH 094/119] [sonic-cfggen]: Update UT to add port lanes (#10362) Why I did it Need to run yang validation for sonic-cfggen unit test, and many unit test does not provide lanes for port table. How I did it Update port config file. How to verify it Run sonic-cfggen unit test, Use below PR to verify #10228 Signed-off-by: Gang Lv ganglv@microsoft.com --- .../multi_npu_data/sample_port_config.ini | 34 +++++++ src/sonic-config-engine/tests/test_cfggen.py | 98 ++++++++++--------- .../tests/test_cfggen_platformJson.py | 2 +- src/sonic-config-engine/tests/test_j2files.py | 10 +- .../tests/test_minigraph_case.py | 12 +-- .../tests/test_multinpu_cfggen.py | 95 +++++++++++------- 6 files changed, 155 insertions(+), 96 deletions(-) create mode 100644 src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini new file mode 100644 index 000000000000..d2cdb5fedd27 --- /dev/null +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config.ini @@ -0,0 +1,34 @@ +# name lanes alias index asic_port_name role +Ethernet0 33,34,35,36 Ethernet1/1 0 Eth0-ASIC0 Ext +Ethernet4 29,30,31,32 Ethernet1/2 1 Eth1-ASIC0 Ext +Ethernet8 41,42,43,44 Ethernet1/3 2 Eth2-ASIC0 Ext +Ethernet12 37,38,39,40 Ethernet1/4 3 Eth3-ASIC0 Ext +Ethernet-BP0 13,14,15,16 Eth4-ASIC0 4 Eth4-ASIC0 Int +Ethernet-BP4 17,18,19,20 Eth5-ASIC0 5 Eth5-ASIC0 Int +Ethernet-BP8 21,22,23,24 Eth6-ASIC0 6 Eth6-ASIC0 Int +Ethernet-BP12 25,26,27,28 Eth7-ASIC0 7 Eth7-ASIC0 Int +Ethernet16 33,34,35,36 Ethernet1/5 8 Eth0-ASIC1 Ext +Ethernet20 29,30,31,32 Ethernet1/6 9 Eth1-ASIC1 Ext +Ethernet24 41,42,43,44 Ethernet1/7 10 Eth2-ASIC1 Ext +Ethernet28 37,38,39,40 Ethernet1/8 11 Eth3-ASIC1 Ext +Ethernet-BP16 13,14,15,16 Eth4-ASIC1 12 Eth4-ASIC1 Int +Ethernet-BP20 17,18,19,20 Eth5-ASIC1 13 Eth5-ASIC1 Int +Ethernet-BP24 21,22,23,24 Eth6-ASIC1 14 Eth6-ASIC1 Int +Ethernet-BP28 25,26,27,28 Eth7-ASIC1 15 Eth7-ASIC1 Int +Ethernet-BP256 61,62,63,64 Eth0-ASIC2 16 Eth0-ASIC2 Int +Ethernet-BP260 57,58,59,60 Eth1-ASIC2 17 Eth1-ASIC2 Int +Ethernet-BP264 53,54,55,56 Eth2-ASIC2 18 Eth2-ASIC2 Int +Ethernet-BP268 49,50,51,52 Eth3-ASIC2 19 Eth3-ASIC2 Int +Ethernet-BP272 45,46,47,48 Eth4-ASIC2 20 Eth4-ASIC2 Int +Ethernet-BP276 41,42,43,44 Eth5-ASIC2 21 Eth5-ASIC2 Int +Ethernet-BP280 37,38,39,40 Eth6-ASIC2 22 Eth6-ASIC2 Int +Ethernet-BP284 33,34,35,36 Eth7-ASIC2 23 Eth7-ASIC2 Int +Ethernet-BP384 29,30,31,32 Eth0-ASIC3 24 Eth0-ASIC3 Int +Ethernet-BP388 25,26,27,28 Eth1-ASIC3 25 Eth1-ASIC3 Int +Ethernet-BP392 21,22,23,24 Eth2-ASIC3 26 Eth2-ASIC3 Int +Ethernet-BP396 17,18,19,20 Eth3-ASIC3 27 Eth3-ASIC3 Int +Ethernet-BP400 13,14,15,16 Eth4-ASIC3 28 Eth4-ASIC3 Int +Ethernet-BP404 9,10,11,12 Eth5-ASIC3 29 Eth5-ASIC3 Int +Ethernet-BP408 5,6,7,8 Eth6-ASIC3 30 Eth6-ASIC3 Int +Ethernet-BP412 1,2,3,4 Eth7-ASIC3 31 Eth7-ASIC3 Int + diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index c75c53b7f626..e5ef35274db7 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -83,44 +83,46 @@ def test_device_desc_mgmt_ip(self): self.assertEqual(output.strip(), "('eth0', '10.0.1.5/28')") def test_minigraph_hostname(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'hostname\']" -m "' + self.sample_graph + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hostname\']" -m "' + self.sample_graph + '" -p "' + self.port_config + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'OCPSCH01040DDLF') def test_minigraph_sku(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '" -p "' + self.port_config + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'Force10-Z9100') def test_minigraph_region(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'region\']" -m "' + self.sample_graph_metadata + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'region\']" -m "' + self.sample_graph_metadata + '" -p "' + self.port_config + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'usfoo') def test_minigraph_cloudtype(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'cloudtype\']" -m "' + self.sample_graph_metadata + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'cloudtype\']" -m "' + self.sample_graph_metadata + '" -p "' + self.port_config + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'Public') def test_minigraph_resourcetype(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'resource_type\']" -m "' + self.sample_graph_metadata + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'resource_type\']" -m "' + self.sample_graph_metadata + '" -p "' + self.port_config + '"' 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 + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'downstream_subrole\']" -m "' + self.sample_graph_metadata + '" -p "' + self.port_config + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'downstream_subrole_y') def test_print_data(self): - argument = '-m "' + self.sample_graph + '" --print-data' + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" --print-data' output = self.run_script(argument) self.assertTrue(len(output.strip()) > 0) - def test_jinja_expression(self, graph=None, expected_router_type='LeafRouter'): + def test_jinja_expression(self, graph=None, port_config=None, expected_router_type='LeafRouter'): if graph is None: graph = self.sample_graph - argument = '-m "' + graph + '" -v "DEVICE_METADATA[\'localhost\'][\'type\']"' + if port_config is None: + port_config = self.port_config + argument = '-m "' + graph + '" -p "' + port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'type\']"' output = self.run_script(argument) self.assertEqual(output.strip(), expected_router_type) @@ -563,44 +565,44 @@ def test_minigraph_neighbor_interfaces(self): 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"' + argument = '-m "' + self.sample_graph_simple_case + '" -p "' + self.port_config + '" -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', 'tpid': '0x8100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " - "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'config_db:server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': 'on', 'mux_cable': 'true'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': 'on', 'mux_cable': 'true'}, " "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': 'on', 'mux_cable': 'true'}, " "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'config_db:fortyGigE0/16', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'config_db:fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'config_db:fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'config_db:fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'config_db:fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'config_db:fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'config_db:fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'config_db:fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'config_db:fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'config_db:fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'config_db:fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'config_db:fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'config_db:fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'config_db:fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'config_db:fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'config_db:fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'config_db:fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'config_db:fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'config_db:fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'config_db:fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'config_db:fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'config_db:fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'config_db:fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'config_db:fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'config_db:fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'config_db:fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'config_db:fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'config_db:fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100'}}" + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100'}}" ) ) @@ -719,7 +721,7 @@ def test_minigraph_sub_port_no_vlan_member(self, check_stderr=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.test_jinja_expression(self.sample_graph, self.port_config, BACKEND_LEAF_ROUTER) self.verify_no_vlan_member() finally: print('\n Change device type back to %s' % (LEAF_ROUTER)) @@ -728,7 +730,7 @@ def test_minigraph_sub_port_no_vlan_member(self, check_stderr=True): else: 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) + self.test_jinja_expression(self.sample_graph, self.port_config, LEAF_ROUTER) def verify_no_vlan_member(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "VLAN_MEMBER"' @@ -745,7 +747,7 @@ def verify_sub_intf(self, **kwargs): 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) + self.test_jinja_expression(graph_file, self.port_config, BACKEND_TOR_ROUTER) # INTERFACE table does not exist @@ -805,7 +807,7 @@ def verify_sub_intf(self, **kwargs): else: output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, graph_file), shell=True) - self.test_jinja_expression(graph_file, TOR_ROUTER) + self.test_jinja_expression(graph_file, self.port_config, TOR_ROUTER) def test_show_run_acl(self): argument = '-a \'{"key1":"value"}\' --var-json ACL_RULE' @@ -818,7 +820,7 @@ def test_show_run_interfaces(self): self.assertEqual(output, '') def test_minigraph_voq_metadata(self): - argument = "-m {} --var-json DEVICE_METADATA".format(self.sample_graph_voq) + argument = "-m {} -p {} --var-json DEVICE_METADATA".format(self.sample_graph_voq, self.voq_port_config) output = json.loads(self.run_script(argument)) self.assertEqual(output['localhost']['asic_name'], 'Asic0') self.assertEqual(output['localhost']['switch_id'], '0') @@ -826,7 +828,7 @@ def test_minigraph_voq_metadata(self): self.assertEqual(output['localhost']['max_cores'], '16') def test_minigraph_voq_system_ports(self): - argument = "-m {} --var-json SYSTEM_PORT".format(self.sample_graph_voq) + argument = "-m {} -p {} --var-json SYSTEM_PORT".format(self.sample_graph_voq, self.voq_port_config) self.assertDictEqual( json.loads(self.run_script(argument)), { @@ -845,7 +847,7 @@ def test_minigraph_voq_system_ports(self): ) def test_minigraph_voq_inband_interface_vlan(self): - argument = "-m {} --var-json VOQ_INBAND_INTERFACE".format(self.sample_graph_voq) + argument = "-m {} -p {} --var-json VOQ_INBAND_INTERFACE".format(self.sample_graph_voq, self.voq_port_config) output = self.run_script(argument) output_dict = utils.to_dict(output.strip()) self.assertDictEqual( @@ -858,7 +860,7 @@ def test_minigraph_voq_inband_interface_vlan(self): ) def test_minigraph_voq_inband_interface_port(self): - argument = "-m {} --var-json VOQ_INBAND_INTERFACE".format(self.sample_graph_voq) + argument = "-m {} -p {} --var-json VOQ_INBAND_INTERFACE".format(self.sample_graph_voq, self.voq_port_config) output = self.run_script(argument) output_dict = utils.to_dict(output.strip()) self.assertDictEqual( diff --git a/src/sonic-config-engine/tests/test_cfggen_platformJson.py b/src/sonic-config-engine/tests/test_cfggen_platformJson.py index fcfae855d0b5..0af361718b99 100644 --- a/src/sonic-config-engine/tests/test_cfggen_platformJson.py +++ b/src/sonic-config-engine/tests/test_cfggen_platformJson.py @@ -49,7 +49,7 @@ def test_dummy_run(self): self.assertEqual(output, '') def test_print_data(self): - argument = '-m "' + self.platform_sample_graph + '" --print-data' + argument = '-m "' + self.platform_sample_graph + '" -p "' + self.platform_json + '" --print-data' output = self.run_script(argument) self.assertTrue(len(output.strip()) > 0) diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index b922ae45dbcf..da37bf8d18c6 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -44,11 +44,11 @@ def run_diff(self, file1, file2): 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 + argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -a \'{\"hwaddr\":\"e4:1d:2d:a5:f3:ad\"}\' -t ' + interfaces_template + ' > ' + self.output_file self.run_script(argument) 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 + argument = '-m ' + self.t0_mvrf_minigraph + ' -p ' + self.t0_port_config + ' -a \'{\"hwaddr\":\"e4:1d:2d:a5:f3:ad\"}\' -t ' + interfaces_template + ' > ' + self.output_file self.run_script(argument) self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces'), self.output_file)) @@ -326,16 +326,18 @@ def test_swss_switch_render_template(self): test_list = { "t1": { "graph": self.t1_mlnx_minigraph, + "port_config": self.mlnx_port_config, "output": "t1-switch.json" }, "t0": { "graph": self.t0_minigraph, + "port_config": self.t0_port_config, "output": "t0-switch.json" }, } for _, v in test_list.items(): - argument = " -m {} -y {} -t {} > {}".format( - v["graph"], constants_yml, switch_template, self.output_file + argument = " -m {} -p {} -y {} -t {} > {}".format( + v["graph"], v["port_config"], constants_yml, switch_template, self.output_file ) sample_output_file = os.path.join( self.test_dir, 'sample_output', v["output"] diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 7377498c7078..d18dd0499dab 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -45,27 +45,27 @@ def test_dummy_run(self): self.assertEqual(output, '') def test_minigraph_sku(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '" -p "' + self.port_config + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'Force10-S6000') def test_print_data(self): - argument = '-m "' + self.sample_graph + '" --print-data' + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" --print-data' output = self.run_script(argument) self.assertTrue(len(output.strip()) > 0) def test_jinja_expression(self): - argument = '-m "' + self.sample_graph + '" -v "DEVICE_METADATA[\'localhost\'][\'type\']"' + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'type\']"' output = self.run_script(argument) self.assertEqual(output.strip(), 'ToRRouter') def test_minigraph_subtype(self): - argument = '-m "' + self.sample_graph + '" -v "DEVICE_METADATA[\'localhost\'][\'subtype\']"' + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'subtype\']"' 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\']"' + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'peer_switch\']"' output = self.run_script(argument) self.assertEqual(output.strip(), 'switch2-t0') @@ -157,7 +157,7 @@ def test_minigraph_portchannels(self): ) def test_minigraph_console_mgmt_feature(self): - argument = '-m "' + self.sample_graph + '" -v CONSOLE_SWITCH' + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v CONSOLE_SWITCH' output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 8a79be743848..f39cc9dce1b8 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -25,6 +25,7 @@ def setUp(self): 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.sample_port_config = os.path.join(self.test_data_dir, 'sample_port_config.ini') 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))) @@ -80,19 +81,21 @@ def test_dummy_run(self): self.assertEqual(output, '') def test_hwsku(self): - argument = "-v \"DEVICE_METADATA[\'localhost\'][\'hwsku\']\" -m \"{}\"".format(self.sample_graph) + argument = "-v \"DEVICE_METADATA[\'localhost\'][\'hwsku\']\" -m \"{}\" -p \"{}\"".format(self.sample_graph, self.sample_port_config) output = self.run_script(argument) self.assertEqual(output.strip(), SKU) + argument = "-v \"DEVICE_METADATA[\'localhost\'][\'hwsku\']\" -m \"{}\"".format(self.sample_graph) for asic in range(NUM_ASIC): - output = self.run_script_for_asic(argument, asic) + output = self.run_script_for_asic(argument, asic, self.port_config[asic]) self.assertEqual(output.strip(), SKU) def test_print_data(self): - argument = "-m \"{}\" --print-data".format(self.sample_graph) + argument = "-m \"{}\" -p \"{}\" --print-data".format(self.sample_graph, self.sample_port_config) output = self.run_script(argument) self.assertGreater(len(output.strip()) , 0) + argument = "-m \"{}\" --print-data".format(self.sample_graph) for asic in range(NUM_ASIC): - output = self.run_script_for_asic(argument, asic) + output = self.run_script_for_asic(argument, asic, self.port_config[asic]) self.assertGreater(len(output.strip()) , 0) def test_additional_json_data(self): @@ -100,7 +103,7 @@ def test_additional_json_data(self): output = self.run_script(argument) self.assertEqual(output.strip(), 'value1') for asic in range(NUM_ASIC): - output = self.run_script_for_asic(argument, asic) + output = self.run_script_for_asic(argument, asic, self.port_config[asic]) self.assertEqual(output.strip(), 'value1') def test_read_yaml(self): @@ -108,7 +111,7 @@ def test_read_yaml(self): output = yaml.load(self.run_script(argument)) self.assertListEqual(output, ['value1', 'value2']) for asic in range(NUM_ASIC): - output = yaml.load(self.run_script_for_asic(argument, asic)) + output = yaml.load(self.run_script_for_asic(argument, asic, self.port_config[asic])) self.assertListEqual(output, ['value1', 'value2']) def test_render_template(self): @@ -116,32 +119,35 @@ def test_render_template(self): output = self.run_script(argument) self.assertEqual(output.strip(), 'value1\nvalue2') for asic in range(NUM_ASIC): - output = self.run_script_for_asic(argument, asic) + output = self.run_script_for_asic(argument, asic, self.port_config[asic]) self.assertEqual(output.strip(), 'value1\nvalue2') def test_metadata_tacacs(self): - argument = '-m "' + self.sample_graph + '" --var-json "TACPLUS_SERVER"' + argument = '-m "' + self.sample_graph + '" -p "' + self.sample_port_config + '" --var-json "TACPLUS_SERVER"' output = json.loads(self.run_script(argument)) self.assertDictEqual(output, {'123.46.98.21': {'priority': '1', 'tcp_port': '49'}}) #TACPLUS_SERVER not present in the asic configuration. + argument = '-m "' + self.sample_graph + '" --var-json "TACPLUS_SERVER"' for asic in range(NUM_ASIC): output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) self.assertDictEqual(output, {}) def test_metadata_ntp(self): - argument = '-m "' + self.sample_graph + '" --var-json "NTP_SERVER"' + argument = '-m "' + self.sample_graph + '" -p "' + self.sample_port_config + '" --var-json "NTP_SERVER"' output = json.loads(self.run_script(argument)) self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) #NTP data is present only in the host config + argument = '-m "' + self.sample_graph + '" --var-json "NTP_SERVER"' for asic in range(NUM_ASIC): output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) print("Log:asic{} sku {}".format(asic,output)) self.assertDictEqual(output, {}) def test_mgmt_port(self): - argument = '-m "' + self.sample_graph + '" --var-json "MGMT_PORT"' + argument = '-m "' + self.sample_graph + '" -p "' + self.sample_port_config + '" --var-json "MGMT_PORT"' output = json.loads(self.run_script(argument)) self.assertDictEqual(output, {'eth0': {'alias': 'eth0', 'admin_status': 'up'}}) + argument = '-m "' + self.sample_graph + '" --var-json "MGMT_PORT"' for asic in range(NUM_ASIC): output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) self.assertDictEqual(output, {'eth0': {'alias': 'eth0', 'admin_status': 'up'}}) @@ -215,17 +221,17 @@ def test_frontend_asic_ports(self): "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", "tpid": "0x8100", "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) + 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:config_db", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" }, - "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", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" }, - "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) + {"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" }, + "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "on" }, + "Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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", "tpid": "0x8100", "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]) @@ -270,7 +276,7 @@ def test_frontend_bgp_neighbor(self): 'fc00::2': {'rrclient': 0, 'name': '01T2', 'local_addr': 'fc00::1', 'nhopself': 0, 'holdtime': '10', 'asn': '65200', 'keepalive': '3'}}) def test_frontend_asic_bgp_neighbor(self): - argument = "-m {} -p {} -n asic0 --var-json \"BGP_INTERNAL_NEIGHBOR\"".format(self.sample_graph, self.port_config[3]) + argument = "-m {} -p {} -n asic0 --var-json \"BGP_INTERNAL_NEIGHBOR\"".format(self.sample_graph, self.port_config[0]) output = json.loads(self.run_script(argument)) self.assertDictEqual(output, \ {'10.1.0.0': {'rrclient': 0, 'name': 'ASIC2', 'local_addr': '10.1.0.1', 'nhopself': 0, 'admin_status': 'up', 'holdtime': '0', 'asn': '65100', 'keepalive': '0'}, @@ -297,23 +303,38 @@ def test_device_asic_metadata(self): self.assertEqual(output['localhost']['sub_role'], 'BackEnd') def test_global_asic_acl(self): - argument = "-m {} --var-json \"ACL_TABLE\"".format(self.sample_graph) + argument = "-m {} -p {} --var-json \"ACL_TABLE\"".format(self.sample_graph, self.sample_port_config) output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {\ - 'DATAACL': {'policy_desc': 'DATAACL', 'ports': ['PortChannel0002','PortChannel0008'], 'stage': 'ingress', 'type': 'L3'}, - 'EVERFLOW': {'policy_desc': 'EVERFLOW', 'ports': ['PortChannel0002','PortChannel0008'], 'stage': 'ingress', 'type': 'MIRROR'}, - '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'}}) + exp = {\ + 'SNMP_ACL': {'policy_desc': 'SNMP_ACL', 'type': 'CTRLPLANE', 'stage': 'ingress', 'services': ['SNMP']}, + 'EVERFLOW': {'policy_desc': 'EVERFLOW', 'stage': 'ingress', 'ports': ['PortChannel0002', 'PortChannel0008', 'Ethernet8', 'Ethernet12', 'Ethernet24', 'Ethernet28'], 'type': 'MIRROR'}, + 'EVERFLOWV6': {'policy_desc': 'EVERFLOWV6', 'stage': 'ingress', 'ports': ['PortChannel0002', 'PortChannel0008', 'Ethernet8', 'Ethernet12', 'Ethernet24', 'Ethernet28'], 'type': 'MIRRORV6'}, + 'SSH_ONLY': {'policy_desc': 'SSH_ONLY', 'type': 'CTRLPLANE', 'stage': 'ingress', 'services': ['SSH']}, + 'DATAACL': {'policy_desc': 'DATAACL', 'stage': 'ingress', 'ports': ['PortChannel0002', 'PortChannel0008'], 'type': 'L3'}} + for k, v in output.items(): + if 'ports' in v: + v['ports'].sort() + for k, v in exp.items(): + if 'ports' in v: + v['ports'].sort() + self.assertDictEqual(output, exp) + def test_global_asic_acl1(self): - argument = "-m {} --var-json \"ACL_TABLE\"".format(self.sample_graph1) + argument = "-m {} -p {} --var-json \"ACL_TABLE\"".format(self.sample_graph1, self.sample_port_config) + self.maxDiff = None 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'}}) - + exp = {\ + 'SNMP_ACL': {'policy_desc': 'SNMP_ACL', 'type': 'CTRLPLANE', 'stage': 'ingress', 'services': ['SNMP']}, + 'EVERFLOW': {'policy_desc': 'EVERFLOW', 'stage': 'ingress', 'ports': ['Ethernet0', 'Ethernet4', 'Ethernet8', 'Ethernet12', 'Ethernet16', 'Ethernet20', 'Ethernet24', 'Ethernet28'], 'type': 'MIRROR'}, + 'EVERFLOWV6': {'policy_desc': 'EVERFLOWV6', 'stage': 'ingress', 'ports': ['Ethernet0', 'Ethernet4', 'Ethernet8', 'Ethernet12', 'Ethernet16', 'Ethernet20', 'Ethernet24', 'Ethernet28'], 'type': 'MIRRORV6'}, + 'SSH_ONLY': {'policy_desc': 'SSH_ONLY', 'type': 'CTRLPLANE', 'stage': 'ingress', 'services': ['SSH']}} + for k, v in output.items(): + if 'ports' in v: + v['ports'].sort() + for k, v in exp.items(): + if 'ports' in v: + v['ports'].sort() + self.assertDictEqual(output, exp) def test_front_end_asic_acl(self): argument = "-m {} -p {} -n asic0 --var-json \"ACL_TABLE\"".format(self.sample_graph, self.port_config[0]) @@ -347,7 +368,7 @@ def test_back_end_asic_acl1(self): def test_loopback_intfs(self): - argument = "-m {} --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph) + argument = "-m {} -p {} --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph, self.sample_port_config) output = json.loads(self.run_script(argument)) self.assertDictEqual(output, {\ "Loopback0": {}, @@ -355,7 +376,7 @@ def test_loopback_intfs(self): "Loopback0|FC00:1::32/128": {}}) # The asic configuration should have 2 loopback interfaces - argument = "-m {} -n asic0 --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph) + argument = "-m {} -p {} -n asic0 --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph, self.port_config[0]) output = json.loads(self.run_script(argument)) self.assertDictEqual(output, { \ "Loopback0": {}, @@ -365,7 +386,7 @@ def test_loopback_intfs(self): "Loopback4096|8.0.0.0/32": {}, "Loopback4096|FD00:1::32/128": {}}) - argument = "-m {} -n asic3 --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph) + argument = "-m {} -p {} -n asic3 --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph, self.port_config[3]) output = json.loads(self.run_script(argument)) self.assertDictEqual(output, {\ "Loopback0": {}, From 470d73585a6480ebc846cca928c799ac491bda48 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Mon, 4 Apr 2022 17:10:06 +0800 Subject: [PATCH 095/119] [YANG] Update YANG model for `pfcwd_sw_enable` (#10444) * Update YANG for pfcwd_sw_enable Signed-off-by: bingwang --- src/sonic-yang-models/tests/files/sample_config_db.json | 6 ++++-- .../tests/yang_model_tests/tests_config/qosmaps.json | 9 ++++++--- .../yang-models/sonic-port-qos-map.yang | 8 ++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e40d75e8f2c5..ff99fc7335df 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1603,7 +1603,8 @@ "tc_to_pg_map": "tc_to_pg_map1", "pfc_to_queue_map": "pfc_prio_to_q_map1", "pfc_to_pg_map" : "pfc_prio_to_pg_map1", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dot1p_to_tc_map" : "Dot1p_to_tc_map2", @@ -1612,7 +1613,8 @@ "tc_to_pg_map": "tc_to_pg_map2", "pfc_to_queue_map": "pfc_prio_to_q_map2", "pfc_to_pg_map" : "pfc_prio_to_pg_map2", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json index fe085ee3c7f9..991675bc3979 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json @@ -621,7 +621,8 @@ "pfc_to_pg_map": "map1", "dscp_to_tc_map": "map1", "dot1p_to_tc_map": "map1", - "pfc_enable": "3,4" + "pfc_enable": "3,4", + "pfcwd_sw_enable" : "3,4" } ] } @@ -657,7 +658,8 @@ "pfc_to_pg_map": "map2", "dscp_to_tc_map": "map2", "dot1p_to_tc_map": "map2", - "pfc_enable": "3,4" + "pfc_enable": "3,4", + "pfcwd_sw_enable" : "3,4" } ] } @@ -714,7 +716,8 @@ "PORT_QOS_MAP_LIST": [ { "ifname": "Ethernet4", - "pfc_enable": "8" + "pfc_enable": "8", + "pfcwd_sw_enable" : "8" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang index b29e2f547087..8f4c2d88f4ed 100644 --- a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang @@ -81,6 +81,14 @@ module sonic-port-qos-map { } } + leaf pfcwd_sw_enable { + type string { + pattern "[0-7](,[0-7])?"; + } + description + "Specify the queue(s) on which software pfc watchdog are enabled."; + } + leaf pfc_to_queue_map { type leafref { path "/ppqm:sonic-pfc-priority-queue-map/ppqm:MAP_PFC_PRIORITY_TO_QUEUE/ppqm:MAP_PFC_PRIORITY_TO_QUEUE_LIST/ppqm:name"; From 64dc08a3723db6846874e5ccc452ad66bb007873 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Mon, 4 Apr 2022 16:07:48 +0300 Subject: [PATCH 096/119] [submodule] Advance sonic-utilities submodule. (#10405) In order to include the following commit: c752457 [PBH] Implement Edit Flows (Azure/sonic-utilities#2093) sonic-utilities f70dc27 [techsupport] Handle minor fixes of TS Lock and update auto-TS (#2114) 51d3550 Fix issues in clear_qos (#2122) 6d3aa1e [GCU] Optimizing moves by adding generators for keys/tables (#2120) 65a5a6b Fixing get port speed when oper status is down (#2123) c752457 [PBH] Implement Edit Flows (#2093) 827358f [debug dump] dump interface module added (#2070) Signed-off-by: Nazarii Hnydyn --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 8389c8137d4f..f70dc27827a8 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 8389c8137d4fdc5a2d1c803c9c06e6dcb4f849c1 +Subproject commit f70dc27827a88d70e91e15ecdcde2ebbc446116d From b9dd1df372e74247bdb54856c92c4a9dde6f39e6 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Tue, 5 Apr 2022 22:32:25 +0800 Subject: [PATCH 097/119] Update qos config to clear queues for bounced back traffic (#10176) * Update qos config to clear queues for bounced back traffic Signed-off-by: bingwang --- .../Arista-7050CX3-32S-C32/qos.json.j2 | 2 +- .../Arista-7050CX3-32S-D48C8/qos.json.j2 | 101 + .../Arista-7260CX3-C64/qos.json.j2 | 186 + .../Arista-7260CX3-D108C8/qos.json.j2 | 2 +- .../Arista-7260CX3-Q64/qos.json.j2 | 2 +- files/build_templates/qos_config.j2 | 30 +- ...ample-arista-7050cx3-dualtor-minigraph.xml | 2369 +++++++++ .../sample-arista-7260-dualtor-minigraph.xml | 4635 +++++++++++++++++ .../tests/sample-arista-7260-t1-minigraph.xml | 2491 +++++++++ .../sample_output/py2/qos-arista7050.json | 84 +- .../py2/qos-arista7800r3-48cq2-lc.json | 135 +- .../tests/sample_output/py2/qos-dell6100.json | 132 +- .../tests/sample_output/py2/qos-dell9332.json | 96 +- .../sample_output/py3/qos-arista7050.json | 84 +- .../py3/qos-arista7050cx3-dualtor.json | 1145 ++++ .../py3/qos-arista7260-dualtor.json | 2137 ++++++++ .../sample_output/py3/qos-arista7260-t1.json | 1045 ++++ .../py3/qos-arista7800r3-48cq2-lc.json | 135 +- .../tests/sample_output/py3/qos-dell6100.json | 132 +- .../tests/sample_output/py3/qos-dell9332.json | 96 +- src/sonic-config-engine/tests/test_j2files.py | 43 + 21 files changed, 14780 insertions(+), 302 deletions(-) mode change 100644 => 120000 device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 mode change 100644 => 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 mode change 100644 => 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 create mode 100644 src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json 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 3e548325ea30..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- 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..5ea713ce7f4c --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 @@ -0,0 +1 @@ +../Arista-7050CX3-32S-D48C8/qos.json.j2 \ 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 index 3e548325ea30..04fddf486ace 100644 --- 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 @@ -1 +1,102 @@ +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} +{%- 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": "2", + "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": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{%- 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": "6", + "7": "7" + } + }, +{%- endmacro %} +{% endif %} + {%- include 'qos_config.j2' %} 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 index 3e548325ea30..4178efbcb7aa 100644 --- 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 @@ -1 +1,187 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') %} +{%- 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" + } + }, +{%- 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": "7" + } + }, +{%- endmacro %} +{% elif ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %} +{%- 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": "2", + "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": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{%- 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": "6", + "7": "7" + } + }, +{%- endmacro %} +{% endif %} + {%- 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 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..f0ee02749724 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/qos.json.j2 \ 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..f0ee02749724 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/qos.json.j2 \ No newline at end of file diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 2a01e470fde8..9df061283034 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -29,6 +29,13 @@ {%- endfor %} {%- set port_names_active = port_names_list_active | join(',') -%} +{%- set port_names_list_extra_queues = [] %} +{%- for port in PORT_ACTIVE %} + {% if (generate_dscp_to_tc_map is defined) 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'] -%} @@ -64,6 +71,9 @@ "7": "7" } }, +{% if generate_tc_to_queue_map is defined %} + {{- generate_tc_to_queue_map() }} +{% else %} "TC_TO_QUEUE_MAP": { "AZURE": { "0": "0", @@ -76,6 +86,7 @@ "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' %} "DOT1P_TO_TC_MAP": { "AZURE": { @@ -89,6 +100,8 @@ "7": "7" } }, +{% elif generate_dscp_to_tc_map is defined %} + {{- generate_dscp_to_tc_map() }} {% else %} "DSCP_TO_TC_MAP": { "AZURE": { @@ -208,7 +221,12 @@ {% if asic_type in pfc_to_pg_map_supported_asics %} "pfc_to_pg_map" : "AZURE", {% endif %} - "pfc_enable" : "3,4" +{% 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 %} @@ -268,7 +286,12 @@ {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|2": { + {% if port in port_names_list_extra_queues %} + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + {% else %} "scheduler": "scheduler.0" + {% endif %} }, {% endfor %} {% for port in PORT_ACTIVE %} @@ -278,7 +301,12 @@ {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|6": { + {% if port in port_names_list_extra_queues %} + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + {% else %} "scheduler": "scheduler.0" + {% endif %} }{% if not loop.last %},{% endif %} {% endfor %} 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..9ffb8230a6bf --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.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-7260-dualtor-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml new file mode 100644 index 000000000000..01a42f934726 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.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-t1-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.xml new file mode 100644 index 000000000000..4367b705a11a --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.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_output/py2/qos-arista7050.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json index 9a6f8a2ada78..b15fcf7a36c1 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 @@ -119,196 +119,224 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet44": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet60": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet68": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet76": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet84": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet92": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet116": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet124": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json index 3044749a2776..92ba2caf8d17 100644 --- 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 @@ -119,315 +119,360 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet44": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet60": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet68": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet76": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet84": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet92": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet100": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet104": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet108": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet116": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet124": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet128": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet132": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet136": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet140": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet144": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet148": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet152": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet156": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet164": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet176": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet180": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet184": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet188": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json index eecd81c99e5c..27bea8cd32d3 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 @@ -119,308 +119,352 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet1": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet5": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet6": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet7": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet9": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet10": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet11": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet13": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet14": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet15": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet17": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet21": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet22": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet23": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet25": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet26": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet27": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet29": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet30": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet31": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet37": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet38": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet39": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet41": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet42": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet53": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet54": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet55": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet57": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet58": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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 index 39f4b26e8372..8130a455497a 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json @@ -123,224 +123,256 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet104": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet128": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet136": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet144": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet152": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet160": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet168": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet176": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet184": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet192": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet200": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet208": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet216": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet224": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet232": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet240": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet248": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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-arista7050.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json index 9a6f8a2ada78..b15fcf7a36c1 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 @@ -119,196 +119,224 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet44": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet60": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet68": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet76": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet84": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet92": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet116": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet124": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json new file mode 100644 index 000000000000..84a2613df90d --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json @@ -0,0 +1,1145 @@ +{ + "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": "6", + "7": "7" + } + }, + "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": "2", + "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": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "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.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet4|0": { + "scheduler": "scheduler.0" + }, + "Ethernet8|0": { + "scheduler": "scheduler.0" + }, + "Ethernet12|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet20|0": { + "scheduler": "scheduler.0" + }, + "Ethernet24|0": { + "scheduler": "scheduler.0" + }, + "Ethernet28|0": { + "scheduler": "scheduler.0" + }, + "Ethernet32|0": { + "scheduler": "scheduler.0" + }, + "Ethernet36|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet44|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet52|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet60|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet76|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet84|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet92|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet100|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet108|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet116|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet124|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet4|1": { + "scheduler": "scheduler.0" + }, + "Ethernet8|1": { + "scheduler": "scheduler.0" + }, + "Ethernet12|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet20|1": { + "scheduler": "scheduler.0" + }, + "Ethernet24|1": { + "scheduler": "scheduler.0" + }, + "Ethernet28|1": { + "scheduler": "scheduler.0" + }, + "Ethernet32|1": { + "scheduler": "scheduler.0" + }, + "Ethernet36|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet44|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet52|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet60|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet76|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet84|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet92|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet100|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet108|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet116|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet124|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet4|2": { + "scheduler": "scheduler.0" + }, + "Ethernet8|2": { + "scheduler": "scheduler.0" + }, + "Ethernet12|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet20|2": { + "scheduler": "scheduler.0" + }, + "Ethernet24|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet44|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet52|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet60|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet68|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet76|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet84|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet108|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet116|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet124|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet4|5": { + "scheduler": "scheduler.0" + }, + "Ethernet8|5": { + "scheduler": "scheduler.0" + }, + "Ethernet12|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet20|5": { + "scheduler": "scheduler.0" + }, + "Ethernet24|5": { + "scheduler": "scheduler.0" + }, + "Ethernet28|5": { + "scheduler": "scheduler.0" + }, + "Ethernet32|5": { + "scheduler": "scheduler.0" + }, + "Ethernet36|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet44|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet52|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet60|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet76|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet84|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet92|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet100|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet108|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet116|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet124|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet4|6": { + "scheduler": "scheduler.0" + }, + "Ethernet8|6": { + "scheduler": "scheduler.0" + }, + "Ethernet12|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet20|6": { + "scheduler": "scheduler.0" + }, + "Ethernet24|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet44|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet52|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet60|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet68|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet76|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet84|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet108|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet116|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet124|6": { + "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..e8476cc0c865 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json @@ -0,0 +1,2137 @@ +{ + "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": "6", + "7": "7" + } + }, + "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": "2", + "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": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet172": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet196": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet204": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet228": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet236": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "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.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet160|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet172|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet192|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet196|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet204|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet220|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet224|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet228|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet236|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet244|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet252|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet160|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet172|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet192|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet196|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet204|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet220|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet224|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet228|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet236|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet244|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet252|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet4|0": { + "scheduler": "scheduler.0" + }, + "Ethernet8|0": { + "scheduler": "scheduler.0" + }, + "Ethernet12|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet20|0": { + "scheduler": "scheduler.0" + }, + "Ethernet24|0": { + "scheduler": "scheduler.0" + }, + "Ethernet28|0": { + "scheduler": "scheduler.0" + }, + "Ethernet32|0": { + "scheduler": "scheduler.0" + }, + "Ethernet36|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet44|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet52|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet60|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet76|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet84|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet92|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet100|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet108|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet116|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet124|0": { + "scheduler": "scheduler.0" + }, + "Ethernet128|0": { + "scheduler": "scheduler.0" + }, + "Ethernet132|0": { + "scheduler": "scheduler.0" + }, + "Ethernet136|0": { + "scheduler": "scheduler.0" + }, + "Ethernet140|0": { + "scheduler": "scheduler.0" + }, + "Ethernet144|0": { + "scheduler": "scheduler.0" + }, + "Ethernet148|0": { + "scheduler": "scheduler.0" + }, + "Ethernet152|0": { + "scheduler": "scheduler.0" + }, + "Ethernet156|0": { + "scheduler": "scheduler.0" + }, + "Ethernet160|0": { + "scheduler": "scheduler.0" + }, + "Ethernet164|0": { + "scheduler": "scheduler.0" + }, + "Ethernet168|0": { + "scheduler": "scheduler.0" + }, + "Ethernet172|0": { + "scheduler": "scheduler.0" + }, + "Ethernet176|0": { + "scheduler": "scheduler.0" + }, + "Ethernet180|0": { + "scheduler": "scheduler.0" + }, + "Ethernet184|0": { + "scheduler": "scheduler.0" + }, + "Ethernet188|0": { + "scheduler": "scheduler.0" + }, + "Ethernet192|0": { + "scheduler": "scheduler.0" + }, + "Ethernet196|0": { + "scheduler": "scheduler.0" + }, + "Ethernet200|0": { + "scheduler": "scheduler.0" + }, + "Ethernet204|0": { + "scheduler": "scheduler.0" + }, + "Ethernet208|0": { + "scheduler": "scheduler.0" + }, + "Ethernet212|0": { + "scheduler": "scheduler.0" + }, + "Ethernet216|0": { + "scheduler": "scheduler.0" + }, + "Ethernet220|0": { + "scheduler": "scheduler.0" + }, + "Ethernet224|0": { + "scheduler": "scheduler.0" + }, + "Ethernet228|0": { + "scheduler": "scheduler.0" + }, + "Ethernet232|0": { + "scheduler": "scheduler.0" + }, + "Ethernet236|0": { + "scheduler": "scheduler.0" + }, + "Ethernet240|0": { + "scheduler": "scheduler.0" + }, + "Ethernet244|0": { + "scheduler": "scheduler.0" + }, + "Ethernet248|0": { + "scheduler": "scheduler.0" + }, + "Ethernet252|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet4|1": { + "scheduler": "scheduler.0" + }, + "Ethernet8|1": { + "scheduler": "scheduler.0" + }, + "Ethernet12|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet20|1": { + "scheduler": "scheduler.0" + }, + "Ethernet24|1": { + "scheduler": "scheduler.0" + }, + "Ethernet28|1": { + "scheduler": "scheduler.0" + }, + "Ethernet32|1": { + "scheduler": "scheduler.0" + }, + "Ethernet36|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet44|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet52|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet60|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet76|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet84|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet92|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet100|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet108|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet116|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet124|1": { + "scheduler": "scheduler.0" + }, + "Ethernet128|1": { + "scheduler": "scheduler.0" + }, + "Ethernet132|1": { + "scheduler": "scheduler.0" + }, + "Ethernet136|1": { + "scheduler": "scheduler.0" + }, + "Ethernet140|1": { + "scheduler": "scheduler.0" + }, + "Ethernet144|1": { + "scheduler": "scheduler.0" + }, + "Ethernet148|1": { + "scheduler": "scheduler.0" + }, + "Ethernet152|1": { + "scheduler": "scheduler.0" + }, + "Ethernet156|1": { + "scheduler": "scheduler.0" + }, + "Ethernet160|1": { + "scheduler": "scheduler.0" + }, + "Ethernet164|1": { + "scheduler": "scheduler.0" + }, + "Ethernet168|1": { + "scheduler": "scheduler.0" + }, + "Ethernet172|1": { + "scheduler": "scheduler.0" + }, + "Ethernet176|1": { + "scheduler": "scheduler.0" + }, + "Ethernet180|1": { + "scheduler": "scheduler.0" + }, + "Ethernet184|1": { + "scheduler": "scheduler.0" + }, + "Ethernet188|1": { + "scheduler": "scheduler.0" + }, + "Ethernet192|1": { + "scheduler": "scheduler.0" + }, + "Ethernet196|1": { + "scheduler": "scheduler.0" + }, + "Ethernet200|1": { + "scheduler": "scheduler.0" + }, + "Ethernet204|1": { + "scheduler": "scheduler.0" + }, + "Ethernet208|1": { + "scheduler": "scheduler.0" + }, + "Ethernet212|1": { + "scheduler": "scheduler.0" + }, + "Ethernet216|1": { + "scheduler": "scheduler.0" + }, + "Ethernet220|1": { + "scheduler": "scheduler.0" + }, + "Ethernet224|1": { + "scheduler": "scheduler.0" + }, + "Ethernet228|1": { + "scheduler": "scheduler.0" + }, + "Ethernet232|1": { + "scheduler": "scheduler.0" + }, + "Ethernet236|1": { + "scheduler": "scheduler.0" + }, + "Ethernet240|1": { + "scheduler": "scheduler.0" + }, + "Ethernet244|1": { + "scheduler": "scheduler.0" + }, + "Ethernet248|1": { + "scheduler": "scheduler.0" + }, + "Ethernet252|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet4|2": { + "scheduler": "scheduler.0" + }, + "Ethernet8|2": { + "scheduler": "scheduler.0" + }, + "Ethernet12|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet20|2": { + "scheduler": "scheduler.0" + }, + "Ethernet24|2": { + "scheduler": "scheduler.0" + }, + "Ethernet28|2": { + "scheduler": "scheduler.0" + }, + "Ethernet32|2": { + "scheduler": "scheduler.0" + }, + "Ethernet36|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet44|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet84|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet92|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet100|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet108|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet116|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet124|2": { + "scheduler": "scheduler.0" + }, + "Ethernet128|2": { + "scheduler": "scheduler.0" + }, + "Ethernet132|2": { + "scheduler": "scheduler.0" + }, + "Ethernet136|2": { + "scheduler": "scheduler.0" + }, + "Ethernet140|2": { + "scheduler": "scheduler.0" + }, + "Ethernet144|2": { + "scheduler": "scheduler.0" + }, + "Ethernet148|2": { + "scheduler": "scheduler.0" + }, + "Ethernet152|2": { + "scheduler": "scheduler.0" + }, + "Ethernet156|2": { + "scheduler": "scheduler.0" + }, + "Ethernet160|2": { + "scheduler": "scheduler.0" + }, + "Ethernet164|2": { + "scheduler": "scheduler.0" + }, + "Ethernet168|2": { + "scheduler": "scheduler.0" + }, + "Ethernet172|2": { + "scheduler": "scheduler.0" + }, + "Ethernet176|2": { + "scheduler": "scheduler.0" + }, + "Ethernet180|2": { + "scheduler": "scheduler.0" + }, + "Ethernet184|2": { + "scheduler": "scheduler.0" + }, + "Ethernet188|2": { + "scheduler": "scheduler.0" + }, + "Ethernet192|2": { + "scheduler": "scheduler.0" + }, + "Ethernet196|2": { + "scheduler": "scheduler.0" + }, + "Ethernet200|2": { + "scheduler": "scheduler.0" + }, + "Ethernet204|2": { + "scheduler": "scheduler.0" + }, + "Ethernet208|2": { + "scheduler": "scheduler.0" + }, + "Ethernet212|2": { + "scheduler": "scheduler.0" + }, + "Ethernet216|2": { + "scheduler": "scheduler.0" + }, + "Ethernet220|2": { + "scheduler": "scheduler.0" + }, + "Ethernet224|2": { + "scheduler": "scheduler.0" + }, + "Ethernet228|2": { + "scheduler": "scheduler.0" + }, + "Ethernet232|2": { + "scheduler": "scheduler.0" + }, + "Ethernet236|2": { + "scheduler": "scheduler.0" + }, + "Ethernet240|2": { + "scheduler": "scheduler.0" + }, + "Ethernet244|2": { + "scheduler": "scheduler.0" + }, + "Ethernet248|2": { + "scheduler": "scheduler.0" + }, + "Ethernet252|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet4|5": { + "scheduler": "scheduler.0" + }, + "Ethernet8|5": { + "scheduler": "scheduler.0" + }, + "Ethernet12|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet20|5": { + "scheduler": "scheduler.0" + }, + "Ethernet24|5": { + "scheduler": "scheduler.0" + }, + "Ethernet28|5": { + "scheduler": "scheduler.0" + }, + "Ethernet32|5": { + "scheduler": "scheduler.0" + }, + "Ethernet36|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet44|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet52|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet60|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet76|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet84|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet92|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet100|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet108|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet116|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet124|5": { + "scheduler": "scheduler.0" + }, + "Ethernet128|5": { + "scheduler": "scheduler.0" + }, + "Ethernet132|5": { + "scheduler": "scheduler.0" + }, + "Ethernet136|5": { + "scheduler": "scheduler.0" + }, + "Ethernet140|5": { + "scheduler": "scheduler.0" + }, + "Ethernet144|5": { + "scheduler": "scheduler.0" + }, + "Ethernet148|5": { + "scheduler": "scheduler.0" + }, + "Ethernet152|5": { + "scheduler": "scheduler.0" + }, + "Ethernet156|5": { + "scheduler": "scheduler.0" + }, + "Ethernet160|5": { + "scheduler": "scheduler.0" + }, + "Ethernet164|5": { + "scheduler": "scheduler.0" + }, + "Ethernet168|5": { + "scheduler": "scheduler.0" + }, + "Ethernet172|5": { + "scheduler": "scheduler.0" + }, + "Ethernet176|5": { + "scheduler": "scheduler.0" + }, + "Ethernet180|5": { + "scheduler": "scheduler.0" + }, + "Ethernet184|5": { + "scheduler": "scheduler.0" + }, + "Ethernet188|5": { + "scheduler": "scheduler.0" + }, + "Ethernet192|5": { + "scheduler": "scheduler.0" + }, + "Ethernet196|5": { + "scheduler": "scheduler.0" + }, + "Ethernet200|5": { + "scheduler": "scheduler.0" + }, + "Ethernet204|5": { + "scheduler": "scheduler.0" + }, + "Ethernet208|5": { + "scheduler": "scheduler.0" + }, + "Ethernet212|5": { + "scheduler": "scheduler.0" + }, + "Ethernet216|5": { + "scheduler": "scheduler.0" + }, + "Ethernet220|5": { + "scheduler": "scheduler.0" + }, + "Ethernet224|5": { + "scheduler": "scheduler.0" + }, + "Ethernet228|5": { + "scheduler": "scheduler.0" + }, + "Ethernet232|5": { + "scheduler": "scheduler.0" + }, + "Ethernet236|5": { + "scheduler": "scheduler.0" + }, + "Ethernet240|5": { + "scheduler": "scheduler.0" + }, + "Ethernet244|5": { + "scheduler": "scheduler.0" + }, + "Ethernet248|5": { + "scheduler": "scheduler.0" + }, + "Ethernet252|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet4|6": { + "scheduler": "scheduler.0" + }, + "Ethernet8|6": { + "scheduler": "scheduler.0" + }, + "Ethernet12|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet20|6": { + "scheduler": "scheduler.0" + }, + "Ethernet24|6": { + "scheduler": "scheduler.0" + }, + "Ethernet28|6": { + "scheduler": "scheduler.0" + }, + "Ethernet32|6": { + "scheduler": "scheduler.0" + }, + "Ethernet36|6": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet44|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet84|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet92|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet100|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet108|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet116|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet124|6": { + "scheduler": "scheduler.0" + }, + "Ethernet128|6": { + "scheduler": "scheduler.0" + }, + "Ethernet132|6": { + "scheduler": "scheduler.0" + }, + "Ethernet136|6": { + "scheduler": "scheduler.0" + }, + "Ethernet140|6": { + "scheduler": "scheduler.0" + }, + "Ethernet144|6": { + "scheduler": "scheduler.0" + }, + "Ethernet148|6": { + "scheduler": "scheduler.0" + }, + "Ethernet152|6": { + "scheduler": "scheduler.0" + }, + "Ethernet156|6": { + "scheduler": "scheduler.0" + }, + "Ethernet160|6": { + "scheduler": "scheduler.0" + }, + "Ethernet164|6": { + "scheduler": "scheduler.0" + }, + "Ethernet168|6": { + "scheduler": "scheduler.0" + }, + "Ethernet172|6": { + "scheduler": "scheduler.0" + }, + "Ethernet176|6": { + "scheduler": "scheduler.0" + }, + "Ethernet180|6": { + "scheduler": "scheduler.0" + }, + "Ethernet184|6": { + "scheduler": "scheduler.0" + }, + "Ethernet188|6": { + "scheduler": "scheduler.0" + }, + "Ethernet192|6": { + "scheduler": "scheduler.0" + }, + "Ethernet196|6": { + "scheduler": "scheduler.0" + }, + "Ethernet200|6": { + "scheduler": "scheduler.0" + }, + "Ethernet204|6": { + "scheduler": "scheduler.0" + }, + "Ethernet208|6": { + "scheduler": "scheduler.0" + }, + "Ethernet212|6": { + "scheduler": "scheduler.0" + }, + "Ethernet216|6": { + "scheduler": "scheduler.0" + }, + "Ethernet220|6": { + "scheduler": "scheduler.0" + }, + "Ethernet224|6": { + "scheduler": "scheduler.0" + }, + "Ethernet228|6": { + "scheduler": "scheduler.0" + }, + "Ethernet232|6": { + "scheduler": "scheduler.0" + }, + "Ethernet236|6": { + "scheduler": "scheduler.0" + }, + "Ethernet240|6": { + "scheduler": "scheduler.0" + }, + "Ethernet244|6": { + "scheduler": "scheduler.0" + }, + "Ethernet248|6": { + "scheduler": "scheduler.0" + }, + "Ethernet252|6": { + "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..9db828a759e4 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json @@ -0,0 +1,1045 @@ +{ + "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" + } + }, + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "7" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "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.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet220|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet244|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet252|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet220|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet244|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet252|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet4|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet20|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet84|0": { + "scheduler": "scheduler.0" + }, + "Ethernet136|0": { + "scheduler": "scheduler.0" + }, + "Ethernet144|0": { + "scheduler": "scheduler.0" + }, + "Ethernet148|0": { + "scheduler": "scheduler.0" + }, + "Ethernet152|0": { + "scheduler": "scheduler.0" + }, + "Ethernet156|0": { + "scheduler": "scheduler.0" + }, + "Ethernet168|0": { + "scheduler": "scheduler.0" + }, + "Ethernet176|0": { + "scheduler": "scheduler.0" + }, + "Ethernet180|0": { + "scheduler": "scheduler.0" + }, + "Ethernet184|0": { + "scheduler": "scheduler.0" + }, + "Ethernet188|0": { + "scheduler": "scheduler.0" + }, + "Ethernet200|0": { + "scheduler": "scheduler.0" + }, + "Ethernet208|0": { + "scheduler": "scheduler.0" + }, + "Ethernet212|0": { + "scheduler": "scheduler.0" + }, + "Ethernet216|0": { + "scheduler": "scheduler.0" + }, + "Ethernet220|0": { + "scheduler": "scheduler.0" + }, + "Ethernet232|0": { + "scheduler": "scheduler.0" + }, + "Ethernet240|0": { + "scheduler": "scheduler.0" + }, + "Ethernet244|0": { + "scheduler": "scheduler.0" + }, + "Ethernet248|0": { + "scheduler": "scheduler.0" + }, + "Ethernet252|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet4|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet20|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet84|1": { + "scheduler": "scheduler.0" + }, + "Ethernet136|1": { + "scheduler": "scheduler.0" + }, + "Ethernet144|1": { + "scheduler": "scheduler.0" + }, + "Ethernet148|1": { + "scheduler": "scheduler.0" + }, + "Ethernet152|1": { + "scheduler": "scheduler.0" + }, + "Ethernet156|1": { + "scheduler": "scheduler.0" + }, + "Ethernet168|1": { + "scheduler": "scheduler.0" + }, + "Ethernet176|1": { + "scheduler": "scheduler.0" + }, + "Ethernet180|1": { + "scheduler": "scheduler.0" + }, + "Ethernet184|1": { + "scheduler": "scheduler.0" + }, + "Ethernet188|1": { + "scheduler": "scheduler.0" + }, + "Ethernet200|1": { + "scheduler": "scheduler.0" + }, + "Ethernet208|1": { + "scheduler": "scheduler.0" + }, + "Ethernet212|1": { + "scheduler": "scheduler.0" + }, + "Ethernet216|1": { + "scheduler": "scheduler.0" + }, + "Ethernet220|1": { + "scheduler": "scheduler.0" + }, + "Ethernet232|1": { + "scheduler": "scheduler.0" + }, + "Ethernet240|1": { + "scheduler": "scheduler.0" + }, + "Ethernet244|1": { + "scheduler": "scheduler.0" + }, + "Ethernet248|1": { + "scheduler": "scheduler.0" + }, + "Ethernet252|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet4|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet20|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet68|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet84|2": { + "scheduler": "scheduler.0" + }, + "Ethernet136|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet220|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet244|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet252|2": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet4|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet20|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet84|5": { + "scheduler": "scheduler.0" + }, + "Ethernet136|5": { + "scheduler": "scheduler.0" + }, + "Ethernet144|5": { + "scheduler": "scheduler.0" + }, + "Ethernet148|5": { + "scheduler": "scheduler.0" + }, + "Ethernet152|5": { + "scheduler": "scheduler.0" + }, + "Ethernet156|5": { + "scheduler": "scheduler.0" + }, + "Ethernet168|5": { + "scheduler": "scheduler.0" + }, + "Ethernet176|5": { + "scheduler": "scheduler.0" + }, + "Ethernet180|5": { + "scheduler": "scheduler.0" + }, + "Ethernet184|5": { + "scheduler": "scheduler.0" + }, + "Ethernet188|5": { + "scheduler": "scheduler.0" + }, + "Ethernet200|5": { + "scheduler": "scheduler.0" + }, + "Ethernet208|5": { + "scheduler": "scheduler.0" + }, + "Ethernet212|5": { + "scheduler": "scheduler.0" + }, + "Ethernet216|5": { + "scheduler": "scheduler.0" + }, + "Ethernet220|5": { + "scheduler": "scheduler.0" + }, + "Ethernet232|5": { + "scheduler": "scheduler.0" + }, + "Ethernet240|5": { + "scheduler": "scheduler.0" + }, + "Ethernet244|5": { + "scheduler": "scheduler.0" + }, + "Ethernet248|5": { + "scheduler": "scheduler.0" + }, + "Ethernet252|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet4|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet20|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet68|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet84|6": { + "scheduler": "scheduler.0" + }, + "Ethernet136|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet212|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet220|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet244|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet252|6": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + } + } +} 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 index 3044749a2776..92ba2caf8d17 100644 --- 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 @@ -119,315 +119,360 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet44": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet60": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet68": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet76": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet84": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet92": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet100": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet104": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet108": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet116": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet124": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet128": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet132": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet136": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet140": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet144": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet148": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet152": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet156": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet164": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet176": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet180": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet184": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet188": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json index eecd81c99e5c..27bea8cd32d3 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 @@ -119,308 +119,352 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet1": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet5": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet6": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet7": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet9": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet10": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet11": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet13": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet14": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet15": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet17": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet21": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet22": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet23": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet25": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet26": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet27": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet29": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet30": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet31": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet37": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet38": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet39": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet41": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet42": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet53": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet54": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet55": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet57": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet58": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "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 index 39f4b26e8372..8130a455497a 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json @@ -123,224 +123,256 @@ "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet104": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet128": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet136": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet144": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet152": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet160": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet168": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet176": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet184": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet192": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet200": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet208": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet216": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet224": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet232": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet240": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet248": { "dscp_to_tc_map" : "AZURE", "tc_to_queue_map" : "AZURE", "tc_to_pg_map" : "AZURE", "pfc_to_queue_map": "AZURE", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" } }, "WRED_PROFILE": { diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index da37bf8d18c6..52d4260dba77 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -274,6 +274,49 @@ def test_qos_dell6100_render_template(self): sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell6100.json') assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + 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' + ] + sample_outputs = [ + 'qos-arista7050cx3-dualtor.json', + 'qos-arista7260-dualtor.json', + 'qos-arista7260-t1.json' + ] + sample_minigraph_files = [ + 'sample-arista-7050cx3-dualtor-minigraph.xml', + 'sample-arista-7260-dualtor-minigraph.xml', + 'sample-arista-7260-t1-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, sample_output) + assert utils.cmp(sample_output_file, test_output) + os.remove(test_output) + def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected): dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) buffers_file = os.path.join(dir_path, buffer_template) From 31be203af6643c0f3e621e3d57040d2195617ad7 Mon Sep 17 00:00:00 2001 From: Andriy Kokhan Date: Tue, 5 Apr 2022 19:11:38 +0300 Subject: [PATCH 098/119] [BFN] Updated x86_64-accton_as9516_32d-r0/platform.json (#10368) Signed-off-by: Andriy Kokhan --- .../x86_64-accton_as9516_32d-r0/platform.json | 126 ++++++++++++++---- 1 file changed, 102 insertions(+), 24 deletions(-) diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json b/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json index 115dd194b725..abd2fec0a303 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json @@ -9,57 +9,135 @@ "name": "BMC" } ], + "thermal_manager": false, "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" - }, - { - "name": "counter-rotating-fan-6" + "name": "counter-rotating-fan-1", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-2", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-3", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-4", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-5", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "counter-rotating-fan-6", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } } ], "fan_drawers": [ { "name": "fantray-1", + "status_led": { + "controllable": false + }, "fans": [ { - "name": "counter-rotating-fan-1" + "name": "counter-rotating-fan-1", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-2" + "name": "counter-rotating-fan-2", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-3" + "name": "counter-rotating-fan-3", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-4" + "name": "counter-rotating-fan-4", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-5" + "name": "counter-rotating-fan-5", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } }, { - "name": "counter-rotating-fan-6" + "name": "counter-rotating-fan-6", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } } ] } ], "psus": [ { - "name": "psu-1" + "name": "psu-1", + "temperature": false }, { - "name": "psu-2" + "name": "psu-2", + "temperature": false } ], "thermals": [ From 8e616c153b9775d2514c68a5112a583eeb334e6b Mon Sep 17 00:00:00 2001 From: Vadym Yashchenko Date: Tue, 5 Apr 2022 19:13:08 +0300 Subject: [PATCH 099/119] [BFN] Refactoring and adding some functions of Thermal class (set and get thresholds and etc.) (#10205) * Revised set_high_thershold and set_low_thershold methobs in the thermal.py Signed-off-by: Vadym Yashchenko * Revised set_low_thershold and set_high_thershold Signed-off-by: Vadym Yashchenko * Added separated files with thermal thresholds, changed platform.json and thermal.py Signed-off-by: Vadym Yashchenko * Revised on code revieww Signed-off-by: Vadym Yashchenko * Reverted thermal.py Signed-off-by: Vadym Yashchenko * Revised ther python.py Signed-off-by: Vadym Yashchenko * Revised due to code review Signed-off-by: Vadym Yashchenko * Added fucntion for fix the problem of tofino sensor high critical threshold Signed-off-by: Vadym Yashchenko * Revised due to code review Signed-off-by: Vadym Yashchenko * Revised due to code review Signed-off-by: Vadym Yashchenko * Revised due to code review Signed-off-by: Vadym Yashchenko * Revised only for cab18-4 Signed-off-by: Vadym Yashchenko * Revised default thresholds Signed-off-by: Vadym Yashchenko * Revised ther def thresholds Signed-off-by: Vadym Yashchenko * Revised on code review Signed-off-by: Vadym Yashchenko * Revised platform.json and thermal_thresholds.json Signed-off-by: Vadym Yashchenko * Code review in PR to azure (trigger CI) Signed-off-by: Vadym Yashchenko * Added handle of exception Signed-off-by: Vadym Yashchenko * Revised exception handler * Added psu-1 thermal names to platfrom.json Signed-off-by: Vadym Yashchenko * Changed platform.json and thermal_thresholds.json in x86_64-acton_as9516_32d-r0 Signed-off-by: Vadym Yashchenko * Removed indentation from json file Signed-off-by: Vadym Yashchenko --- .../thermal_thresholds.json | 61 +++++++++++++ .../platform.json | 29 +++--- .../thermal_thresholds.json | 64 +++++++++++++ .../sonic_platform/thermal.py | 89 +++++++++++++++++-- 4 files changed, 224 insertions(+), 19 deletions(-) create mode 100644 device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json create mode 100644 device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json b/device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json new file mode 100644 index 000000000000..451067eb603c --- /dev/null +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/thermal_thresholds.json @@ -0,0 +1,61 @@ +{ + "thermals": [ + { + "com_e_driver-i2c-4-33:cpu-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "com_e_driver-i2c-4-33:memory-temp" : [85.0, 75.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-48:chip-temp" : [90.0, 80.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-49:exhaust2-temp" : [80.0, 70.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4a:exhaust-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4b:intake-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4c:tofino-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4d:intake2-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:package-id-0" : [80.0, 70.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-0" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-1" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-2" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-3" : [99.0, 89.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp1" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp2" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp3" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp1" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp2" : [60.0, 50.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp3" : [60.0, 50.0, 11.0, 1.0] + } + ] +} \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json index ea18a031344e..5fee4f0eebaf 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json @@ -57,38 +57,41 @@ } ], "thermals": [ + { + "name": "com_e_driver-i2c-4-33:cpu-temp" + }, { "name": "com_e_driver-i2c-4-33:memory-temp" }, { - "name": "com_e_driver-i2c-4-33:cpu-temp" + "name": "psu_driver-i2c-7-59:psu2-temp1" }, { - "name": "pfe1100-i2c-7-59:temp1" + "name": "psu_driver-i2c-7-59:psu2-temp2" }, { - "name": "pfe1100-i2c-7-59:temp2" + "name": "psu_driver-i2c-7-5a:psu1-temp1" }, { - "name": "pfe1100-i2c-7-5a:temp1" + "name": "psu_driver-i2c-7-5a:psu1-temp2" }, { - "name": "pfe1100-i2c-7-5a:temp2" + "name": "tmp75-i2c-3-48:chip-temp" }, { - "name": "tmp75-i2c-3-48:outlet-middle-temp" + "name": "tmp75-i2c-3-49:exhaust2-temp" }, { - "name": "tmp75-i2c-3-49:inlet-middle-temp" + "name": "tmp75-i2c-3-4a:exhaust-temp" }, { - "name": "tmp75-i2c-3-4a:inlet-left-temp" + "name": "tmp75-i2c-3-4b:intake-temp" }, { - "name": "tmp75-i2c-3-4b:switch-temp" + "name": "tmp75-i2c-3-4c:tofino-temp" }, { - "name": "tmp75-i2c-3-4c:inlet-right-temp" + "name": "tmp75-i2c-3-4d:intake2-temp" }, { "name": "tmp75-i2c-8-48:outlet-right-temp" @@ -96,6 +99,9 @@ { "name": "tmp75-i2c-8-49:outlet-left-temp" }, + { + "name": "pch_haswell-virtual-0:temp1" + }, { "name": "coretemp-isa-0000:package-id-0" }, @@ -110,9 +116,6 @@ }, { "name": "coretemp-isa-0000:core-3" - }, - { - "name": "pch_haswell-virtual-0:temp1" } ], "sfps": [ diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json new file mode 100644 index 000000000000..bee961a84411 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/thermal_thresholds.json @@ -0,0 +1,64 @@ +{ + "thermals": [ + { + "com_e_driver-i2c-4-33:cpu-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "com_e_driver-i2c-4-33:memory-temp" : [85.0, 75.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp1" : [50.0, 40.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-59:psu2-temp2" : [90.0, 80.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp1" : [50.0, 40.0, 11.0, 1.0] + }, + { + "psu_driver-i2c-7-5a:psu1-temp2" : [90.0, 80.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-48:chip-temp" : [90.0, 80.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-49:exhaust2-temp" : [80.0, 70.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4a:exhaust-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4b:intake-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4c:tofino-temp" : [99.0, 89.0, 11.0, 1.0] + }, + { + "tmp75-i2c-3-4d:intake2-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-8-48:outlet-right-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "tmp75-i2c-8-49:outlet-left-temp" : [60.0, 50.0, 11.0, 1.0] + }, + { + "pch_haswell-virtual-0:temp1" : [60.0, 50.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:package-id-0" : [80.0, 70.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-0" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-1" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-2" : [99.0, 89.0, 11.0, 1.0] + }, + { + "coretemp-isa-0000:core-3" : [99.0, 89.0, 11.0, 1.0] + } + ] +} \ No newline at end of file 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 index ef3c571ac301..e5034f09f558 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py @@ -1,8 +1,11 @@ try: import subprocess - + from collections import namedtuple + import json from bfn_extensions.platform_sensors import platform_sensors_get from sonic_platform_base.thermal_base import ThermalBase + from sonic_py_common import device_info + import logging except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -18,6 +21,8 @@ temp2_input: 37.000 ... ''' +Threshold = namedtuple('Threshold', ['crit', 'max', 'min', 'alarm']) + def _sensors_chip_parsed(data: str): def kv(line): k, v, *_ = [t.strip(': ') for t in line.split(':') if t] + [''] @@ -68,27 +73,89 @@ def _value_get(d: dict, key_prefix, key_suffix=''): # Thermal -> ThermalBase -> DeviceBase class Thermal(ThermalBase): + _thresholds = dict() + _max_temperature = 100.0 + _min_temperature = 0.0 + _min_high_threshold_temperature = 35.0 + def __init__(self, chip, label, index = 0): self.__chip = chip self.__label = label self.__name = f"{chip}:{label}".lower().replace(' ', '-') self.__collect_temp = [] self.__index = index + self.__high_threshold = None + self.__low_threshold = None + f = None + try: + path = device_info.get_path_to_platform_dir() + '/' + 'thermal_thresholds.json' + f = open(path) + except FileNotFoundError: + logging.warning('can not open the file') + + if f is not None: + self.__get_thresholds(f) + + def __get_thresholds(self, f): + def_threshold_json = json.load(f) + all_data = def_threshold_json["thermals"] + for i in all_data: + for key, value in i.items(): + self._thresholds[key] = Threshold(*value) + + def check_in_range(self, temperature): + temp_f = float(temperature) + return temp_f > self._min_temperature and temp_f <= self._max_temperature + + def check_high_threshold(self, temperature, attr_suffix): + temp_f = float(temperature) + check_range = True + if attr_suffix == 'max': + if temp_f < self._min_high_threshold_temperature: + if self.__name in self._thresholds: + temp = self._thresholds[self.__name].max + self.set_high_threshold(temp) + check_range = False + return check_range 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) - return value if value is not None else -999.9 + if value is not None and self.check_in_range(value) and self.check_high_threshold(value, attr_suffix): + return value + elif self.__name in self._thresholds and attr_prefix == 'temp': + if attr_suffix == 'crit': + return self._thresholds[self.__name].crit + elif attr_suffix == 'max': + if self.__high_threshold is None: + return self._thresholds[self.__name].max + else: + return self.__high_threshold + elif attr_suffix == 'min': + if self.__low_threshold is None: + return self._thresholds[self.__name].min + else: + return self.__low_threshold + elif attr_suffix == 'alarm': + return self._thresholds[self.__name].alarm + else: + return 1.0 + else: + return 0.05 # ThermalBase interface methods: def get_temperature(self) -> float: temp = self.__get('temp', 'input') self.__collect_temp.append(float(temp)) self.__collect_temp.sort() + if len(self.__collect_temp) == 3: + del self.__collect_temp[1] return float(temp) def get_high_threshold(self) -> float: - return float(self.__get('temp', 'max')) + if self.__high_threshold is None: + return float(self.__get('temp', 'max')) + return float(self.__high_threshold) def get_high_critical_threshold(self) -> float: return float(self.__get('temp', 'crit')) @@ -113,28 +180,38 @@ def is_replaceable(self): return False def get_low_threshold(self) -> float: - return float(self.__get('temp', 'min')) + if self.__low_threshold is None: + return float(self.__get('temp', 'min')) + return float(self.__low_threshold) def get_serial(self): return 'N/A' def get_minimum_recorded(self) -> float: - temp = self.__collect_temp[0] if len(self.__collect_temp) > 0 else 0.1 + temp = self.__collect_temp[0] if len(self.__collect_temp) > 0 else self.get_temperature() + temp = temp if temp <= 100.0 else 100.0 temp = temp if temp > 0.0 else 0.1 return float(temp) def get_maximum_recorded(self) -> float: - temp = self.__collect_temp[-1] if len(self.__collect_temp) > 0 else 100.0 + temp = self.__collect_temp[-1] if len(self.__collect_temp) > 0 else self.get_temperature() temp = temp if temp <= 100.0 else 100.0 + temp = temp if temp > 0.0 else 0.1 return float(temp) def get_position_in_parent(self): return self.__index def set_high_threshold(self, temperature): + if self.check_in_range(temperature): + self.__high_threshold = temperature + return True return False def set_low_threshold(self, temperature): + if self.check_in_range(temperature): + self.__low_threshold = temperature + return True return False def thermal_list_get(): From 58df23e1d714e503bc6768f5ff7f51496295ddf3 Mon Sep 17 00:00:00 2001 From: byu343 Date: Tue, 5 Apr 2022 09:49:26 -0700 Subject: [PATCH 100/119] [arista] Update serdes tuning values for 7280cr3 (#9966) --- .../Arista-7280CR3-C40/gearbox_100G_PAM4.xml | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/device/arista/x86_64-arista_7280cr3mk_32p4/Arista-7280CR3-C40/gearbox_100G_PAM4.xml b/device/arista/x86_64-arista_7280cr3mk_32p4/Arista-7280CR3-C40/gearbox_100G_PAM4.xml index 95e20b91787e..0ac9ff7b7846 100644 --- a/device/arista/x86_64-arista_7280cr3mk_32p4/Arista-7280CR3-C40/gearbox_100G_PAM4.xml +++ b/device/arista/x86_64-arista_7280cr3mk_32p4/Arista-7280CR3-C40/gearbox_100G_PAM4.xml @@ -4,11 +4,6 @@ 0 gearbox 2 - - 2,-8,17,0,0 - 0,-8,17,0,0 - - 0,0,1,0,0 @@ -34,4 +29,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From bfe5835650873d207020fd371819d407a9f3b3e1 Mon Sep 17 00:00:00 2001 From: Taras Keryk Date: Tue, 5 Apr 2022 21:33:51 +0300 Subject: [PATCH 101/119] [BFN] Fix exception when fwutil run without sudo (#10335) * [BFN] Fix for run fwutil without sudo SONiC has a concept of "platform components" this may include - CPLD, FPGA, BIOS, BMC, etc. These changes are needed to read the version of the BIOS and BMC component. What I did The previous implementaion of component.py expect fwutil run with sudo. When fwutil run without sudo, there are an exception: ``` Traceback (most recent call last): File "/usr/local/bin/fwutil", line 5, in from fwutil.main import cli File "/usr/local/lib/python3.9/dist-packages/fwutil/__init__.py", line 3, in from . import main File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 40, in pdp = PlatformDataProvider() File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 159, in __init__ self.__platform = Platform() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__ self._chassis = Chassis() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 48, in __init__ self.__initialize_components() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 136, in __initialize_components component = Components(index) File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 184, in __init__ self.version = get_bios_version() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 19, in get_bios_version return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode() File "/usr/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode' ``` How I did it Modification of dmidecode command How to verify it Run manually 'fwutil' (without sudo) Previous command output had exception New command output: Root privileges are required Signed-off-by: Taras Keryk * Why I did it The previous implementaion of component.py expect fwutil run with sudo. When fwutil run without sudo, there are an exception: Traceback (most recent call last): File "/usr/local/bin/fwutil", line 5, in from fwutil.main import cli File "/usr/local/lib/python3.9/dist-packages/fwutil/__init__.py", line 3, in from . import main File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 40, in pdp = PlatformDataProvider() File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 159, in __init__ self.__platform = Platform() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__ self._chassis = Chassis() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 48, in __init__ self.__initialize_components() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 136, in __initialize_components component = Components(index) File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 184, in __init__ self.version = get_bios_version() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 19, in get_bios_version return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode() File "/usr/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode' How I did it Modification of dmidecode command How to verify it Run manually 'fwutil' (without sudo) Previous command output had exception New command output: Root privileges are required Signed-off-by: Taras Keryk tarasx.keryk@intel.com Signed-off-by: Taras Keryk * rewrite a call of dmidecode, when run without sudo Signed-off-by: Taras Keryk * Why I did it The previous implementaion of component.py expect fwutil run with sudo. When fwutil run without sudo, there are an exception: Traceback (most recent call last): File "/usr/local/bin/fwutil", line 5, in from fwutil.main import cli File "/usr/local/lib/python3.9/dist-packages/fwutil/__init__.py", line 3, in from . import main File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 40, in pdp = PlatformDataProvider() File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 159, in __init__ self.__platform = Platform() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/platform.py", line 21, in __init__ self._chassis = Chassis() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 48, in __init__ self.__initialize_components() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 136, in __initialize_components component = Components(index) File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 184, in __init__ self.version = get_bios_version() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/component.py", line 19, in get_bios_version return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode() File "/usr/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode' The previous implementaion of eeprom.py expect fwutil run with sudo. When fwutil run without sudo, there are an exception: Traceback (most recent call last): File "/usr/lib/python3.9/logging/config.py", line 564, in configure handler = self.configure_handler(handlers[name]) File "/usr/lib/python3.9/logging/config.py", line 745, in configure_handler result = factory(**kwargs) File "/usr/lib/python3.9/logging/handlers.py", line 153, in init BaseRotatingHandler.init(self, filename, mode, encoding=encoding, File "/usr/lib/python3.9/logging/handlers.py", line 58, in init logging.FileHandler.init(self, filename, mode=mode, File "/usr/lib/python3.9/logging/init.py", line 1142, in init StreamHandler.init(self, self._open()) File "/usr/lib/python3.9/logging/init.py", line 1171, in _open return open(self.baseFilename, self.mode, encoding=self.encoding, PermissionError: [Errno 13] Permission denied: '/var/log/platform.log' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/bin/fwutil", line 5, in from fwutil.main import cli File "/usr/local/lib/python3.9/dist-packages/fwutil/init.py", line 3, in from . import main File "/usr/local/lib/python3.9/dist-packages/fwutil/main.py", line 41, in pdp = PlatformDataProvider() File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 162, in init self.chassis_component_map = self.__get_chassis_component_map() File "/usr/local/lib/python3.9/dist-packages/fwutil/lib.py", line 168, in __get_chassis_component_map chassis_name = self.__chassis.get_name() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 146, in get_name return self._eeprom.modelstr() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 54, in _eeprom self.__eeprom = Eeprom() File "/usr/local/lib/python3.9/dist-packages/sonic_platform/eeprom.py", line 50, in init logging.config.dictConfig(config_dict) File "/usr/lib/python3.9/logging/config.py", line 809, in dictConfig dictConfigClass(config).configure() File "/usr/lib/python3.9/logging/config.py", line 571, in configure raise ValueError('Unable to configure handler ' ValueError: Unable to configure handler 'file' How I did it Modification call of dmidecode command. Added modification of log files access attributes before file open operations. How to verify it Run manually 'fwutil' (without sudo) New command output have no exception. Signed-off-by: Taras Keryk * Added file_check for checking access to log files for eeprom.py Signed-off-by: Taras Keryk * Removed unused import * Added logfile_create to eeprom.py and chassis.py Signed-off-by: Taras Keryk * Created platform_utils.py Signed-off-by: Taras Keryk * Added interpreter string to platform_utils.py Signed-off-by: Taras Keryk --- .../sonic_platform/chassis.py | 10 +++++++++ .../sonic_platform/component.py | 8 +++++-- .../sonic_platform/eeprom.py | 20 ++++------------- .../sonic_platform/platform_utils.py | 22 +++++++++++++++++++ 4 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py 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 64536abbb532..6d0e8b8c120c 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,8 +1,12 @@ #!/usr/bin/env python try: + import os import time import syslog + import logging + import logging.config + import yaml from sonic_platform_base.chassis_base import ChassisBase from sonic_platform.sfp import Sfp @@ -10,6 +14,7 @@ from sonic_platform.fan_drawer import fan_drawer_list_get from sonic_platform.thermal import thermal_list_get from eeprom import Eeprom + from platform_utils import file_create from sonic_platform.platform_thrift_client import pltfm_mgr_ready from sonic_platform.platform_thrift_client import thrift_try @@ -47,6 +52,11 @@ def __init__(self): self.qsfp_interval = self.QSFP_CHECK_INTERVAL self.__initialize_components() + with open(os.path.dirname(__file__) + "/logging.conf", 'r') as f: + config_dict = yaml.load(f, yaml.SafeLoader) + file_create(config_dict['handlers']['file']['filename'], '646') + logging.config.dictConfig(config_dict) + @property def _eeprom(self): if self.__eeprom is None: diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py index 5e72bb63e343..47a0993bf3e5 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py @@ -1,4 +1,5 @@ try: + import os import subprocess from sonic_platform_base.component_base import ComponentBase from platform_thrift_client import thrift_try @@ -16,9 +17,12 @@ def get_bios_version(): A string containing the firmware version of the BIOS """ try: - return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode() + cmd = ['dmidecode', '-s', 'bios-version'] + if os.geteuid() != 0: + cmd.insert(0, 'sudo') + return subprocess.check_output(cmd).strip().decode() except subprocess.CalledProcessError as e: - raise RuntimeError("Failed to getget BIOS version") + raise RuntimeError("Failed to get BIOS version") def get_bmc_version(): """ 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 ec7112b3c093..2335c02863d9 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 @@ -1,11 +1,7 @@ try: import os import sys - import errno import datetime - import logging - import logging.config - import yaml import re sys.path.append(os.path.dirname(__file__)) @@ -17,6 +13,7 @@ from sonic_platform_base.sonic_eeprom import eeprom_base from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo + from platform_utils import file_create from platform_thrift_client import thrift_try except ImportError as e: @@ -45,18 +42,8 @@ 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)): - try: - os.makedirs(os.path.dirname(_EEPROM_SYMLINK)) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - open(_EEPROM_SYMLINK, 'a').close() + file_create(_EEPROM_SYMLINK, '646') + file_create(_EEPROM_STATUS, '646') with open(_EEPROM_STATUS, 'w') as f: f.write("initializing..") @@ -152,3 +139,4 @@ def modelstr(self): def revision_str(self): return self.__tlv_get(self._TLV_CODE_LABEL_REVISION) + diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py new file mode 100644 index 000000000000..81e78ee01041 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/platform_utils.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +try: + import os + import subprocess + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +def file_create(path, mode=None): + def run_cmd(cmd): + if os.geteuid() != 0: + cmd.insert(0, 'sudo') + subprocess.check_output(cmd) + + file_path = os.path.dirname(path) + if not os.path.exists(file_path): + run_cmd(['mkdir', '-p', file_path]) + if not os.path.isfile(path): + run_cmd(['touch', path]) + if (mode is not None): + run_cmd(['chmod', mode, path]) From 3391969d2e3560ee2c73b617bf7332470c1c2b71 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 6 Apr 2022 11:34:02 +0800 Subject: [PATCH 102/119] [Ci]: Fix the docker slave azp template issue (#10453) Why I did it [Ci]: Fix the docker slave azp template issue --- .azure-pipelines/docker-sonic-slave-template.yml | 5 +++-- .azure-pipelines/docker-sonic-slave.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 2a9421dda338..ac5eb9a34722 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -40,7 +40,7 @@ jobs: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - template: template-clean-sonic-slave.yml - ${{ else }}: - - template: .azure-pipelines/template-variables.yml@buildimage + - template: '/.azure-pipelines/template-clean-sonic-slave.yml@buildimage' - checkout: self clean: true submodules: recursive @@ -103,7 +103,8 @@ jobs: command: push tags: | $(VARIABLE_SLAVE_BASE_TAG) - latest + ${{ if eq(variables['Build.SourceBranchName'], 'master') }}: + latest - ${{ if ne(parameters.arch, 'amd64') }}: - task: Docker@2 condition: ne(variables['Build.Reason'], 'PullRequest') diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index a6a9750a3808..7b812b8a4349 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -67,7 +67,7 @@ stages: arch: ${{ arch }} dist: ${{ dist }} - ${{ else }}: - - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + - template: '/.azure-pipelines/docker-sonic-slave-template.yml@buildimage' parameters: pool: sonicbld arch: ${{ arch }} From ce26c04a099dbae6021db934d5d0e7cc43598210 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 6 Apr 2022 13:51:41 +0800 Subject: [PATCH 103/119] [Build]: fix debian package not found issue (#10447) Why I did it [Build]: fix debian package not found issue --- sonic-slave-bullseye/Dockerfile.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index a75cef0b680e..741f708de269 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -20,7 +20,9 @@ RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bull echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list && \ echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \ echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian bullseye-backports main" >> /etc/apt/sources.list + echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian bullseye-backports main" >> /etc/apt/sources.list && \ + echo "deb [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb [arch=amd64] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free" >> /etc/apt/sources.list {%- if CONFIGURED_ARCH == "armhf" %} RUN echo "deb [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free" > /etc/apt/sources.list && \ From b152f2a0fc180237d44c6f95c7e0c0dca77b6ae0 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Wed, 6 Apr 2022 14:33:26 +0800 Subject: [PATCH 104/119] [sonic-cfggen]: Update unit test to remove asn 0 (#10454) Why I did it ASN range is from 1 to 4294967295, need to remove invalid ASN. How I did it Update unit test and replace ASN 0. How to verify it Run unit test for sonic-config-engine. Signed-off-by: Gang Lv ganglv@microsoft.com --- src/sonic-config-engine/tests/radv-test-sample-graph.xml | 2 +- src/sonic-config-engine/tests/sample-graph-resource-type.xml | 2 +- src/sonic-config-engine/tests/sample-graph-subintf.xml | 2 +- src/sonic-config-engine/tests/simple-sample-graph.xml | 2 +- src/sonic-config-engine/tests/t0-sample-graph.xml | 2 +- src/sonic-config-engine/tests/test_cfggen.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sonic-config-engine/tests/radv-test-sample-graph.xml b/src/sonic-config-engine/tests/radv-test-sample-graph.xml index 6945c8e175d2..a45e38f64030 100644 --- a/src/sonic-config-engine/tests/radv-test-sample-graph.xml +++ b/src/sonic-config-engine/tests/radv-test-sample-graph.xml @@ -90,7 +90,7 @@ - 0 + 1 BGPMonitor diff --git a/src/sonic-config-engine/tests/sample-graph-resource-type.xml b/src/sonic-config-engine/tests/sample-graph-resource-type.xml index f09e4112d8ff..aecc1bc3249f 100644 --- a/src/sonic-config-engine/tests/sample-graph-resource-type.xml +++ b/src/sonic-config-engine/tests/sample-graph-resource-type.xml @@ -72,7 +72,7 @@ - 0 + 1 BGPMonitor diff --git a/src/sonic-config-engine/tests/sample-graph-subintf.xml b/src/sonic-config-engine/tests/sample-graph-subintf.xml index 29568be727a7..fe18baa79db1 100644 --- a/src/sonic-config-engine/tests/sample-graph-subintf.xml +++ b/src/sonic-config-engine/tests/sample-graph-subintf.xml @@ -72,7 +72,7 @@ - 0 + 1 BGPMonitor diff --git a/src/sonic-config-engine/tests/simple-sample-graph.xml b/src/sonic-config-engine/tests/simple-sample-graph.xml index 388627f8cdbf..aef72017d72b 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph.xml @@ -72,7 +72,7 @@ - 0 + 1 BGPMonitor diff --git a/src/sonic-config-engine/tests/t0-sample-graph.xml b/src/sonic-config-engine/tests/t0-sample-graph.xml index f0da95149653..6d9e21c4f81b 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -90,7 +90,7 @@ - 0 + 1 BGPMonitor diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index e5ef35274db7..09f507f3d9f9 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -685,7 +685,7 @@ def test_minigraph_bgp_mon(self): output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), - 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'}}") + utils.to_dict("{'10.20.30.40': {'rrclient': 0, 'name': 'BGPMonitor', 'local_addr': '10.1.0.32', 'nhopself': 0, 'holdtime': '10', 'asn': '1', 'keepalive': '3'}}") ) def test_minigraph_bgp_voq_chassis_peer(self): From ed14eb526382dffa8c414255347c70800584a907 Mon Sep 17 00:00:00 2001 From: Vivek R Date: Wed, 6 Apr 2022 06:59:47 -0700 Subject: [PATCH 105/119] [interfaces-config] "main exception: cannot find interfaces: eth0" error log avoided (#10463) - Why I did it Fixes #9628 During bootup, this error log is seen Dec 22 04:26:29 sonic interfaces-config.sh[2546]: error: main exception: cannot find interfaces: eth0 (interface was probably never up ?) This is of non-functional nature and doesn't affect the flow. - How I did it Dont take the ifdown if not needed - How to verify it Verified during reboot. Log did not appear and IP was acquired on eth0 as expected Signed-off-by: Vivek Reddy Karri --- files/image_config/interfaces/interfaces-config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index 5753bebd378d..646fd7a94e71 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -1,6 +1,8 @@ #!/bin/bash -ifdown --force eth0 +if [[ $(ifquery --running eth0) ]]; then + ifdown --force eth0 +fi # Check if ZTP DHCP policy has been installed if [ -e /etc/network/ifupdown2/policy.d/ztp_dhcp.json ]; then From 614d14e8a098ba9cd5ca9788a6d3e4d696075df3 Mon Sep 17 00:00:00 2001 From: Vivek R Date: Wed, 6 Apr 2022 07:05:05 -0700 Subject: [PATCH 106/119] [submodule] update sonic-snmpagent pointer (#10461) 890f32f LLDPLocalSystemDataUpdater Exception Log Handled (#249) 2151731 Handle error seen on system where vlan interface map is not present (#246) c6141c7 [build] use Azure.sonic-buildimage.official.vs pipeline as artifact source (#248) Signed-off-by: Vivek Reddy Karri --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 2654f4a66794..890f32f333df 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 2654f4a667941296d4e56a16e8e1a7d1d5fca7b6 +Subproject commit 890f32f333dfe31c36a8342ff70c0e84910bf9c8 From 8cd346d80b1cb6247a8367ec08f09072a1722e4e Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Wed, 6 Apr 2022 09:44:21 -0700 Subject: [PATCH 107/119] Update docker-router-advertiser.supervisord.conf.j2 (#10375) --- .../docker-router-advertiser.supervisord.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7562444946ed..22f33e412195 100644 --- a/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 +++ b/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 @@ -45,7 +45,7 @@ dependent_startup_wait_for=rsyslogd:running {%- set vlan_v6 = namespace(count=0) -%} {%- if DEVICE_METADATA.localhost.deployment_id != "8" -%} {%- if DEVICE_METADATA.localhost.type -%} - {%- if "ToRRouter" in DEVICE_METADATA.localhost.type or DEVICE_METADATA.localhost.type == "EPMS" -%} + {%- 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... #} From d83ae1e3dce79200a89dda3926878b35b0f3f314 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Wed, 6 Apr 2022 17:46:41 -0700 Subject: [PATCH 108/119] [yang] Fix yang validation failure when table contains empty value (#10431) Why I did it Fix #9746 How I did it Split the check condition based on non-exist and zero length. How to verify it Run verification script when table contains empty value --- src/sonic-yang-mgmt/sonic_yang_ext.py | 23 +++++++++++-------- .../libyang-python-tests/test_sonic_yang.py | 15 ++++++++++++ .../tests/files/sample_config_db.json | 8 ++++++- .../tests/yang_model_tests/tests/tacacs.json | 4 ++-- .../yang-models/sonic-device_metadata.yang | 2 +- 5 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/sonic-yang-mgmt/sonic_yang_ext.py b/src/sonic-yang-mgmt/sonic_yang_ext.py index aa36ee0a1951..d43e52970302 100644 --- a/src/sonic-yang-mgmt/sonic_yang_ext.py +++ b/src/sonic-yang-mgmt/sonic_yang_ext.py @@ -591,18 +591,23 @@ def _xlateListInContainer(self, model, yang, configC, table, exceptionList): """ def _xlateContainerInContainer(self, model, yang, configC, table): ccontainer = model - #print(ccontainer['@name']) - yang[ccontainer['@name']] = dict() - if not configC.get(ccontainer['@name']): + ccName = ccontainer['@name'] + yang[ccName] = dict() + if ccName not in configC: + # Inner container doesn't exist in config return - self.sysLog(msg="xlateProcessListOfContainer: {}".format(ccontainer['@name'])) - self._xlateContainer(ccontainer, yang[ccontainer['@name']], \ - configC[ccontainer['@name']], table) + if len(configC[ccName]) == 0: + # Empty container, clean config and return + del configC[ccName] + return + self.sysLog(msg="xlateProcessListOfContainer: {}".format(ccName)) + self._xlateContainer(ccontainer, yang[ccName], \ + configC[ccName], table) # clean empty container - if len(yang[ccontainer['@name']]) == 0: - del yang[ccontainer['@name']] + if len(yang[ccName]) == 0: + del yang[ccName] # remove copy after processing - del configC[ccontainer['@name']] + del configC[ccName] return diff --git a/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py b/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py index 3eb396594e80..a13d4c02e9a0 100644 --- a/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py +++ b/src/sonic-yang-mgmt/tests/libyang-python-tests/test_sonic_yang.py @@ -364,5 +364,20 @@ def test_table_with_no_yang(self, sonic_yang_data): return + def test_special_json_with_yang(self, sonic_yang_data): + # in this test, we validate unusual json config and check if + # loadData works successfully + test_file = sonic_yang_data['test_file'] + syc = sonic_yang_data['syc'] + + # read config + jIn = self.readIjsonInput(test_file, 'SAMPLE_CONFIG_DB_SPECIAL_CASE') + jIn = json.loads(jIn) + + # load config and create Data tree + syc.loadData(jIn) + + return + def teardown_class(self): pass diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index ff99fc7335df..6618ed8232b7 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -304,7 +304,7 @@ "switch_id": "2", "switch_type": "voq", "max_cores": "8", - "sub_role": "FrondEnd", + "sub_role": "FrontEnd", "dhcp_server": "disabled" } }, @@ -1694,5 +1694,11 @@ "UNKNOWN_TABLE": { "Error": "This Table is for testing, This Table does not have YANG models." } + }, + "SAMPLE_CONFIG_DB_SPECIAL_CASE": { + "TACPLUS": { + "global": { + } + } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/tacacs.json b/src/sonic-yang-models/tests/yang_model_tests/tests/tacacs.json index 5236aab596fe..6888a4e3f326 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/tacacs.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/tacacs.json @@ -4,7 +4,7 @@ }, "TACPLUS_INVALID_TIMEOUT_TEST": { "desc": "Tacplus global configuration with invalid timeout value in TACPLUS table.", - "eStr": "TACACS timeout must be 1..60" + "eStr": "TACACS timeout must be 1..60" }, "TACPLUS_NOT_PRESENT_SRC_INTF_TEST": { "desc": "Tacplus global configuration with a non existent port in TACPLUS table.", @@ -15,7 +15,7 @@ }, "TACPLUS_SERVER_INVALID_PRIORITY_TEST": { "desc": "Tacplus server configuration with invalid priority value in TACPLUS_SERVER table.", - "eStr": "TACACS server priority must be 1..64" + "eStr": "TACACS server priority must be 1..64" }, "TACPLUS_SERVER_INVALID_TIMEOUT_TEST" : { "desc": "Tacplus server configuration with invalid timeout value in TACPLUS_SERVER table.", diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 618ed19cd81f..a349a3eb9366 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -129,7 +129,7 @@ module sonic-device_metadata { leaf sub_role { type string; - description "sub_role indicates if ASIC is FrondEnd or BackEnd."; + description "sub_role indicates if ASIC is FrontEnd or BackEnd."; } leaf downstream_subrole { From 0330253fd7df69e49cb082313277c29ccb0cfe8b Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 7 Apr 2022 13:02:35 +0800 Subject: [PATCH 109/119] [ci] Fix issues in docker-slave official build. (#10477) only push latest tag on master build --- .azure-pipelines/docker-sonic-slave-template.yml | 9 ++++++--- .azure-pipelines/docker-sonic-slave.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index ac5eb9a34722..2cf06638a4cc 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -101,10 +101,13 @@ jobs: containerRegistry: ${{ parameters.registry_conn }} repository: $(VARIABLE_SLAVE_BASE_IMAGE) command: push - tags: | - $(VARIABLE_SLAVE_BASE_TAG) - ${{ if eq(variables['Build.SourceBranchName'], 'master') }}: + ${{ if eq(variables['Build.SourceBranchName'], 'master') }}: + tags: | + $(VARIABLE_SLAVE_BASE_TAG) latest + ${{ else }}: + tags: | + $(VARIABLE_SLAVE_BASE_TAG) - ${{ if ne(parameters.arch, 'amd64') }}: - task: Docker@2 condition: ne(variables['Build.Reason'], 'PullRequest') diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 7b812b8a4349..3e1d2848277e 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -60,7 +60,7 @@ stages: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - - ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}: + - ${{ if eq(variables[''Build.Reason], 'PullRequest') }}: - template: docker-sonic-slave-template.yml parameters: pool: sonicbld From 3046c798a158dd0f1bb6fb00fb0c4f951b18ec34 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Thu, 7 Apr 2022 13:50:07 +0800 Subject: [PATCH 110/119] [sonic-cfggen]: Add port speed for UT (#10483) Why I did it Need to run yang validation for sonic-cfggen unit test, and many unit test does not provide speed for port table. How I did it Update minigraph xml. How to verify it Run sonic-cfggen unit test. Signed-off-by: Gang Lv ganglv@microsoft.com --- .../sample-minigraph-noportchannel.xml | 288 ++++++++++++ .../tests/multi_npu_data/sample-minigraph.xml | 288 ++++++++++++ .../tests/pc-test-graph.xml | 394 ++++++++++++++++ .../tests/radv-test-sample-graph.xml | 368 +++++++++++++++ .../tests/sample-arista-7050-t0-minigraph.xml | 60 +++ .../tests/sample-graph-resource-type.xml | 324 ++++++++++++++ .../tests/sample-graph-subintf.xml | 324 ++++++++++++++ .../tests/sample-voq-graph.xml | 360 +++++++++++++++ .../tests/sample_graph.xml | 422 +++++++++++++++++- .../tests/sample_output/py2/ports.json | 189 ++++++++ .../tests/sample_output/py3/ports.json | 189 ++++++++ .../tests/simple-sample-graph-case.xml | 336 ++++++++++++++ .../tests/simple-sample-graph-metadata.xml | 336 ++++++++++++++ .../tests/simple-sample-graph.xml | 324 ++++++++++++++ .../tests/t0-sample-bgp-speaker.xml | 394 ++++++++++++++++ .../tests/t0-sample-deployment-id.xml | 394 ++++++++++++++++ .../tests/t0-sample-graph-mvrf.xml | 392 ++++++++++++++++ .../tests/t0-sample-graph.xml | 368 +++++++++++++++ .../tests/t2-chassis-fe-graph-pc.xml | 312 +++++++++++++ .../tests/t2-chassis-fe-graph-vni.xml | 348 +++++++++++++++ .../tests/t2-chassis-fe-graph.xml | 348 +++++++++++++++ src/sonic-config-engine/tests/test_cfggen.py | 292 ++++++------ 22 files changed, 6903 insertions(+), 147 deletions(-) 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 index 460f71e21c2a..6ec84dc4fe31 100644 --- 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 @@ -1119,6 +1119,294 @@ 0 40000 + + DeviceInterface + + true + 1 + Ethernet-BP0 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP4 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP8 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP12 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP16 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP20 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP24 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP28 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP256 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP260 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP264 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP268 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP272 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP276 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP280 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP284 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP384 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP388 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP392 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP396 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP400 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP404 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP408 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP412 + + false + 0 + 0 + 40000 + true 0 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 5dac8e95bf1a..935d2c0c833a 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 @@ -1105,6 +1105,294 @@ 0 40000 + + DeviceInterface + + true + 1 + Ethernet-BP0 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP4 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP8 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP12 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP16 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP20 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP24 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP28 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP256 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP260 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP264 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP268 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP272 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP276 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP280 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP284 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP384 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP388 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP392 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP396 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP400 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP404 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP408 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet-BP412 + + false + 0 + 0 + 40000 + true 0 diff --git a/src/sonic-config-engine/tests/pc-test-graph.xml b/src/sonic-config-engine/tests/pc-test-graph.xml index 814686d8ff06..4a7ecabaf9f4 100644 --- a/src/sonic-config-engine/tests/pc-test-graph.xml +++ b/src/sonic-config-engine/tests/pc-test-graph.xml @@ -202,6 +202,400 @@ + + + + + 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 + + + Force10-S6000 + + + diff --git a/src/sonic-config-engine/tests/radv-test-sample-graph.xml b/src/sonic-config-engine/tests/radv-test-sample-graph.xml index a45e38f64030..94cb73d67464 100644 --- a/src/sonic-config-engine/tests/radv-test-sample-graph.xml +++ b/src/sonic-config-engine/tests/radv-test-sample-graph.xml @@ -508,6 +508,374 @@ + + + + + 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 + + + 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 4d216b30f203..4d79d6f2c457 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 @@ -463,6 +463,66 @@ + + DeviceInterface + + true + 1 + Ethernet0 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet2 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet3 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet4 + + false + 0 + 0 + 40000 + DeviceInterface diff --git a/src/sonic-config-engine/tests/sample-graph-resource-type.xml b/src/sonic-config-engine/tests/sample-graph-resource-type.xml index aecc1bc3249f..9ba4f1e70267 100644 --- a/src/sonic-config-engine/tests/sample-graph-resource-type.xml +++ b/src/sonic-config-engine/tests/sample-graph-resource-type.xml @@ -415,6 +415,330 @@ 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 diff --git a/src/sonic-config-engine/tests/sample-graph-subintf.xml b/src/sonic-config-engine/tests/sample-graph-subintf.xml index fe18baa79db1..d5fd2d461c8a 100644 --- a/src/sonic-config-engine/tests/sample-graph-subintf.xml +++ b/src/sonic-config-engine/tests/sample-graph-subintf.xml @@ -423,6 +423,330 @@ 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 diff --git a/src/sonic-config-engine/tests/sample-voq-graph.xml b/src/sonic-config-engine/tests/sample-voq-graph.xml index 5257efd4b0ae..5205265ee384 100644 --- a/src/sonic-config-engine/tests/sample-voq-graph.xml +++ b/src/sonic-config-engine/tests/sample-voq-graph.xml @@ -202,6 +202,366 @@ 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/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 + + + DeviceInterface + + true + 1 + Recycle0 + + false + 0 + 0 + 100000 + true 0 diff --git a/src/sonic-config-engine/tests/sample_graph.xml b/src/sonic-config-engine/tests/sample_graph.xml index 7bd08ab8f7c8..478fdd5ba8d4 100644 --- a/src/sonic-config-engine/tests/sample_graph.xml +++ b/src/sonic-config-engine/tests/sample_graph.xml @@ -88,7 +88,7 @@ - Ethernet1 + Ethernet4 10.10.2.13/30 @@ -112,7 +112,7 @@ 40000 DeviceInterfaceLink OCPSCH01040DDLF - Ethernet1 + Ethernet4 OCPSCH0104002MS Ethernet12 @@ -124,6 +124,424 @@ + + + + + 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 + + + Force10-Z9100 + + + 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 4b36790c7cd0..959a234eaace 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,104 @@ }, "OP": "SET" }, + { + "PORT_TABLE:Ethernet108": { + "speed": "100000", + "description": "fortyGigE0/108" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet100": { + "speed": "100000", + "description": "fortyGigE0/100" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet104": { + "speed": "100000", + "description": "fortyGigE0/104" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet68": { + "speed": "100000", + "description": "fortyGigE0/68" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet96": { + "speed": "100000", + "description": "fortyGigE0/96" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet124": { + "speed": "100000", + "description": "fortyGigE0/124" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet92": { + "speed": "100000", + "description": "fortyGigE0/92" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet120": { + "speed": "100000", + "description": "fortyGigE0/120" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet52": { + "speed": "100000", + "description": "fortyGigE0/52" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet56": { + "speed": "100000", + "description": "fortyGigE0/56" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet76": { + "speed": "100000", + "description": "fortyGigE0/76" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet72": { + "speed": "100000", + "description": "fortyGigE0/72" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet64": { + "speed": "100000", + "description": "fortyGigE0/64" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet32": { + "speed": "100000", + "description": "fortyGigE0/32" + }, + "OP": "SET" + }, { "PORT_TABLE:Ethernet16": { "speed": "1000", @@ -27,11 +125,102 @@ }, "OP": "SET" }, + { + "PORT_TABLE:Ethernet36": { + "speed": "100000", + "description": "fortyGigE0/36" + }, + "OP": "SET" + }, { "PORT_TABLE:Ethernet12": { "speed": "100000", "description": "Interface description" }, "OP": "SET" + }, + { + "PORT_TABLE:Ethernet88": { + "speed": "100000", + "description": "fortyGigE0/88" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet116": { + "speed": "100000", + "description": "fortyGigE0/116" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet80": { + "speed": "100000", + "description": "fortyGigE0/80" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet112": { + "speed": "100000", + "description": "fortyGigE0/112" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet84": { + "speed": "100000", + "description": "fortyGigE0/84" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet48": { + "speed": "100000", + "description": "fortyGigE0/48" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet44": { + "speed": "100000", + "description": "fortyGigE0/44" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet40": { + "speed": "100000", + "description": "fortyGigE0/40" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet28": { + "speed": "100000", + "description": "fortyGigE0/28" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet60": { + "speed": "100000", + "description": "fortyGigE0/60" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet20": { + "speed": "100000", + "description": "fortyGigE0/20" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet24": { + "speed": "100000", + "description": "fortyGigE0/24" + }, + "OP": "SET" } ] 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 1fee36338bd2..de9d4e25d1f3 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ports.json +++ b/src/sonic-config-engine/tests/sample_output/py3/ports.json @@ -33,5 +33,194 @@ "description": "fortyGigE0/16" }, "OP": "SET" + }, + { + "PORT_TABLE:Ethernet20": { + "speed": "100000", + "description": "fortyGigE0/20" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet24": { + "speed": "100000", + "description": "fortyGigE0/24" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet28": { + "speed": "100000", + "description": "fortyGigE0/28" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet32": { + "speed": "100000", + "description": "fortyGigE0/32" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet36": { + "speed": "100000", + "description": "fortyGigE0/36" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet40": { + "speed": "100000", + "description": "fortyGigE0/40" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet44": { + "speed": "100000", + "description": "fortyGigE0/44" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet48": { + "speed": "100000", + "description": "fortyGigE0/48" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet52": { + "speed": "100000", + "description": "fortyGigE0/52" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet56": { + "speed": "100000", + "description": "fortyGigE0/56" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet60": { + "speed": "100000", + "description": "fortyGigE0/60" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet64": { + "speed": "100000", + "description": "fortyGigE0/64" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet68": { + "speed": "100000", + "description": "fortyGigE0/68" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet72": { + "speed": "100000", + "description": "fortyGigE0/72" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet76": { + "speed": "100000", + "description": "fortyGigE0/76" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet80": { + "speed": "100000", + "description": "fortyGigE0/80" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet84": { + "speed": "100000", + "description": "fortyGigE0/84" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet88": { + "speed": "100000", + "description": "fortyGigE0/88" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet92": { + "speed": "100000", + "description": "fortyGigE0/92" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet96": { + "speed": "100000", + "description": "fortyGigE0/96" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet100": { + "speed": "100000", + "description": "fortyGigE0/100" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet104": { + "speed": "100000", + "description": "fortyGigE0/104" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet108": { + "speed": "100000", + "description": "fortyGigE0/108" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet112": { + "speed": "100000", + "description": "fortyGigE0/112" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet116": { + "speed": "100000", + "description": "fortyGigE0/116" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet120": { + "speed": "100000", + "description": "fortyGigE0/120" + }, + "OP": "SET" + }, + { + "PORT_TABLE:Ethernet124": { + "speed": "100000", + "description": "fortyGigE0/124" + }, + "OP": "SET" } ] 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 08f750457499..d6a8c394f604 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -527,6 +527,342 @@ 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 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 5691ff81578a..fbc33b49862a 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -321,6 +321,342 @@ 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 diff --git a/src/sonic-config-engine/tests/simple-sample-graph.xml b/src/sonic-config-engine/tests/simple-sample-graph.xml index aef72017d72b..a8bd8b0b4685 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph.xml @@ -415,6 +415,330 @@ 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 diff --git a/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml b/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml index f2690985d9f3..552d219964c2 100644 --- a/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml +++ b/src/sonic-config-engine/tests/t0-sample-bgp-speaker.xml @@ -327,6 +327,400 @@ + + + + + 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 + + + Force10-S6000 + + + diff --git a/src/sonic-config-engine/tests/t0-sample-deployment-id.xml b/src/sonic-config-engine/tests/t0-sample-deployment-id.xml index b6b47d979102..30517dfee19f 100644 --- a/src/sonic-config-engine/tests/t0-sample-deployment-id.xml +++ b/src/sonic-config-engine/tests/t0-sample-deployment-id.xml @@ -327,6 +327,400 @@ + + + + + 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 + + + Force10-S6000 + + + 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 e7e2b5789816..3fd73f7369fe 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml @@ -387,6 +387,398 @@ + + + + + DeviceInterface + + true + 1 + Ethernet0 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet4 + + 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 + + + DeviceInterface + + true + 1 + Ethernet124 + + false + 0 + 0 + 40000 + + + 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 6d9e21c4f81b..15fb1dc79210 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -498,6 +498,374 @@ + + + + + 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 + + + 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 bc1a5142fc86..212d9c76a647 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 @@ -296,6 +296,318 @@ 0 25000 + + DeviceInterface + + false + 1 + Ethernet24 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet28 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet32 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet36 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet40 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet44 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet48 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet52 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet56 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet60 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet64 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet68 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet72 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet76 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet80 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet84 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet88 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet92 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet96 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet100 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet104 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet108 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet112 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet116 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet120 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet124 + + false + 0 + 0 + 40000 + false 0 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 0dc534b3de88..9384446aa913 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 @@ -224,6 +224,354 @@ 0 40000 + + DeviceInterface + + false + 1 + Ethernet12 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet16 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet20 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet24 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet28 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet32 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet36 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet40 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet44 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet48 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet52 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet56 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet60 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet64 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet68 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet72 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet76 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet80 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet84 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet88 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet92 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet96 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet100 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet104 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet108 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet112 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet116 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet120 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet124 + + false + 0 + 0 + 40000 + false 0 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 3b0c56a57a70..3fd8ed01c215 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml @@ -223,6 +223,354 @@ 0 40000 + + DeviceInterface + + false + 1 + Ethernet12 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet16 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet20 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet24 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet28 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet32 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet36 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet40 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet44 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet48 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet52 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet56 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet60 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet64 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet68 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet72 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet76 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet80 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet84 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet88 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet92 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet96 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet100 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet104 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet108 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet112 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet116 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet120 + + false + 0 + 0 + 40000 + + + DeviceInterface + + false + 1 + Ethernet124 + + false + 0 + 0 + 40000 + false 0 diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 09f507f3d9f9..e1f6844dd5f2 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -396,37 +396,37 @@ def test_minigraph_port_autonegotiation(self): 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', 'tpid': '0x8100'}, " + "{'Ethernet0': {'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'tpid': '0x8100', 'speed': '40000'}, " "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000', 'fec': 'none'}, " - "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off', 'fec': 'none'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up'}, " - "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/16', 'admin_status': 'up'}, " - "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/20', 'admin_status': 'up'}, " - "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/24', 'admin_status': 'up'}, " - "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/28', 'admin_status': 'up'}, " - "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/32', 'admin_status': 'up'}, " - "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/36', 'admin_status': 'up'}, " - "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/40', 'admin_status': 'up'}, " - "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/44', 'admin_status': 'up'}, " - "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/48', 'admin_status': 'up'}, " - "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/52', 'admin_status': 'up'}, " - "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/56', 'admin_status': 'up'}, " - "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/60', 'admin_status': 'up'}, " - "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/64', 'admin_status': 'up'}, " - "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/68', 'admin_status': 'up'}, " - "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/72', 'admin_status': 'up'}, " - "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/76', 'admin_status': 'up'}, " - "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/80', 'admin_status': 'up'}, " - "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/84', 'admin_status': 'up'}, " - "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/88', 'admin_status': 'up'}, " - "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/92', 'admin_status': 'up'}, " - "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/96', 'admin_status': 'up'}, " - "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/100', 'admin_status': 'up'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/112', 'admin_status': 'up'}, " - "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/116', 'admin_status': 'up'}, " - "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/120', 'admin_status': 'up'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off', 'fec': 'none', 'speed': '40000'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100', 'speed': '40000'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100', 'speed': '40000'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'speed': '40000'}, " "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" ) ) @@ -437,38 +437,38 @@ def test_minigraph_port_autonegotiation(self): self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'autoneg': 'off'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'autoneg': 'off', 'speed': '40000'}, " "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000', 'fec': 'none'}, " - "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off', 'fec': 'none'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'autoneg': 'off'}, " - "'Ethernet104': {'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'autoneg': 'off'}, " - "'Ethernet108': {'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'autoneg': 'off'}, " - "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'autoneg': 'on'}, " - "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'autoneg': 'on'}, " - "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'autoneg': 'on'}, " - "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': 'off', 'fec': 'none', 'speed': '40000'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet104': {'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet108': {'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'autoneg': 'off', 'speed': '40000'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'autoneg': 'on', 'speed': '40000'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'autoneg': 'on', 'speed': '40000'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'autoneg': 'on', 'speed': '40000'}, " + "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'autoneg': 'on', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1', 'speed': '100000'}}" ) ) @@ -532,34 +532,34 @@ def test_minigraph_neighbor_interfaces(self): "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': 'on', 'mux_cable': 'true'}, " "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': 'on', 'mux_cable': 'true'}, " "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100'}}" + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}}" ) ) @@ -575,34 +575,34 @@ def test_minigraph_neighbor_interfaces_config_db(self): "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': 'on', 'mux_cable': 'true'}, " "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': 'on', 'mux_cable': 'true'}, " "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': 'on'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100'}}" + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}}" ) ) @@ -619,33 +619,33 @@ def test_minigraph_extra_ethernet_interfaces(self, **kwargs): "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, " "'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'tpid': '0x8100', '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', 'tpid': '0x8100', 'alias': 'fortyGigE0/16', 'speed': '1000'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100'}}" + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100', 'tpid': '0x8100', 'fec': 'rs', 'speed': '100000'}}" ) ) @@ -884,7 +884,9 @@ def test_minigraph_voq_inband_port(self): 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', - 'admin_status': 'up' + 'admin_status': 'up', + 'fec': 'rs', + 'speed': '100000' } ) From 16717d2dc51f74fa711ed7b4392ce5e4f7e71c29 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Thu, 7 Apr 2022 10:41:42 +0300 Subject: [PATCH 111/119] [submodule] Advance sonic-swss submodule. (#10404) In order to include the following commit: 0f06910 [PBH] Implement Edit Flows (Azure/sonic-swss#2169) sonic-swss 50d5be2 Make changes to support compiling on Bullseye with GCC 10 (#2216) 0870cf5 [mirrororch]: Implement HW resources availability validation for SPAN/ERSPAN (#2187) f4ec565 [vlanmgrd] fix use-after-free memory issue (#2211) c2de7fc [QosOrch] The notifications cannot be drained in QosOrch in case the first one needs to retry (#2206) 5575935 [neighsyncd] increase neighsyncd timeout (#2209) 0f06910 [PBH] Implement Edit Flows (#2169) 6241bbf Remove redundant and problematic code to skip "pool" field in buffer profile handling (#2197) a55343c [azp]: Set diff coverage threshhold to 80% (#2188) 390cae1 [portsorch]: Prevent LAG member configuration when port has active ACL binding (#2165) c1d47e6 [VNET]Fixing nexthop group delete during route change (#2198) 8941cc0 [BFD]Registering BFD state change callback during session creation (#2202) 680c539 [vxlan] Remove tunnel map objects on VNET tunnel removal (#2150) 20dde0c Fix for handling broadcom DNX ASIC to have ipv4 and ipv6 ACL rules in separate tables. (#2178) 5b7c949 [FdbOrch] SAI_FDB_EVENT_MOVE generates update with empty update.entry.port_name (#2200) 7350d49 [Vxlanmgr] vnet netdev cleanup during config reload fix (#2191) 2bef62b Validate LAG has members before mirror session create (#2130) 1e4d4ce [VS test] Increase VS test time, skip dpb flaky test (#2195) 6eda965 [vstest]Migrating vs tests from using click commands to direct DB access (#2179) Signed-off-by: Nazarii Hnydyn --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index d80094b248e7..50d5be2b399e 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit d80094b248e7df5ac9df309d785ddf21e0ab92d7 +Subproject commit 50d5be2b399e9bcc43973f99d72d76e4effd8cc0 From 4426f7715fd4f5442e63e5efe759ad86006e9196 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 7 Apr 2022 14:23:35 +0300 Subject: [PATCH 112/119] [scapy] update scapy to 2.4.5 and patch it (#10457) Why I did it Running warm-reboot in a loop for 500 times leads to this error on 318-th iteration: Apr 2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors Traceback (most recent call last): Apr 2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors File "/usr/bin/restore_neighbors.py", line 24, in Apr 2 15:56:27.346747 sonic INFO swss#/supervisord: restore_neighbors from scapy.all import conf, in6_getnsma, inet_pton, inet_ntop, in6_getnsmac, get_if_hwaddr, Ether, ARP, IPv6, ICMPv6ND_NS, ICMPv6NDOptSrcLLAddr Apr 2 15:56:27.346795 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/all.py", line 25, in Apr 2 15:56:27.346956 sonic INFO swss#/supervisord: restore_neighbors from scapy.route import * Apr 2 15:56:27.346995 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/route.py", line 205, in Apr 2 15:56:27.347089 sonic INFO swss#/supervisord: restore_neighbors conf.iface = get_working_if() Apr 2 15:56:27.347129 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/arch/linux.py", line 128, in get_working_if Apr 2 15:56:27.347213 sonic INFO swss#/supervisord: restore_neighbors ifflags = struct.unpack("16xH14x", get_if(i, SIOCGIFFLAGS))[0] Apr 2 15:56:27.347250 sonic INFO swss#/supervisord: restore_neighbors File "/usr/local/lib/python3.7/dist-packages/scapy/arch/common.py", line 31, in get_if Apr 2 15:56:27.347345 sonic INFO swss#/supervisord: restore_neighbors return ioctl(sck, cmd, struct.pack("16s16x", iff.encode("utf8"))) Apr 2 15:56:27.347365 sonic INFO swss#/supervisord: restore_neighbors OSError: [Errno 19] No such device The issue was reported to scapy devs secdev/scapy#3369, the fix is secdev/scapy#3371, however there is no released scapy version with this fix right now, thus decided to build scapy v2.4.5 from sources and apply the fix in a form of a patch. Signed-off-by: Stepan Blyschak --- .gitmodules | 3 ++ dockers/docker-orchagent/Dockerfile.j2 | 9 +++- rules/docker-orchagent.mk | 1 + rules/scapy.dep | 10 +++++ rules/scapy.mk | 7 ++++ src/scapy | 1 + ...ng-generation-when-scapy-is-a-submod.patch | 27 ++++++++++++ ...f-the-network-interface-still-exists.patch | 42 +++++++++++++++++++ src/scapy.patch/series | 2 + 9 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 rules/scapy.dep create mode 100644 rules/scapy.mk create mode 160000 src/scapy create mode 100644 src/scapy.patch/0001-Fix-version-string-generation-when-scapy-is-a-submod.patch create mode 100644 src/scapy.patch/0002-Check-if-the-network-interface-still-exists.patch create mode 100644 src/scapy.patch/series diff --git a/.gitmodules b/.gitmodules index f79031a7d22c..b2d76bd66b20 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,6 +62,9 @@ [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 diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index f71f31cfc0ac..ea4e0abbc2ef 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -40,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 @@ -57,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 \ diff --git a/rules/docker-orchagent.mk b/rules/docker-orchagent.mk index d9453465c702..ef0c203877d8 100644 --- a/rules/docker-orchagent.mk +++ b/rules/docker-orchagent.mk @@ -10,6 +10,7 @@ $(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_DEPENDS) $(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \ $(LIBSWSSCOMMON_DBG) \ $(LIBSAIREDIS_DBG) +$(DOCKER_ORCHAGENT)_PYTHON_WHEELS += $(SCAPY) $(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BUSTER)_DBG_IMAGE_PACKAGES) 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/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/series b/src/scapy.patch/series new file mode 100644 index 000000000000..d64f20f136c1 --- /dev/null +++ b/src/scapy.patch/series @@ -0,0 +1,2 @@ +0001-Fix-version-string-generation-when-scapy-is-a-submod.patch +0002-Check-if-the-network-interface-still-exists.patch From baa24b3cb1e0063bc447418fe50b028a04ebc62e Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Thu, 7 Apr 2022 20:04:43 +0800 Subject: [PATCH 113/119] [Ci]: exclude innovium build and increase broadcom build timeout (#10482) Why I did it Exclude the innovium build in upgrading version build, currently, the builds are always failed, exclude the build temporarily. Increase the broadcom build timeout. --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 1 - .azure-pipelines/azure-pipelines-build.yml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index 35988f71b9b4..cc6135b045ef 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -38,7 +38,6 @@ parameters: - centec - centec-arm64 - generic - - innovium - marvell-armhf - mellanox diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 7c312de85931..0b033e959300 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -50,6 +50,7 @@ jobs: swi_image: yes - name: broadcom + timeoutInMinutes: 1440 variables: dbg_image: yes swi_image: yes From 07fad261dc2d580431c3a05e7869297da53b5b55 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 7 Apr 2022 20:39:46 +0800 Subject: [PATCH 114/119] [submodule] Advance sonic-platform-common pointer (#10469) Update sonic-platform-common submodule to pickup new commits: 01512ec [SSD]Enhance ssd_generic with more error handling to avoid python crash Azure/sonic-platform-common#271 ac3e7f1 [y_cable][Broadcom] update the BRCM y_cable driver to release 2.0 Azure/sonic-platform-common#263 573717a [Credo][Ycable] Fix Credo firmware download API download_firmware flag Azure/sonic-platform-common#269 a844f18 [xcvr] Add get_module_fw_info method to XcvrApi class. Azure/sonic-platform-common#267 35bad16 [sfputil]Refactoring read_porttab_mappings Azure/sonic-platform-common#264 83c4345 [SSD Generic] Add support for parsing nvme ssd model, health and temperature Azure/sonic-platform-common#265 5da31e1 [ycable][credo] Fix the is_link_active API for Credo Ycable Azure/sonic-platform-common#260 931c6ea [Y-Cable][Credo] add theading locker to support thread-safe calling, add SKU check for download_firmware API. Azure/sonic-platform-common#222 ff3aa75 Fix SFF8472 Enhanced Options Azure/sonic-platform-common#259 a8a83e9 [ssd] Allow individual vendor parsers to handle errors Azure/sonic-platform-common#252 Signed-off-by: Kebo Liu --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index ee122155e0f6..01512ecce4d6 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit ee122155e0f6e40b483d24737c5f1b729bdbf111 +Subproject commit 01512ecce4d6ce7272c0bbb7a5d47a1c02d92221 From faabf00f829d685946b2e6d9a50eebfc5592d4dc Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Thu, 7 Apr 2022 20:02:31 +0530 Subject: [PATCH 115/119] [Marvell] Update armhf sai deb (#10403) 1) DHCP trap for IPV4 and IPV6 2) Interface ACL's (Ingress Everflow support) 3) 1G Autoneg support Signed-off-by: Rajkumar Pennadam Ramamoorthy --- platform/marvell-armhf/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/marvell-armhf/sai.mk b/platform/marvell-armhf/sai.mk index 4df1b2c5b6f6..4ecfdce244a1 100644 --- a/platform/marvell-armhf/sai.mk +++ b/platform/marvell-armhf/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.9.1-1 +export MRVL_SAI_VERSION = 1.9.1-2 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai From e348dff77a7879b8fe08114cdb16f37632a7d39e Mon Sep 17 00:00:00 2001 From: dflynn-Nokia <60479697+dflynn-Nokia@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:44:31 -0400 Subject: [PATCH 116/119] [Nokia ixs7215] Platform API temperature threshold value fixes (#10372) Incorrect high-threshold and critical-high-threshold values are displayed for some of the temperature sensors. This commit fixes that. --- .../7215/sonic_platform/test/test-thermal.py | 2 +- .../7215/sonic_platform/thermal.py | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) 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 91ef75d8f9a7..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 @@ -30,7 +30,7 @@ def main(): high_thresh = "NA" print(" Low Threshold(C): {}, High Threshold(C): {}".format(low_thresh, - high_thresh)) + high_thresh)) try: crit_low_thresh = thermal.get_low_critical_threshold() 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 c7e408c3f3e9..444ca5b137d7 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 @@ -44,8 +44,8 @@ def __init__(self, thermal_index): 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 + '/' @@ -53,8 +53,8 @@ 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 hwmon_node = os.listdir(i2c_path)[0] self.SENSOR_DIR = i2c_path + hwmon_node + '/' @@ -62,8 +62,8 @@ def __init__(self, thermal_index): 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 + '/' @@ -72,16 +72,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 From f311947cfa5f90b77a380e37e7924b29716d5866 Mon Sep 17 00:00:00 2001 From: saksarav-nokia Date: Thu, 7 Apr 2022 17:34:32 -0400 Subject: [PATCH 117/119] [Nokia][device] Updated the BCM config file to reduce the CPU usage (#10485) Signed-off-by: Sakthivadivu Saravanaraj --- .../Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm | 3 ++- .../Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm index 2ede5ab6d0d0..bbafccdc377e 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm @@ -1263,8 +1263,9 @@ phy_tx_polarity_flip_phy143.BCM8885X=0 polled_irq_delay.BCM8885X=5 -polled_irq_mode.BCM8885X=1 +polled_irq_mode.BCM8885X=0 port_fec_fabric.BCM8885X=7 +bcm_stat_interval.BCM8885X=1000000 port_init_cl72_1=0 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm index fd96c3ac4368..ce7f77de5bb2 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm @@ -1263,8 +1263,9 @@ phy_tx_polarity_flip_phy143.BCM8885X=0 polled_irq_delay.BCM8885X=5 -polled_irq_mode.BCM8885X=1 +polled_irq_mode.BCM8885X=0 port_fec_fabric.BCM8885X=7 +bcm_stat_interval.BCM8885X=1000000 port_init_cl72_1=0 From 47db2b2993b81b491b8150bb92b2ebdd579da4c8 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Thu, 7 Apr 2022 17:56:52 -0400 Subject: [PATCH 118/119] [hostcfgd] Move hostcfgd back to ConfigDBConnector for subscribing to updates (#10168) #### Why I did it As of https://github.com/Azure/sonic-swss-common/pull/587 the blackout issue in ConfigDBConnector has been resolved. In the past hostcfgd was refactored to use SubscriberStateTable instead of ConfigDBConnector for subscribing to CONFIG_DB updates due to a "blackout" period between hostcfgd pulling the table data down and running the initialization and actually calling `listen()` on ConfigDBConnector which starts the update handler. However SusbscriberStateTable creates many file descriptors against the redis DB which is inefficient compared to ConfigDBConnector which only opens a single file descriptor. With the new fix to ConfigDBConnector I refactored hostcfgd to take advantage of these updates. #### How I did it Replaced SubscriberStateTable with ConfigDBConnector #### How to verify it The functionality of hostcfgd can be verified by booting the switch and verifying that NTP is properly configured. To check the blackout period you can add a delay in the hostcfgd `load()` function and also add a print statement before and after the load so you know when it occurs. Then restart hostcfgd and wait for the load to start, then during the load push a partial change to the FEATURE table and verify that the change is picked up and the feature is enabled after the load period finishes. #### Description for the changelog [hostcfgd] Move hostcfgd back to ConfigDBConnector for subscribing to updates --- src/sonic-host-services/scripts/hostcfgd | 175 +++++++++--------- .../tests/common/mock_configdb.py | 74 +------- .../tests/hostcfgd/hostcfgd_radius_test.py | 6 +- .../tests/hostcfgd/hostcfgd_tacacs_test.py | 5 +- .../tests/hostcfgd/hostcfgd_test.py | 16 +- 5 files changed, 100 insertions(+), 176 deletions(-) diff --git a/src/sonic-host-services/scripts/hostcfgd b/src/sonic-host-services/scripts/hostcfgd index 5b6693fbcdf7..7f8f4be0b2e7 100755 --- a/src/sonic-host-services/scripts/hostcfgd +++ b/src/sonic-host-services/scripts/hostcfgd @@ -11,8 +11,7 @@ import signal import jinja2 from sonic_py_common import device_info -from swsscommon.swsscommon import SubscriberStateTable, DBConnector, Select -from swsscommon.swsscommon import ConfigDBConnector, TableConsumable, Table +from swsscommon.swsscommon import ConfigDBConnector, DBConnector, Table # FILE PAM_AUTH_CONF = "/etc/pam.d/common-auth-sonic" @@ -207,21 +206,23 @@ class FeatureHandler(object): else: self.resync_feature_state(self._cached_config[feature_name]) - def sync_state_field(self): + def sync_state_field(self, feature_table): """ Summary: Updates the state field in the FEATURE|* tables as the state field might have to be rendered based on DEVICE_METADATA table """ - feature_table = self._config_db.get_table('FEATURE') for feature_name in feature_table.keys(): if not feature_name: syslog.syslog(syslog.LOG_WARNING, "Feature is None") continue feature = Feature(feature_name, feature_table[feature_name], self._device_config) - if not feature.compare_state(feature_name, feature_table.get(feature_name, {})): - self.resync_feature_state(feature) + + self._cached_config.setdefault(feature_name, feature) + self.update_feature_auto_restart(feature, feature_name) + self.update_feature_state(feature) + self.resync_feature_state(feature) def update_feature_state(self, feature): cached_feature = self._cached_config[feature.name] @@ -406,6 +407,10 @@ class Iptables(object): ''' return (isinstance(key, tuple)) + def load(self, lpbk_table): + for row in lpbk_table: + self.iptables_handler(row, lpbk_table[row]) + def command(self, chain, ip, ver, op): cmd = 'iptables' if ver == '4' else 'ip6tables' cmd += ' -t mangle --{} {} -p tcp --tcp-flags SYN SYN'.format(op, chain) @@ -890,15 +895,13 @@ class KdumpCfg(object): memory = self.kdump_defaults["memory"] if data.get("memory") is not None: memory = data.get("memory") - if data.get("memory") is not None: - run_cmd("sonic-kdump-config --memory " + memory) + run_cmd("sonic-kdump-config --memory " + memory) # Num dumps num_dumps = self.kdump_defaults["num_dumps"] if data.get("num_dumps") is not None: num_dumps = data.get("num_dumps") - if data.get("num_dumps") is not None: - run_cmd("sonic-kdump-config --num_dumps " + num_dumps) + run_cmd("sonic-kdump-config --num_dumps " + num_dumps) class NtpCfg(object): """ @@ -912,6 +915,15 @@ class NtpCfg(object): self.ntp_global = {} self.ntp_servers = set() + def load(self, ntp_global_conf, ntp_server_conf): + syslog.syslog(syslog.LOG_INFO, "NtpCfg load ...") + + for row in ntp_global_conf: + self.ntp_global_update(row, ntp_global_conf[row], is_load=True) + + # Force reload on init + self.ntp_server_update(0, None, is_load=True) + def handle_ntp_source_intf_chg(self, intf_name): # if no ntp server configured, do nothing if not self.ntp_servers: @@ -925,7 +937,7 @@ class NtpCfg(object): cmd = 'systemctl restart ntp-config' run_cmd(cmd) - def ntp_global_update(self, key, data): + def ntp_global_update(self, key, data, is_load=False): syslog.syslog(syslog.LOG_INFO, 'NTP GLOBAL Update') orig_src = self.ntp_global.get('src_intf', '') orig_src_set = set(orig_src.split(";")) @@ -938,6 +950,9 @@ class NtpCfg(object): # Update the Local Cache self.ntp_global = data + # If initial load don't restart daemon + if is_load: return + # check if ntp server configured, if not, do nothing if not self.ntp_servers: syslog.syslog(syslog.LOG_INFO, "No ntp server when global config change, do nothing") @@ -954,16 +969,19 @@ class NtpCfg(object): cmd = 'service ntp restart' run_cmd(cmd) - def ntp_server_update(self, key, op): + def ntp_server_update(self, key, op, is_load=False): syslog.syslog(syslog.LOG_INFO, 'ntp server update key {}'.format(key)) restart_config = False - if op == "SET" and key not in self.ntp_servers: - restart_config = True - self.ntp_servers.add(key) - elif op == "DEL" and key in self.ntp_servers: + if not is_load: + if op == "SET" and key not in self.ntp_servers: + restart_config = True + self.ntp_servers.add(key) + elif op == "DEL" and key in self.ntp_servers: + restart_config = True + self.ntp_servers.remove(key) + else: restart_config = True - self.ntp_servers.remove(key) if restart_config: cmd = 'systemctl restart ntp-config' @@ -1034,31 +1052,24 @@ class HostConfigDaemon: # before moving forward self.config_db = ConfigDBConnector() self.config_db.connect(wait_for_init=True, retry_on=True) - self.dbconn = DBConnector(CFG_DB, 0) - self.state_db_conn = DBConnector(STATE_DB, 0) - self.selector = Select() syslog.syslog(syslog.LOG_INFO, 'ConfigDB connect success') - self.select = Select() - self.callbacks = dict() - self.subscriber_map = dict() - - feature_state_table = Table(self.state_db_conn, 'FEATURE') - # Load DEVICE metadata configurations self.device_config = {} self.device_config['DEVICE_METADATA'] = self.config_db.get_table('DEVICE_METADATA') + # Load feature state table + self.state_db_conn = DBConnector(STATE_DB, 0) + feature_state_table = Table(self.state_db_conn, 'FEATURE') + # Initialize KDump Config and set the config to default if nothing is provided self.kdumpCfg = KdumpCfg(self.config_db) - self.kdumpCfg.load(self.config_db.get_table('KDUMP')) # Initialize IpTables self.iptables = Iptables() # Intialize Feature Handler self.feature_handler = FeatureHandler(self.config_db, feature_state_table, self.device_config) - self.feature_handler.sync_state_field() # Initialize Ntp Config Handler self.ntpcfg = NtpCfg() @@ -1073,21 +1084,28 @@ class HostConfigDaemon: self.pamLimitsCfg = PamLimitsCfg(self.config_db) self.pamLimitsCfg.update_config_file() - def load(self): - aaa = self.config_db.get_table('AAA') - tacacs_global = self.config_db.get_table('TACPLUS') - tacacs_server = self.config_db.get_table('TACPLUS_SERVER') - radius_global = self.config_db.get_table('RADIUS') - radius_server = self.config_db.get_table('RADIUS_SERVER') + def load(self, init_data): + features = init_data['FEATURE'] + aaa = init_data['AAA'] + tacacs_global = init_data['TACPLUS'] + tacacs_server = init_data['TACPLUS_SERVER'] + radius_global = init_data['RADIUS'] + radius_server = init_data['RADIUS_SERVER'] + lpbk_table = init_data['LOOPBACK_INTERFACE'] + ntp_server = init_data['NTP_SERVER'] + ntp_global = init_data['NTP'] + kdump = init_data['KDUMP'] + + self.feature_handler.sync_state_field(features) self.aaacfg.load(aaa, tacacs_global, tacacs_server, radius_global, radius_server) + self.iptables.load(lpbk_table) + self.ntpcfg.load(ntp_global, ntp_server) + self.kdumpCfg.load(kdump) - try: - dev_meta = self.config_db.get_table('DEVICE_METADATA') - if 'localhost' in dev_meta: - if 'hostname' in dev_meta['localhost']: - self.hostname_cache = dev_meta['localhost']['hostname'] - except Exception as e: - pass + dev_meta = self.config_db.get_table('DEVICE_METADATA') + if 'localhost' in dev_meta: + if 'hostname' in dev_meta['localhost']: + self.hostname_cache = dev_meta['localhost']['hostname'] # Update AAA with the hostname self.aaacfg.hostname_update(self.hostname_cache) @@ -1181,40 +1199,38 @@ class HostConfigDaemon: systemctl_cmd = "sudo systemctl is-system-running --wait --quiet" subprocess.call(systemctl_cmd, shell=True) - def subscribe(self, table, callback, pri): - try: - if table not in self.callbacks: - self.callbacks[table] = [] - subscriber = SubscriberStateTable(self.dbconn, table, TableConsumable.DEFAULT_POP_BATCH_SIZE, pri) - self.selector.addSelectable(subscriber) # Add to the Selector - self.subscriber_map[subscriber.getFd()] = (subscriber, table) # Maintain a mapping b/w subscriber & fd + def register_callbacks(self): - self.callbacks[table].append(callback) - except Exception as err: - syslog.syslog(syslog.LOG_ERR, "Subscribe to table {} failed with error {}".format(table, err)) + def make_callback(func): + def callback(table, key, data): + if data is None: + op = "DEL" + else: + op = "SET" + return func(key, op, data) + return callback - def register_callbacks(self): - self.subscribe('KDUMP', lambda table, key, op, data: self.kdump_handler(key, op, data), HOSTCFGD_MAX_PRI) + self.config_db.subscribe('KDUMP', make_callback(self.kdump_handler)) # Handle FEATURE updates before other tables - self.subscribe('FEATURE', lambda table, key, op, data: self.feature_handler.handle(key, op, data), HOSTCFGD_MAX_PRI-1) + self.config_db.subscribe('FEATURE', make_callback(self.feature_handler.handle)) # Handle AAA, TACACS and RADIUS related tables - self.subscribe('AAA', lambda table, key, op, data: self.aaa_handler(key, op, data), HOSTCFGD_MAX_PRI-2) - self.subscribe('TACPLUS', lambda table, key, op, data: self.tacacs_global_handler(key, op, data), HOSTCFGD_MAX_PRI-2) - self.subscribe('TACPLUS_SERVER', lambda table, key, op, data: self.tacacs_server_handler(key, op, data), HOSTCFGD_MAX_PRI-2) - self.subscribe('RADIUS', lambda table, key, op, data: self.radius_global_handler(key, op, data), HOSTCFGD_MAX_PRI-2) - self.subscribe('RADIUS_SERVER', lambda table, key, op, data: self.radius_server_handler(key, op, data), HOSTCFGD_MAX_PRI-2) + self.config_db.subscribe('AAA', make_callback(self.aaa_handler)) + self.config_db.subscribe('TACPLUS', make_callback(self.tacacs_global_handler)) + self.config_db.subscribe('TACPLUS_SERVER', make_callback(self.tacacs_server_handler)) + self.config_db.subscribe('RADIUS', make_callback(self.radius_global_handler)) + self.config_db.subscribe('RADIUS_SERVER', make_callback(self.radius_server_handler)) # Handle IPTables configuration - self.subscribe('LOOPBACK_INTERFACE', lambda table, key, op, data: self.lpbk_handler(key, op, data), HOSTCFGD_MAX_PRI-3) + self.config_db.subscribe('LOOPBACK_INTERFACE', make_callback(self.lpbk_handler)) # Handle NTP & NTP_SERVER updates - self.subscribe('NTP', lambda table, key, op, data: self.ntp_global_handler(key, op, data), HOSTCFGD_MAX_PRI-4) - self.subscribe('NTP_SERVER', lambda table, key, op, data: self.ntp_server_handler(key, op, data), HOSTCFGD_MAX_PRI-4) + self.config_db.subscribe('NTP', make_callback(self.ntp_global_handler)) + self.config_db.subscribe('NTP_SERVER', make_callback(self.ntp_server_handler)) # Handle updates to src intf changes in radius - self.subscribe('MGMT_INTERFACE', lambda table, key, op, data: self.mgmt_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - self.subscribe('VLAN_INTERFACE', lambda table, key, op, data: self.vlan_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - self.subscribe('VLAN_SUB_INTERFACE', lambda table, key, op, data: self.vlan_sub_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - self.subscribe('PORTCHANNEL_INTERFACE', lambda table, key, op, data: self.portchannel_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - self.subscribe('INTERFACE', lambda table, key, op, data: self.phy_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - + self.config_db.subscribe('MGMT_INTERFACE', make_callback(self.mgmt_intf_handler)) + self.config_db.subscribe('VLAN_INTERFACE', make_callback(self.vlan_intf_handler)) + self.config_db.subscribe('VLAN_SUB_INTERFACE', make_callback(self.vlan_sub_intf_handler)) + self.config_db.subscribe('PORTCHANNEL_INTERFACE', make_callback(self.portchannel_intf_handler)) + self.config_db.subscribe('INTERFACE', make_callback(self.phy_intf_handler)) + syslog.syslog(syslog.LOG_INFO, "Waiting for systemctl to finish initialization") self.wait_till_system_init_done() @@ -1222,27 +1238,7 @@ class HostConfigDaemon: "systemctl has finished initialization -- proceeding ...") def start(self): - while True: - state, selectable_ = self.selector.select(DEFAULT_SELECT_TIMEOUT) - if state == self.selector.TIMEOUT: - continue - elif state == self.selector.ERROR: - syslog.syslog(syslog.LOG_ERR, - "error returned by select") - continue - - fd = selectable_.getFd() - # Get the Corresponding subscriber & table - subscriber, table = self.subscriber_map.get(fd, (None, "")) - if not subscriber: - syslog.syslog(syslog.LOG_ERR, - "No Subscriber object found for fd: {}, subscriber map: {}".format(fd, subscriber_map)) - continue - key, op, fvs = subscriber.pop() - # Get the registered callback - cbs = self.callbacks.get(table, None) - for callback in cbs: - callback(table, key, op, dict(fvs)) + self.config_db.listen(init_data_handler=self.load) def main(): @@ -1251,7 +1247,6 @@ def main(): signal.signal(signal.SIGHUP, signal_handler) daemon = HostConfigDaemon() daemon.register_callbacks() - daemon.load() daemon.start() if __name__ == "__main__": diff --git a/src/sonic-host-services/tests/common/mock_configdb.py b/src/sonic-host-services/tests/common/mock_configdb.py index 138869dc3bee..f0b12b11abf9 100644 --- a/src/sonic-host-services/tests/common/mock_configdb.py +++ b/src/sonic-host-services/tests/common/mock_configdb.py @@ -4,9 +4,10 @@ class MockConfigDb(object): """ STATE_DB = None CONFIG_DB = None + event_queue = [] def __init__(self, **kwargs): - pass + self.handlers = {} @staticmethod def set_config_db(test_config_db): @@ -44,73 +45,12 @@ def set_entry(self, key, field, data): def get_table(self, table_name): return MockConfigDb.CONFIG_DB[table_name] + def subscribe(self, table_name, callback): + self.handlers[table_name] = callback -class MockSelect(): - - event_queue = [] - - @staticmethod - def set_event_queue(Q): - MockSelect.event_queue = Q - - @staticmethod - def get_event_queue(): - return MockSelect.event_queue - - @staticmethod - def reset_event_queue(): - MockSelect.event_queue = [] - - def __init__(self): - self.sub_map = {} - self.TIMEOUT = "TIMEOUT" - self.ERROR = "ERROR" - - def addSelectable(self, subscriber): - self.sub_map[subscriber.table] = subscriber - - def select(self, TIMEOUT): - if not MockSelect.get_event_queue(): - raise TimeoutError - table, key = MockSelect.get_event_queue().pop(0) - self.sub_map[table].nextKey(key) - return "OBJECT", self.sub_map[table] - - -class MockSubscriberStateTable(): - - FD_INIT = 0 - - @staticmethod - def generate_fd(): - curr = MockSubscriberStateTable.FD_INIT - MockSubscriberStateTable.FD_INIT = curr + 1 - return curr - - @staticmethod - def reset_fd(): - MockSubscriberStateTable.FD_INIT = 0 - - def __init__(self, conn, table, pop, pri): - self.fd = MockSubscriberStateTable.generate_fd() - self.next_key = '' - self.table = table - - def getFd(self): - return self.fd - - def nextKey(self, key): - self.next_key = key - - def pop(self): - table = MockConfigDb.CONFIG_DB.get(self.table, {}) - if self.next_key not in table: - op = "DEL" - fvs = {} - else: - op = "SET" - fvs = table.get(self.next_key, {}) - return self.next_key, op, fvs + def listen(self, init_data_handler=None): + for e in MockConfigDb.event_queue: + self.handlers[e[0]](e[0], e[1], self.get_entry(e[0], e[1])) class MockDBConnector(): diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py index 9738f16852e5..c08cd1829add 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py @@ -10,8 +10,7 @@ from parameterized import parameterized from unittest import TestCase, mock from tests.hostcfgd.test_radius_vectors import HOSTCFGD_TEST_RADIUS_VECTOR -from tests.common.mock_configdb import MockConfigDb, MockSubscriberStateTable -from tests.common.mock_configdb import MockSelect, MockDBConnector +from tests.common.mock_configdb import MockConfigDb, MockDBConnector test_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -33,12 +32,9 @@ # Mock swsscommon classes hostcfgd.ConfigDBConnector = MockConfigDb -hostcfgd.SubscriberStateTable = MockSubscriberStateTable -hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector hostcfgd.Table = mock.Mock() - class TestHostcfgdRADIUS(TestCase): """ Test hostcfd daemon - RADIUS diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py index 18bf5c17e6c2..a6478c08dc0d 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py @@ -10,8 +10,7 @@ from parameterized import parameterized from unittest import TestCase, mock from tests.hostcfgd.test_tacacs_vectors import HOSTCFGD_TEST_TACACS_VECTOR -from tests.common.mock_configdb import MockConfigDb, MockSubscriberStateTable -from tests.common.mock_configdb import MockSelect, MockDBConnector +from tests.common.mock_configdb import MockConfigDb, MockDBConnector test_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) modules_path = os.path.dirname(test_path) @@ -32,8 +31,6 @@ # Mock swsscommon classes hostcfgd.ConfigDBConnector = MockConfigDb -hostcfgd.SubscriberStateTable = MockSubscriberStateTable -hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector hostcfgd.Table = mock.Mock() diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py index db9a35075a02..28d4f6f8a724 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py @@ -8,8 +8,7 @@ from unittest import TestCase, mock from .test_vectors import HOSTCFGD_TEST_VECTOR, HOSTCFG_DAEMON_CFG_DB -from tests.common.mock_configdb import MockConfigDb, MockSubscriberStateTable -from tests.common.mock_configdb import MockSelect, MockDBConnector +from tests.common.mock_configdb import MockConfigDb, MockDBConnector from pyfakefs.fake_filesystem_unittest import patchfs from deepdiff import DeepDiff @@ -24,8 +23,6 @@ hostcfgd_path = os.path.join(scripts_path, 'hostcfgd') hostcfgd = load_module_from_source('hostcfgd', hostcfgd_path) hostcfgd.ConfigDBConnector = MockConfigDb -hostcfgd.SubscriberStateTable = MockSubscriberStateTable -hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector hostcfgd.Table = mock.Mock() @@ -122,8 +119,8 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): feature_handler = hostcfgd.FeatureHandler(MockConfigDb(), feature_state_table_mock, device_config) # sync the state field and Handle Feature Updates - feature_handler.sync_state_field() features = MockConfigDb.CONFIG_DB['FEATURE'] + feature_handler.sync_state_field(features) for key, fvs in features.items(): feature_handler.handle(key, 'SET', fvs) @@ -227,7 +224,7 @@ def tearDown(self): @patchfs def test_feature_events(self, fs): fs.create_dir(hostcfgd.FeatureHandler.SYSTEMD_SYSTEM_DIR) - MockSelect.event_queue = [('FEATURE', 'dhcp_relay'), + MockConfigDb.event_queue = [('FEATURE', 'dhcp_relay'), ('FEATURE', 'mux'), ('FEATURE', 'telemetry')] daemon = hostcfgd.HostConfigDaemon() @@ -258,7 +255,7 @@ def test_feature_events(self, fs): # Change the state to disabled MockConfigDb.CONFIG_DB['FEATURE']['telemetry']['state'] = 'disabled' - MockSelect.event_queue = [('FEATURE', 'telemetry')] + MockConfigDb.event_queue = [('FEATURE', 'telemetry')] try: daemon.start() except TimeoutError: @@ -273,7 +270,7 @@ def test_feature_events(self, fs): def test_loopback_events(self): MockConfigDb.set_config_db(HOSTCFG_DAEMON_CFG_DB) - MockSelect.event_queue = [('NTP', 'global'), + MockConfigDb.event_queue = [('NTP', 'global'), ('NTP_SERVER', '0.debian.pool.ntp.org'), ('LOOPBACK_INTERFACE', 'Loopback0|10.184.8.233/32')] daemon = hostcfgd.HostConfigDaemon() @@ -296,8 +293,7 @@ def test_kdump_event(self): MockConfigDb.set_config_db(HOSTCFG_DAEMON_CFG_DB) daemon = hostcfgd.HostConfigDaemon() daemon.register_callbacks() - assert MockConfigDb.CONFIG_DB['KDUMP']['config'] - MockSelect.event_queue = [('KDUMP', 'config')] + MockConfigDb.event_queue = [('KDUMP', 'config')] with mock.patch('hostcfgd.subprocess') as mocked_subprocess: popen_mock = mock.Mock() attrs = {'communicate.return_value': ('output', 'error')} From 39e1e92c08ea43c374040bba8b83b7292101ba7e Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Fri, 8 Apr 2022 07:48:01 +0800 Subject: [PATCH 119/119] [yang]: Add support for BmcMgmtToRRouter (#10488) Why I did it minigraph parser has introduced new type. How I did it Update yang models to support BmcMgmtToRRouter. How to verify it Run unit test for sonic-yang-models Signed-off-by: Gang Lv ganglv@microsoft.com --- .../tests/yang_model_tests/tests/device_metadata.json | 3 +++ .../yang_model_tests/tests_config/device_metadata.json | 10 ++++++++++ .../yang-models/sonic-device_metadata.yang | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 7f0ddd38496f..1c39661d056e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -36,6 +36,9 @@ "DEVICE_METADATA_TYPE_CORRECT_PATTERN": { "desc": "DEVICE_METADATA correct value for Type field" }, + "DEVICE_METADATA_TYPE_BMC_MGMT_TOR_PATTERN": { + "desc": "DEVICE_METADATA value as BmcMgmtToRRouter for Type field" + }, "DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { "desc": "DEVICE_METADATA value as not-provisioned for Type field" }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index a921e9ef41b2..687a745a24c6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -54,6 +54,16 @@ } } }, + "DEVICE_METADATA_TYPE_BMC_MGMT_TOR_PATTERN": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_asn": "65002", + "type": "BmcMgmtToRRouter" + } + } + } + }, "DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index a349a3eb9366..17241005861e 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -88,7 +88,7 @@ module sonic-device_metadata { leaf type { type string { length 1..255; - pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|not-provisioned"; + pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|BmcMgmtToRRouter|not-provisioned"; } }