From 618b25f18c8282b51a414b4892af80f52f0787ef Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Tue, 1 Aug 2017 20:51:10 +0000 Subject: [PATCH 01/77] Squash merge v1.0.3 branch onto master --- dockers/docker-orchagent/start.sh | 11 ----------- dockers/docker-orchagent/swssconfig.sh | 23 ++++++++++++----------- files/build_templates/swss.service.j2 | 1 + platform/broadcom/docker-ptf-brcm.mk | 2 +- platform/broadcom/libsaithrift-dev.mk | 2 +- platform/broadcom/python-saithrift.mk | 2 +- platform/broadcom/rules.mk | 6 ++---- platform/broadcom/sai.mk | 10 ++++++---- platform/broadcom/sdk.mk | 10 ++++++---- platform/mellanox/docker-ptf-mlnx.mk | 2 +- platform/mellanox/fw.mk | 2 +- platform/mellanox/libsaithrift-dev.mk | 2 +- platform/mellanox/mlnx-fw-upgrade.sh | 2 +- platform/mellanox/mlnx-sai.mk | 4 ++-- platform/mellanox/python-saithrift.mk | 2 +- platform/mellanox/rules.mk | 6 ++---- platform/mellanox/sdk.mk | 10 ++-------- src/sonic-sairedis | 2 +- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- 20 files changed, 44 insertions(+), 59 deletions(-) diff --git a/dockers/docker-orchagent/start.sh b/dockers/docker-orchagent/start.sh index 40ef66441c02..446b52852f0a 100755 --- a/dockers/docker-orchagent/start.sh +++ b/dockers/docker-orchagent/start.sh @@ -11,17 +11,6 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd -# Wait for syncd to start -while true; do - RESULT=$(echo -en "SELECT 1\nHLEN HIDDEN" | redis-cli | sed -n 2p) - - if [ "$RESULT" != "0" ]; then - break - fi - - sleep 1 -done - supervisorctl start orchagent supervisorctl start portsyncd diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 768417779e2d..329d1439d897 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -40,17 +40,18 @@ HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -v minigraph_hwsku` SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json " -if [ "$HWSKU" == "Force10-S6000" ]; then - SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " -elif [ "$HWSKU" == "Force10-S6000-Q32" ]; then - SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " -elif [ "$HWSKU" == "Arista-7050-QX32" ]; then - SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " -elif [ "$HWSKU" == "ACS-MSN2700" ]; then - SWSSCONFIG_ARGS+="msn2700.32ports.buffers.json msn2700.32ports.qos.json " -elif [ "$HWSKU" == "ACS-MSN2740" ]; then - SWSSCONFIG_ARGS+="msn2740.32ports.buffers.json msn2740.32ports.qos.json " -fi +# FIXME: Temporarily disable QOS/buffer configurations for further debugging +# if [ "$HWSKU" == "Force10-S6000" ]; then +# SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " +# elif [ "$HWSKU" == "Force10-S6000-Q32" ]; then +# SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " +# elif [ "$HWSKU" == "Arista-7050-QX32" ]; then +# SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " +# elif [ "$HWSKU" == "ACS-MSN2700" ]; then +# SWSSCONFIG_ARGS+="msn2700.32ports.buffers.json msn2700.32ports.qos.json " +# elif [ "$HWSKU" == "ACS-MSN2740" ]; then +# SWSSCONFIG_ARGS+="msn2740.32ports.buffers.json msn2740.32ports.qos.json " +# fi for file in $SWSSCONFIG_ARGS; do swssconfig /etc/swss/config.d/$file diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index ed6b852f18f9..f383a886eb35 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -18,6 +18,7 @@ ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB {% if sonic_asic_platform == 'mellanox' %} +Environment=FAST_BOOT=1 TimeoutStartSec=3min ExecStartPre=/usr/bin/mst start ExecStartPre=/usr/bin/mlnx-fw-upgrade.sh diff --git a/platform/broadcom/docker-ptf-brcm.mk b/platform/broadcom/docker-ptf-brcm.mk index 7b78aa9ec316..c57ce43dc905 100644 --- a/platform/broadcom/docker-ptf-brcm.mk +++ b/platform/broadcom/docker-ptf-brcm.mk @@ -4,4 +4,4 @@ DOCKER_PTF_BRCM = docker-ptf-brcm.gz $(DOCKER_PTF_BRCM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift $(DOCKER_PTF_BRCM)_DEPENDS += $(PYTHON_SAITHRIFT_BRCM) $(DOCKER_PTF_BRCM)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_BRCM) +#SONIC_DOCKER_IMAGES += $(DOCKER_PTF_BRCM) diff --git a/platform/broadcom/libsaithrift-dev.mk b/platform/broadcom/libsaithrift-dev.mk index c809539b47fe..6e422db6e799 100644 --- a/platform/broadcom/libsaithrift-dev.mk +++ b/platform/broadcom/libsaithrift-dev.mk @@ -4,4 +4,4 @@ LIBSAITHRIFT_DEV_BRCM = libsaithrift-dev_0.9.4_amd64.deb $(LIBSAITHRIFT_DEV_BRCM)_SRC_PATH = $(SRC_PATH)/SAI $(LIBSAITHRIFT_DEV_BRCM)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(THRIFT_COMPILER) $(BRCM_SAI) $(BRCM_SAI_DEV) $(LIBSAITHRIFT_DEV_BRCM)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) -SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_BRCM) +#SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_BRCM) diff --git a/platform/broadcom/python-saithrift.mk b/platform/broadcom/python-saithrift.mk index f9da4143c7d9..18bf77c3d009 100644 --- a/platform/broadcom/python-saithrift.mk +++ b/platform/broadcom/python-saithrift.mk @@ -3,4 +3,4 @@ PYTHON_SAITHRIFT_BRCM = python-saithrift_0.9.4_amd64.deb $(PYTHON_SAITHRIFT_BRCM)_SRC_PATH = $(SRC_PATH)/SAI $(PYTHON_SAITHRIFT_BRCM)_DEPENDS += $(BRCM_SAI_DEV) $(THRIFT_COMPILER) $(PYTHON_THRIFT) $(LIBTHRIFT_DEV) -SONIC_DPKG_DEBS += $(PYTHON_SAITHRIFT_BRCM) +#SONIC_DPKG_DEBS += $(PYTHON_SAITHRIFT_BRCM) diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 253593b30f2a..4ee7fa91304d 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -25,12 +25,10 @@ $(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/packages/20170518/d SONIC_ONLINE_FILES += $(BCMCMD) $(DSSERVE) SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE) \ - $(DOCKER_FPM) \ - $(DOCKER_PTF_BRCM) \ - $(DOCKER_SYNCD_BRCM_RPC) + $(DOCKER_FPM) # Inject brcm sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV) $(LIBSAITHRIFT_DEV_BRCM) +$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV) #$(LIBSAITHRIFT_DEV_BRCM) # Runtime dependency on brcm sai is set only for syncd $(SYNCD)_RDEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index ec7a34253075..b829e8207890 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,9 +1,11 @@ -BRCM_SAI = libsaibcm_2.1.5.1-16-20170712202323.49_amd64.deb -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_2.1.5.1-16-20170712202323.49_amd64.deb?sv=2015-04-05&sr=b&sig=jsPXiAoSyKqZ1SmiyeEj73W8tRlri8ysExnWvc%2BWSi4%3D&se=2031-03-21T22%3A49%3A32Z&sp=r" +BRCM_SAI = libsaibcm_3.0.2.2_amd64.deb +# TODO: upload new SAI build to blob +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.2.2_amd64.deb" -BRCM_SAI_DEV = libsaibcm-dev_2.1.5.1-16-20170712202323.49_amd64.deb +BRCM_SAI_DEV = libsaibcm-dev_3.0.2.2_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_2.1.5.1-16-20170712202323.49_amd64.deb?sv=2015-04-05&sr=b&sig=azYZkCi%2FFGS4eELKhIozOok3qimfH%2FjdXlz%2BS2MRBco%3D&se=2031-03-21T22%3A49%3A57Z&sp=r" +# TODO: upload new SAI build to blob +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.2.2_amd64.deb" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(BRCM_SAI)_DEPENDS += $(BRCM_OPENNSL) diff --git a/platform/broadcom/sdk.mk b/platform/broadcom/sdk.mk index 5280fa2c9c1b..d952f436099d 100644 --- a/platform/broadcom/sdk.mk +++ b/platform/broadcom/sdk.mk @@ -1,7 +1,9 @@ -BRCM_OPENNSL = libopennsl_3.2.2.2-10-20170707181826.44_amd64.deb -$(BRCM_OPENNSL)_URL = "https://sonicstorage.blob.core.windows.net/packages/libopennsl_3.2.2.2-10-20170707181826.44_amd64.deb?sv=2015-04-05&sr=b&sig=hc4PbMQvfOu7p7E0MR1kn0OA6vu%2BPIdYOLeDU9hPJMY%3D&se=2031-03-19T21%3A20%3A15Z&sp=r" +BRCM_OPENNSL = libopennsl_3.2.3.1_amd64.deb +# TODO: upload new SDK build to blob +$(BRCM_OPENNSL)_URL = "https://sonicstorage.blob.core.windows.net/packages/libopennsl_3.2.3.1+0~20170605184634.7~1.gbp4a0717_amd64.deb" -BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.2.2-10-20170707181826.44_amd64.deb -$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.2.2-10-20170707181826.44_amd64.deb?sv=2015-04-05&sr=b&sig=xtGLlxX5SspadCxaObMGGVMQliPGrTkuN0T6A4wLETA%3D&se=2031-03-19T21%3A21%3A43Z&sp=r" +BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.1_amd64.deb +# TODO: upload new SDK build to blob +$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.1+0~20170605184634.7~1.gbp4a0717_amd64.deb" SONIC_ONLINE_DEBS += $(BRCM_OPENNSL) $(BRCM_OPENNSL_KERNEL) diff --git a/platform/mellanox/docker-ptf-mlnx.mk b/platform/mellanox/docker-ptf-mlnx.mk index 7f23dc715e32..9f994f62de64 100644 --- a/platform/mellanox/docker-ptf-mlnx.mk +++ b/platform/mellanox/docker-ptf-mlnx.mk @@ -4,4 +4,4 @@ DOCKER_PTF_MLNX = docker-ptf-mlnx.gz $(DOCKER_PTF_MLNX)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift $(DOCKER_PTF_MLNX)_DEPENDS += $(PYTHON_SAITHRIFT_MLNX) $(DOCKER_PTF_MLNX)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MLNX) +#SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MLNX) diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 8e916d817602..84b44053fa19 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -1,6 +1,6 @@ # mellanox firmware -MLNX_FW = fw-SPC-rel-13_1224_0140-EVB.mfa +MLNX_FW = fw-SPC-rel-13_1400_0126-EVB.mfa $(MLNX_FW)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW) SONIC_ONLINE_FILES += $(MLNX_FW) diff --git a/platform/mellanox/libsaithrift-dev.mk b/platform/mellanox/libsaithrift-dev.mk index 0fc6d3f4eb84..39222be39cab 100644 --- a/platform/mellanox/libsaithrift-dev.mk +++ b/platform/mellanox/libsaithrift-dev.mk @@ -4,4 +4,4 @@ LIBSAITHRIFT_DEV_MLNX = libsaithrift-dev_0.9.4_amd64.deb $(LIBSAITHRIFT_DEV_MLNX)_SRC_PATH = $(SRC_PATH)/SAI $(LIBSAITHRIFT_DEV_MLNX)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(THRIFT_COMPILER) $(MLNX_SAI) $(MLNX_SAI_DEV) $(LIBSAITHRIFT_DEV_MLNX)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI) -SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_MLNX) +#SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_MLNX) diff --git a/platform/mellanox/mlnx-fw-upgrade.sh b/platform/mellanox/mlnx-fw-upgrade.sh index b27d7095e2e2..d732eff8cee0 100755 --- a/platform/mellanox/mlnx-fw-upgrade.sh +++ b/platform/mellanox/mlnx-fw-upgrade.sh @@ -1,7 +1,7 @@ #!/bin/bash query_retry_count_max="10" -required_fw_version="13.1224.0140" +required_fw_version="13.1400.0126" fw_file=/etc/mlnx/fw-SPC.mfa run_or_fail() { diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index 332d496e76d0..66f6c3e257ce 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI -MLNX_SAI_VERSION = 161120 -MLNX_SAI_REVISION = ba3ccd6de8e5b82fa2cdfc30f9b8b1f1882bfede +MLNX_SAI_VERSION = SAIRel1.8.2-master +MLNX_SAI_REVISION = 852ef62c021dad6a1fec932a9c89df0e7f19460e export MLNX_SAI_VERSION MLNX_SAI_REVISION diff --git a/platform/mellanox/python-saithrift.mk b/platform/mellanox/python-saithrift.mk index cbe5af29b3e2..59685121e02c 100644 --- a/platform/mellanox/python-saithrift.mk +++ b/platform/mellanox/python-saithrift.mk @@ -3,4 +3,4 @@ PYTHON_SAITHRIFT_MLNX = python-saithrift_0.9.4_amd64.deb $(PYTHON_SAITHRIFT_MLNX)_SRC_PATH = $(SRC_PATH)/SAI $(PYTHON_SAITHRIFT_MLNX)_DEPENDS += $(MLNX_SAI_DEV) $(MLNX_SAI) $(THRIFT_COMPILER) $(PYTHON_THRIFT) $(LIBTHRIFT_DEV) -SONIC_DPKG_DEBS += $(PYTHON_SAITHRIFT_MLNX) +#SONIC_DPKG_DEBS += $(PYTHON_SAITHRIFT_MLNX) diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 6b88748c73a2..d67401df245d 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -12,12 +12,10 @@ include $(PLATFORM_PATH)/python-saithrift.mk include $(PLATFORM_PATH)/docker-ptf-mlnx.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ - $(DOCKER_FPM) \ - $(DOCKER_PTF_MLNX) \ - $(DOCKER_SYNCD_MLNX_RPC) + $(DOCKER_FPM) # Inject mlnx sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI) $(LIBSAITHRIFT_DEV_MLNX) +$(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI) #$(LIBSAITHRIFT_DEV_MLNX) # Runtime dependency on mlnx sai is set only for syncd $(SYNCD)_RDEPENDS += $(MLNX_SAI) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index bb576aaabee5..56e3145945f8 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,5 +1,5 @@ -MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/ba3ccd6de8e5b82fa2cdfc30f9b8b1f1882bfede/sdk -MLNX_SDK_VERSION = 4.2.3130 +MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/sonicv1.0.2/sdk +MLNX_SDK_VERSION = 4.2.5008 MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2) $(SX_ACL_RM) $(SX_COMPLIB) \ $(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \ $(SXD_LIBS) $(TESTX) @@ -20,8 +20,6 @@ $(eval $(call add_derived_package,$(IPROUTE2),$(IPROUTE2_DEV))) SX_COMPLIB = sx-complib_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_COMPLIB_DEV = sx-complib-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb $(eval $(call add_derived_package,$(SX_COMPLIB),$(SX_COMPLIB_DEV))) -SX_COMPLIB_DEV_STATIC = sx-complib-dev-static_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb -$(eval $(call add_derived_package,$(SX_COMPLIB),$(SX_COMPLIB_DEV_STATIC))) SX_EXAMPLES = sx-examples_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb $(SX_EXAMPLES)_DEPENDS += $(APPLIBS) $(SX_SCEW) $(SXD_LIBS) SX_EXAMPLES_DEV = sx-examples-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb @@ -33,13 +31,9 @@ $(eval $(call add_derived_package,$(SX_GEN_UTILS),$(SX_GEN_UTILS_DEV))) SX_SCEW = sx-scew_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SX_SCEW_DEV = sx-scew-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb $(eval $(call add_derived_package,$(SX_SCEW),$(SX_SCEW_DEV))) -SX_SCEW_DEV_STATIC = sx-scew-dev-static_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb -$(eval $(call add_derived_package,$(SX_SCEW),$(SX_SCEW_DEV_STATIC))) SXD_LIBS = sxd-libs_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb SXD_LIBS_DEV = sxd-libs-dev_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb $(eval $(call add_derived_package,$(SXD_LIBS),$(SXD_LIBS_DEV))) -SXD_LIBS_DEV_STATIC = sxd-libs-dev-static_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb -$(eval $(call add_derived_package,$(SXD_LIBS),$(SXD_LIBS_DEV_STATIC))) #packages that are required for runtime only PYTHON_SDK_API = python-sdk-api_1.mlnx.$(MLNX_SDK_VERSION)_amd64.deb $(PYTHON_SDK_API)_DEPENDS += $(APPLIBS) $(SXD_LIBS) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index b865912105f2..f0a32153728f 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit b865912105f2f80ee2516899e6367f863d5f6235 +Subproject commit f0a32153728f7e2de6d4624a1d352ae85c8a4406 diff --git a/src/sonic-swss b/src/sonic-swss index 27c49a0bf3a7..72cd3f6c4c17 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 27c49a0bf3a71556b553aa30fe2a7c1cdb996142 +Subproject commit 72cd3f6c4c174d7341f95dbd3b5ecc4f5debf362 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 4f917f2cc345..2716292fdd78 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 4f917f2cc345c54d1bf9d9f01d96e4c01071ac9a +Subproject commit 2716292fdd78dcbc8587a2c8d192d10465ec7225 From 5cf37cbcb39ea1eda5b034f98f20b9247ce9f9c6 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 10 Aug 2017 16:48:45 -0700 Subject: [PATCH 02/77] [Broadcom]: Update Broadcom SAI/SDK version (#883) --- platform/broadcom/sai.mk | 8 ++++---- platform/broadcom/sdk.mk | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index b829e8207890..54655563d638 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,11 +1,11 @@ -BRCM_SAI = libsaibcm_3.0.2.2_amd64.deb +BRCM_SAI = libsaibcm_3.0.2.3_amd64.deb # TODO: upload new SAI build to blob -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.2.2_amd64.deb" +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.2.3_amd64.deb" -BRCM_SAI_DEV = libsaibcm-dev_3.0.2.2_amd64.deb +BRCM_SAI_DEV = libsaibcm-dev_3.0.2.3_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) # TODO: upload new SAI build to blob -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.2.2_amd64.deb" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.2.3_amd64.deb" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(BRCM_SAI)_DEPENDS += $(BRCM_OPENNSL) diff --git a/platform/broadcom/sdk.mk b/platform/broadcom/sdk.mk index d952f436099d..5824590c8d52 100644 --- a/platform/broadcom/sdk.mk +++ b/platform/broadcom/sdk.mk @@ -1,9 +1,9 @@ -BRCM_OPENNSL = libopennsl_3.2.3.1_amd64.deb +BRCM_OPENNSL = libopennsl_3.2.3.3_amd64.deb # TODO: upload new SDK build to blob -$(BRCM_OPENNSL)_URL = "https://sonicstorage.blob.core.windows.net/packages/libopennsl_3.2.3.1+0~20170605184634.7~1.gbp4a0717_amd64.deb" +$(BRCM_OPENNSL)_URL = "https://sonicstorage.blob.core.windows.net/packages/libopennsl_3.2.3.3_amd64.deb" -BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.1_amd64.deb +BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb # TODO: upload new SDK build to blob -$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.1+0~20170605184634.7~1.gbp4a0717_amd64.deb" +$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb" SONIC_ONLINE_DEBS += $(BRCM_OPENNSL) $(BRCM_OPENNSL_KERNEL) From c82868e631566a652fd61142cc09838b45e522c6 Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Thu, 10 Aug 2017 19:03:05 -0700 Subject: [PATCH 03/77] [quagga]: Update sonic-quagga submodule - [bgpd]: Enable forwarding state flag in graceful restart capability - [debian]: Add autoreconf_clean --- src/sonic-quagga | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-quagga b/src/sonic-quagga index df6b70902b4c..b066bef0e8dc 160000 --- a/src/sonic-quagga +++ b/src/sonic-quagga @@ -1 +1 @@ -Subproject commit df6b70902b4c29447ac52277cf6d5b7f6abca71e +Subproject commit b066bef0e8dcf23b8e1751652397c09e61ee4bdd From e383a27f5f1d5550de377f50c69fde66ba0e2459 Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Thu, 10 Aug 2017 19:10:36 -0700 Subject: [PATCH 04/77] [mellanox]: Disable fsat boot mode for SX kernel --- files/build_templates/swss.service.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index f383a886eb35..ed6b852f18f9 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -18,7 +18,6 @@ ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB {% if sonic_asic_platform == 'mellanox' %} -Environment=FAST_BOOT=1 TimeoutStartSec=3min ExecStartPre=/usr/bin/mst start ExecStartPre=/usr/bin/mlnx-fw-upgrade.sh From fa1ac0e05a7fc9263ffd57f32f178399336761ef Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Thu, 10 Aug 2017 19:14:20 -0700 Subject: [PATCH 05/77] [swss-common]: Update sonic-swss-common submodule - [netlink]: Increase netlink buffer size - [netlink]: Check return vode from nl_recvmsgs_default - [select]: EINTR error hanlding - [makefile]: Use full file names --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 2716292fdd78..5779685e1652 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 2716292fdd78dcbc8587a2c8d192d10465ec7225 +Subproject commit 5779685e165201f69dae5e75b8549550dd5f165c From df3436b80b2931a0baed6656ad96495e7999cdf6 Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Thu, 10 Aug 2017 19:24:43 -0700 Subject: [PATCH 06/77] [utilities]: Update sonic-utilities submodule - [sfputil]: Refactor and add support for presence, low-power mode and reset --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index c7f6ff677b54..ac7ea4f3b9dc 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit c7f6ff677b54eb401e7b2fd3a3d9c4072325bb78 +Subproject commit ac7ea4f3b9dcc5cef15cc7ec0e796cde8a7f8ab8 From 338a83bacc646148e0fec0cca400bfd34a818669 Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Thu, 10 Aug 2017 19:32:39 -0700 Subject: [PATCH 07/77] [mellanox]: Update Mellanox SAI version --- platform/mellanox/mlnx-sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index 66f6c3e257ce..c1c69b1192c3 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI MLNX_SAI_VERSION = SAIRel1.8.2-master -MLNX_SAI_REVISION = 852ef62c021dad6a1fec932a9c89df0e7f19460e +MLNX_SAI_REVISION = 9a5155c0df10d733863c8c3d0e5385cecac3324a export MLNX_SAI_VERSION MLNX_SAI_REVISION From 674e2f9467fa71d6af751c41a8ce0f3f89a1f08a Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Tue, 15 Aug 2017 11:54:18 -0700 Subject: [PATCH 08/77] Revert "[mellanox]: Update Mellanox SAI version" This reverts commit 338a83bacc646148e0fec0cca400bfd34a818669. We first test the previous version of the SAI and make sure it passes all the tests and then update the SAI version to a later one. --- platform/mellanox/mlnx-sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index c1c69b1192c3..fbf4f94b590e 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI MLNX_SAI_VERSION = SAIRel1.8.2-master -MLNX_SAI_REVISION = 9a5155c0df10d733863c8c3d0e5385cecac3324a +MLNX_SAI_REVISION = 6b094746adc7ef2321701b4868806bc54a95bbd1 export MLNX_SAI_VERSION MLNX_SAI_REVISION From 6603e0ad5d261133e45bfe84bfe80582b3332ab5 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Tue, 15 Aug 2017 16:10:08 -0700 Subject: [PATCH 09/77] [Submodule update]: sonic-utilities (#888) * Track branch v1.0.3 for sonic-utilities * Spaces to tabs --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 5bf6fb5b4a61..431a525ebab1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -44,6 +44,7 @@ [submodule "src/sonic-utilities"] path = src/sonic-utilities url = https://github.com/Azure/sonic-utilities + branch = v1.0.3 [submodule "platform/broadcom/sonic-platform-modules-s6000"] path = platform/broadcom/sonic-platform-modules-s6000 url = https://github.com/Azure/sonic-platform-modules-s6000 From f0cc414dff1fc5a269ed15abf5dcf1ae363467b0 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 16 Aug 2017 13:47:20 -0700 Subject: [PATCH 10/77] [SAI]: Remove the SAI submodule from buildimage repo (#893) SAI is a submodule of sonic-sairedis repository. Remove the dependency from this repository. --- .gitmodules | 4 ---- src/SAI | 1 - 2 files changed, 5 deletions(-) delete mode 160000 src/SAI diff --git a/.gitmodules b/.gitmodules index 431a525ebab1..4bddfb4a60da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -57,10 +57,6 @@ [submodule "platform/broadcom/sonic-platform-modules-ingrasys"] path = platform/broadcom/sonic-platform-modules-ingrasys url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys -[submodule "src/SAI"] - path = src/SAI - url = https://github.com/opencomputeproject/SAI - branch = v0.9.4 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons url = https://github.com/Azure/sonic-platform-daemons diff --git a/src/SAI b/src/SAI deleted file mode 160000 index 940c7b6afb1d..000000000000 --- a/src/SAI +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 940c7b6afb1db4e8504b7cdb24ccd669748dbde8 From 3e7c3e6ea398e5d5e3820ea143b040688ba458d3 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 29 Aug 2017 00:53:19 -0700 Subject: [PATCH 11/77] [devices]: Bump sonic-platform-modules-arista submodule (#924) --- platform/broadcom/sonic-platform-modules-arista | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 7c505290bb26..4ad9358d16b8 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 7c505290bb26babdef604a377e71b3df702897a8 +Subproject commit 4ad9358d16b8cd0b57d5922353f38055f83042e4 From 44502b217b226da6b33591e1b199a47d35c95df5 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Tue, 29 Aug 2017 10:47:25 -0700 Subject: [PATCH 12/77] Migrate DEVICE_METADATA to db (#919) --- dockers/docker-fpm-frr/bgpd.conf.j2 | 4 ++-- dockers/docker-fpm-frr/zebra.conf.j2 | 2 +- dockers/docker-fpm-gobgp/zebra.conf.j2 | 2 +- dockers/docker-fpm-quagga/bgpd.conf.j2 | 8 +++---- dockers/docker-fpm-quagga/zebra.conf.j2 | 2 +- src/sonic-config-engine/minigraph.py | 23 ++++++++++---------- src/sonic-config-engine/sonic-cfggen | 13 +++++++++++ src/sonic-config-engine/tests/test_cfggen.py | 8 +++---- 8 files changed, 37 insertions(+), 25 deletions(-) diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index c66d5bfb232f..1624b5d3578d 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block system_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra log syslog informational log facility local4 @@ -51,7 +51,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if bgp_session['asn'] != 0 %} neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} {% if neighbor_addr | ipv4 %} diff --git a/dockers/docker-fpm-frr/zebra.conf.j2 b/dockers/docker-fpm-frr/zebra.conf.j2 index 1ce06eecd2d9..9214eab22c88 100644 --- a/dockers/docker-fpm-frr/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/zebra.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block sys_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra enable password zebra {% endblock sys_init %} diff --git a/dockers/docker-fpm-gobgp/zebra.conf.j2 b/dockers/docker-fpm-gobgp/zebra.conf.j2 index 1ce06eecd2d9..9214eab22c88 100644 --- a/dockers/docker-fpm-gobgp/zebra.conf.j2 +++ b/dockers/docker-fpm-gobgp/zebra.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block sys_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra enable password zebra {% endblock sys_init %} diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index eb1da1f1a3ea..daca10b102bd 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block system_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra log syslog informational log facility local4 @@ -27,7 +27,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} bgp log-neighbor-changes bgp bestpath as-path multipath-relax {# Advertise graceful restart capability for ToR #} -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} bgp graceful-restart {% endif %} {# TODO: use lo[0] for backward compatibility, will revisit the case with multiple lo interfaces #} @@ -64,13 +64,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} neighbor {{ neighbor_addr }} shutdown {% endif %} {% if neighbor_addr | ipv4 %} -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} {% endif %} {% if neighbor_addr | ipv6 %} address-family ipv6 -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['locahost']['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} neighbor {{ neighbor_addr }} activate diff --git a/dockers/docker-fpm-quagga/zebra.conf.j2 b/dockers/docker-fpm-quagga/zebra.conf.j2 index 1ce06eecd2d9..9214eab22c88 100644 --- a/dockers/docker-fpm-quagga/zebra.conf.j2 +++ b/dockers/docker-fpm-quagga/zebra.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block sys_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra enable password zebra {% endblock sys_init %} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 1877e552858e..06a4a3cb3f2e 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -458,14 +458,15 @@ def parse_xml(filename, platform=None, port_config_file=None): ethernet_interfaces = parse_deviceinfo(child, hwsku) results = {} - results['minigraph_hwsku'] = hwsku - # sorting by lambdas are not easily done without custom filters. - # TODO: add jinja2 filter to accept a lambda to sort a list of dictionaries by attribute. - # TODO: alternatively (preferred), implement class containers for multiple-attribute entries, enabling sort by attr results['BGP_NEIGHBOR'] = bgp_sessions - results['DEVICE_METADATA'] = {'localhost': { 'bgp_asn': bgp_asn }} + results['DEVICE_METADATA'] = {'localhost': { + 'bgp_asn': bgp_asn, + 'deployment_id': deployment_id, + 'hostname': hostname, + 'hwsku': hwsku, + 'type': devices[hostname]['type'] + }} results['BGP_PEER_RANGE'] = bgp_peers_with_range - # TODO: sort does not work properly on all interfaces of varying lengths. Need to sort by integer group(s). phyport_intfs = [] vlan_intfs = [] @@ -496,14 +497,11 @@ def parse_xml(filename, platform=None, port_config_file=None): if devices != None: results['minigraph_console'] = get_console_info(devices, console_dev, console_port) results['minigraph_mgmt'] = get_mgmt_info(devices, mgmt_dev, mgmt_port) - results['minigraph_hostname'] = hostname - results['inventory_hostname'] = hostname results['syslog_servers'] = syslog_servers results['dhcp_servers'] = dhcp_servers results['ntp_servers'] = ntp_servers results['forced_mgmt_routes'] = mgmt_routes results['erspan_dst'] = erspan_dst - results['deployment_id'] = deployment_id results['ethernet_interfaces'] = ethernet_interfaces return results @@ -513,9 +511,10 @@ def parse_device_desc_xml(filename): (lo_prefix, mgmt_prefix, hostname, hwsku, d_type) = parse_device(root) results = {} - results['minigraph_hwsku'] = hwsku - results['minigraph_hostname'] = hostname - results['inventory_hostname'] = hostname + results['DEVICE_METADATA'] = {'localhost': { + 'hostname': hostname, + 'hwsku': hwsku, + }} lo_intfs = [] ipn = ipaddress.IPNetwork(lo_prefix) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 070b3100ea5a..029f6cfc17b0 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -22,6 +22,7 @@ import yaml import jinja2 import netaddr import json +from functools import partial from minigraph import minigraph_encoder from minigraph import parse_xml from minigraph import parse_device_desc_xml @@ -53,6 +54,16 @@ def is_ipv6(value): return False return addr.version == 6 +def prefix_attr(attr, value): + if not value: + return None + else: + try: + prefix = netaddr.IPNetwork(str(value)) + except: + return None + return str(getattr(prefix, attr)) + def unique_name(l): name_list = [] new_list = [] @@ -158,6 +169,8 @@ def main(): env.filters['ipv4'] = is_ipv4 env.filters['ipv6'] = is_ipv6 env.filters['unique_name'] = unique_name + for attr in ['ip', 'network', 'prefixlen', 'netmask']: + env.filters[attr] = partial(prefix_attr, attr) template = env.get_template(template_file) print template.render(data) diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 153b0bb14f36..6a563088d338 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -31,7 +31,7 @@ def test_dummy_run(self): self.assertEqual(output, '') def test_device_desc(self): - argument = '-v minigraph_hwsku -M "' + self.sample_device_desc + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -M "' + self.sample_device_desc + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'ACS-MSN2700') @@ -41,7 +41,7 @@ def test_device_desc_mgmt_ip(self): self.assertEqual(output.strip(), '10.0.1.5') def test_minigraph_sku(self): - argument = '-v minigraph_hwsku -m "' + self.sample_graph + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'Force10-Z9100') @@ -51,7 +51,7 @@ def test_print_data(self): self.assertTrue(len(output.strip()) > 0) def test_jinja_expression(self): - argument = '-m "' + self.sample_graph + '" -v "minigraph_devices[minigraph_hostname][\'type\']"' + argument = '-m "' + self.sample_graph + '" -v "DEVICE_METADATA[\'localhost\'][\'type\']"' output = self.run_script(argument) self.assertEqual(output.strip(), 'LeafRouter') @@ -116,7 +116,7 @@ def test_minigraph_peers_with_range(self): self.assertEqual(output.strip(), "[{'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]") def test_minigraph_deployment_id(self): - argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v deployment_id' + argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'deployment_id\']"' output = self.run_script(argument) self.assertEqual(output.strip(), "1") From e4502527d00a6d101f73f7c3a07eae9d7f548336 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Tue, 29 Aug 2017 17:03:31 -0700 Subject: [PATCH 13/77] Revert "Migrate DEVICE_METADATA to db (#919)" (#928) This reverts commit 44502b217b226da6b33591e1b199a47d35c95df5. --- dockers/docker-fpm-frr/bgpd.conf.j2 | 4 ++-- dockers/docker-fpm-frr/zebra.conf.j2 | 2 +- dockers/docker-fpm-gobgp/zebra.conf.j2 | 2 +- dockers/docker-fpm-quagga/bgpd.conf.j2 | 8 +++---- dockers/docker-fpm-quagga/zebra.conf.j2 | 2 +- src/sonic-config-engine/minigraph.py | 23 ++++++++++---------- src/sonic-config-engine/sonic-cfggen | 13 ----------- src/sonic-config-engine/tests/test_cfggen.py | 8 +++---- 8 files changed, 25 insertions(+), 37 deletions(-) diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index 1624b5d3578d..c66d5bfb232f 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block system_init %} -hostname {{ DEVICE_METADATA['localhost']['hostname'] }} +hostname {{ inventory_hostname }} password zebra log syslog informational log facility local4 @@ -51,7 +51,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if bgp_session['asn'] != 0 %} neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} -{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} +{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} {% if neighbor_addr | ipv4 %} diff --git a/dockers/docker-fpm-frr/zebra.conf.j2 b/dockers/docker-fpm-frr/zebra.conf.j2 index 9214eab22c88..1ce06eecd2d9 100644 --- a/dockers/docker-fpm-frr/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/zebra.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block sys_init %} -hostname {{ DEVICE_METADATA['localhost']['hostname'] }} +hostname {{ inventory_hostname }} password zebra enable password zebra {% endblock sys_init %} diff --git a/dockers/docker-fpm-gobgp/zebra.conf.j2 b/dockers/docker-fpm-gobgp/zebra.conf.j2 index 9214eab22c88..1ce06eecd2d9 100644 --- a/dockers/docker-fpm-gobgp/zebra.conf.j2 +++ b/dockers/docker-fpm-gobgp/zebra.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block sys_init %} -hostname {{ DEVICE_METADATA['localhost']['hostname'] }} +hostname {{ inventory_hostname }} password zebra enable password zebra {% endblock sys_init %} diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index daca10b102bd..eb1da1f1a3ea 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block system_init %} -hostname {{ DEVICE_METADATA['localhost']['hostname'] }} +hostname {{ inventory_hostname }} password zebra log syslog informational log facility local4 @@ -27,7 +27,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} bgp log-neighbor-changes bgp bestpath as-path multipath-relax {# Advertise graceful restart capability for ToR #} -{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} +{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} bgp graceful-restart {% endif %} {# TODO: use lo[0] for backward compatibility, will revisit the case with multiple lo interfaces #} @@ -64,13 +64,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} neighbor {{ neighbor_addr }} shutdown {% endif %} {% if neighbor_addr | ipv4 %} -{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} +{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} {% endif %} {% if neighbor_addr | ipv6 %} address-family ipv6 -{% if DEVICE_METADATA['locahost']['type'] == 'ToRRouter' %} +{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} neighbor {{ neighbor_addr }} activate diff --git a/dockers/docker-fpm-quagga/zebra.conf.j2 b/dockers/docker-fpm-quagga/zebra.conf.j2 index 9214eab22c88..1ce06eecd2d9 100644 --- a/dockers/docker-fpm-quagga/zebra.conf.j2 +++ b/dockers/docker-fpm-quagga/zebra.conf.j2 @@ -7,7 +7,7 @@ {% endblock banner %} ! {% block sys_init %} -hostname {{ DEVICE_METADATA['localhost']['hostname'] }} +hostname {{ inventory_hostname }} password zebra enable password zebra {% endblock sys_init %} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 06a4a3cb3f2e..1877e552858e 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -458,15 +458,14 @@ def parse_xml(filename, platform=None, port_config_file=None): ethernet_interfaces = parse_deviceinfo(child, hwsku) results = {} + results['minigraph_hwsku'] = hwsku + # sorting by lambdas are not easily done without custom filters. + # TODO: add jinja2 filter to accept a lambda to sort a list of dictionaries by attribute. + # TODO: alternatively (preferred), implement class containers for multiple-attribute entries, enabling sort by attr results['BGP_NEIGHBOR'] = bgp_sessions - results['DEVICE_METADATA'] = {'localhost': { - 'bgp_asn': bgp_asn, - 'deployment_id': deployment_id, - 'hostname': hostname, - 'hwsku': hwsku, - 'type': devices[hostname]['type'] - }} + results['DEVICE_METADATA'] = {'localhost': { 'bgp_asn': bgp_asn }} results['BGP_PEER_RANGE'] = bgp_peers_with_range + # TODO: sort does not work properly on all interfaces of varying lengths. Need to sort by integer group(s). phyport_intfs = [] vlan_intfs = [] @@ -497,11 +496,14 @@ def parse_xml(filename, platform=None, port_config_file=None): if devices != None: results['minigraph_console'] = get_console_info(devices, console_dev, console_port) results['minigraph_mgmt'] = get_mgmt_info(devices, mgmt_dev, mgmt_port) + results['minigraph_hostname'] = hostname + results['inventory_hostname'] = hostname results['syslog_servers'] = syslog_servers results['dhcp_servers'] = dhcp_servers results['ntp_servers'] = ntp_servers results['forced_mgmt_routes'] = mgmt_routes results['erspan_dst'] = erspan_dst + results['deployment_id'] = deployment_id results['ethernet_interfaces'] = ethernet_interfaces return results @@ -511,10 +513,9 @@ def parse_device_desc_xml(filename): (lo_prefix, mgmt_prefix, hostname, hwsku, d_type) = parse_device(root) results = {} - results['DEVICE_METADATA'] = {'localhost': { - 'hostname': hostname, - 'hwsku': hwsku, - }} + results['minigraph_hwsku'] = hwsku + results['minigraph_hostname'] = hostname + results['inventory_hostname'] = hostname lo_intfs = [] ipn = ipaddress.IPNetwork(lo_prefix) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 029f6cfc17b0..070b3100ea5a 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -22,7 +22,6 @@ import yaml import jinja2 import netaddr import json -from functools import partial from minigraph import minigraph_encoder from minigraph import parse_xml from minigraph import parse_device_desc_xml @@ -54,16 +53,6 @@ def is_ipv6(value): return False return addr.version == 6 -def prefix_attr(attr, value): - if not value: - return None - else: - try: - prefix = netaddr.IPNetwork(str(value)) - except: - return None - return str(getattr(prefix, attr)) - def unique_name(l): name_list = [] new_list = [] @@ -169,8 +158,6 @@ def main(): env.filters['ipv4'] = is_ipv4 env.filters['ipv6'] = is_ipv6 env.filters['unique_name'] = unique_name - for attr in ['ip', 'network', 'prefixlen', 'netmask']: - env.filters[attr] = partial(prefix_attr, attr) template = env.get_template(template_file) print template.render(data) diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 6a563088d338..153b0bb14f36 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -31,7 +31,7 @@ def test_dummy_run(self): self.assertEqual(output, '') def test_device_desc(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -M "' + self.sample_device_desc + '"' + argument = '-v minigraph_hwsku -M "' + self.sample_device_desc + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'ACS-MSN2700') @@ -41,7 +41,7 @@ def test_device_desc_mgmt_ip(self): self.assertEqual(output.strip(), '10.0.1.5') def test_minigraph_sku(self): - argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '"' + argument = '-v minigraph_hwsku -m "' + self.sample_graph + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'Force10-Z9100') @@ -51,7 +51,7 @@ def test_print_data(self): 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 + '" -v "minigraph_devices[minigraph_hostname][\'type\']"' output = self.run_script(argument) self.assertEqual(output.strip(), 'LeafRouter') @@ -116,7 +116,7 @@ def test_minigraph_peers_with_range(self): self.assertEqual(output.strip(), "[{'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]") def test_minigraph_deployment_id(self): - argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'deployment_id\']"' + argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v deployment_id' output = self.run_script(argument) self.assertEqual(output.strip(), "1") From 9c87eff5fa0d54df4d0e0d9ad4ac2410d3a87aa8 Mon Sep 17 00:00:00 2001 From: padmanarayana Date: Wed, 30 Aug 2017 08:40:21 +0530 Subject: [PATCH 14/77] [devices]: Update Dell s6100/z9100 platform modules (#925) [devices]: Update Dell s6100/z9100 platform modules --- platform/broadcom/sonic-platform-modules-dell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-dell b/platform/broadcom/sonic-platform-modules-dell index 5ab014c0d4f9..1abd4e6c41f6 160000 --- a/platform/broadcom/sonic-platform-modules-dell +++ b/platform/broadcom/sonic-platform-modules-dell @@ -1 +1 @@ -Subproject commit 5ab014c0d4f9ad71d7791e7d4da0645d2b2d493b +Subproject commit 1abd4e6c41f633272667a5833a63ab6f8da15199 From 1a4f039f55dd575694bdb0f4509fef5b2c31bb3c Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Wed, 30 Aug 2017 09:41:47 -0700 Subject: [PATCH 15/77] [quagga] enable core dump for bgpd and zebra (#927) * [core dump] pass unix time to coredump-compress script Currently we only have program name (e.g. bgpd) and PID in the core file name. PID could collide especially after docker restart or recreate. Passing the unix time to coredump-compress so it could also add time to the core file name. * [utilities] include the change to coredump_compress script * [quagga] enable core dump for bgpd and zebra bgpd and zebra downgrade their privilege shortly after started. For that sysctrl kernel.suid_dumpable needs to be set to 2, so that they can dump core. Note that fs.suid_dumpable SHOULD NOT be set to 1. Which will bypass all system security. --- build_debian.sh | 3 ++- src/sonic-utilities | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 22cbef494f87..d7e7c3307536 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -239,10 +239,11 @@ EOF ## Config sysctl sudo mkdir -p $FILESYSTEM_ROOT/var/core sudo augtool --autosave " -set /files/etc/sysctl.conf/kernel.core_pattern '|/usr/bin/coredump-compress %e %p' +set /files/etc/sysctl.conf/kernel.core_pattern '|/usr/bin/coredump-compress %e %t %p' set /files/etc/sysctl.conf/kernel.softlockup_panic 1 set /files/etc/sysctl.conf/kernel.panic 10 +set /files/etc/sysctl.conf/fs.suid_dumpable 2 set /files/etc/sysctl.conf/net.ipv4.conf.default.forwarding 1 set /files/etc/sysctl.conf/net.ipv4.conf.all.forwarding 1 diff --git a/src/sonic-utilities b/src/sonic-utilities index d1ded16b06b4..b82ea42a3546 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit d1ded16b06b493e2420d1013aee97afbdc8160d9 +Subproject commit b82ea42a35468cbb653cf59296d1cca716d400a4 From 127a73aac35d21d8c8d13d28bffb71df1a49ca1c Mon Sep 17 00:00:00 2001 From: sihuihan88 Date: Wed, 30 Aug 2017 13:06:02 -0700 Subject: [PATCH 16/77] [quagga]: Disable ipv4 over ipv6 and enable ipv6 over ipv4 peer group (#922) * [bgpd]:disable ipv4 over ipv6 and enable ipv6 over ipv4 peer group * update as comments --- dockers/docker-fpm-quagga/bgpd.conf.j2 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index eb1da1f1a3ea..02cf40fa8b47 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -26,6 +26,7 @@ route-map TO_BGP_SPEAKER_V4 deny 10 router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} bgp log-neighbor-changes bgp bestpath as-path multipath-relax + no bgp default ipv4-unicast {# Advertise graceful restart capability for ToR #} {% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} bgp graceful-restart @@ -64,9 +65,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} neighbor {{ neighbor_addr }} shutdown {% endif %} {% if neighbor_addr | ipv4 %} + address-family ipv4 {% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} - neighbor {{ neighbor_addr }} allowas-in 1 + neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} + neighbor {{ neighbor_addr }} activate + maximum-paths 64 + exit-address-family {% endif %} {% if neighbor_addr | ipv6 %} address-family ipv6 @@ -93,6 +98,14 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% for ip_range in bgp_peer['ip_range'] %} bgp listen range {{ip_range}} peer-group {{ bgp_peer['name'] }} {% endfor %} + address-family ipv4 + neighbor {{ bgp_peer['name'] }} activate + maximum-paths 64 + exit-address-family + address-family ipv6 + neighbor {{ bgp_peer['name'] }} activate + maximum-paths 64 + exit-address-family {% endfor %} {% endblock bgp_peers_with_range %} ! From 7f1991cf2f57be39594af91a31c971e2840670bc Mon Sep 17 00:00:00 2001 From: wadelnn Date: Fri, 1 Sep 2017 07:57:58 +0800 Subject: [PATCH 17/77] Update sfputil support for Ingrasys S9100 (#929) * Update sonic-platform-modules-ingrasys submodule. * Fixed sfputil plugin for read QSFP EEPROM. * Add sfputil plugin for get presence. * Add sfputil plugin for get/set low power mode. * Add sfputil plugin for reset QSFP. Signed-off-by: Wade He chihen.he@gmail.com --- .../plugins/sfputil.py | 250 +++++++++++++++++- .../broadcom/sonic-platform-modules-ingrasys | 2 +- 2 files changed, 237 insertions(+), 15 deletions(-) diff --git a/device/ingrasys/x86_64-ingrasys_s9100-r0/plugins/sfputil.py b/device/ingrasys/x86_64-ingrasys_s9100-r0/plugins/sfputil.py index f45502ab9ab4..f4ffc29bebc6 100644 --- a/device/ingrasys/x86_64-ingrasys_s9100-r0/plugins/sfputil.py +++ b/device/ingrasys/x86_64-ingrasys_s9100-r0/plugins/sfputil.py @@ -1,19 +1,26 @@ -#!/usr/bin/env python +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# try: - from sonic_sfp.sfputilbase import sfputilbase -except ImportError, e: - raise ImportError (str(e) + "- required module not found") + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) -class sfputil(sfputilbase): - """Platform specific sfputil class""" +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" - port_start = 0 - port_end = 31 - ports_in_block = 32 + PORT_START = 0 + PORT_END = 31 + PORTS_IN_BLOCK = 32 - port_to_eeprom_mapping = {} + BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction" + BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value" + + _port_to_eeprom_mapping = {} port_to_i2c_mapping = { 0: 11, 1: 10, @@ -49,12 +56,227 @@ class sfputil(sfputilbase): 31: 40 } - _qsfp_ports = range(0, ports_in_block + 1) + abs_to_gpio_mapping = { + 0: 241, + 1: 240, + 2: 243, + 3: 242, + 4: 245, + 5: 244, + 6: 247, + 7: 246, + 8: 249, + 9: 248, + 10: 251, + 11: 250, + 12: 253, + 13: 252, + 14: 255, + 15: 254, + 16: 225, + 17: 224, + 18: 227, + 19: 226, + 20: 229, + 21: 228, + 22: 231, + 23: 230, + 24: 233, + 25: 232, + 26: 235, + 27: 234, + 28: 237, + 29: 236, + 30: 239, + 31: 238 + } + + lpmode_to_gpio_mapping = { + 0: 177, + 1: 176, + 2: 179, + 3: 178, + 4: 181, + 5: 180, + 6: 183, + 7: 182, + 8: 185, + 9: 184, + 10: 187, + 11: 186, + 12: 189, + 13: 188, + 14: 191, + 15: 190, + 16: 161, + 17: 160, + 18: 163, + 19: 162, + 20: 165, + 21: 164, + 22: 167, + 23: 166, + 24: 169, + 25: 168, + 26: 171, + 27: 170, + 28: 173, + 29: 172, + 30: 175, + 31: 174 + } + + reset_to_gpio_mapping = { + 0: 145, + 1: 144, + 2: 147, + 3: 146, + 4: 149, + 5: 148, + 6: 151, + 7: 150, + 8: 153, + 9: 152, + 10: 155, + 11: 154, + 12: 157, + 13: 156, + 14: 159, + 15: 158, + 16: 129, + 17: 128, + 18: 131, + 19: 130, + 20: 133, + 21: 132, + 22: 135, + 23: 134, + 24: 137, + 25: 136, + 26: 139, + 27: 138, + 28: 141, + 29: 140, + 30: 143, + 31: 142 + } + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return range(0, self.PORTS_IN_BLOCK + 1) - def __init__(self, port_num): + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): # Override port_to_eeprom_mapping for class initialization - eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' + eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" + for x in range(self.port_start, self.port_end + 1): port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) self.port_to_eeprom_mapping[x] = port_eeprom_path - sfputilbase.__init__(self, port_num) + + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + abs_device_file = self.BASE_VAL_PATH.format( + self.abs_to_gpio_mapping[port_num]) + val_file = open(abs_device_file) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + lpmode_val_device_file = self.BASE_VAL_PATH.format( + self.lpmode_to_gpio_mapping[port_num]) + val_file = open(lpmode_val_device_file) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + lpmode_val_device_file = self.BASE_VAL_PATH.format( + self.lpmode_to_gpio_mapping[port_num]) + val_file = open(lpmode_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("1" if lpmode is True else "0") + val_file.close() + + return True + + def reset(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reset_val_device_file = self.BASE_VAL_PATH.format( + self.reset_to_gpio_mapping[port_num]) + val_file = open(reset_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("1") + val_file.close() + + # Sleep 1 second to allow it to settle + time.sleep(1) + + try: + reset_val_device_file = self.BASE_VAL_PATH.format( + self.reset_to_gpio_mapping[port_num]) + val_file = open(reset_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("0") + val_file.close() + + return True diff --git a/platform/broadcom/sonic-platform-modules-ingrasys b/platform/broadcom/sonic-platform-modules-ingrasys index 1a67af3caa00..00ea01132665 160000 --- a/platform/broadcom/sonic-platform-modules-ingrasys +++ b/platform/broadcom/sonic-platform-modules-ingrasys @@ -1 +1 @@ -Subproject commit 1a67af3caa00352e5e7db880e1eeda0bdf1fde6b +Subproject commit 00ea0113266590a5b17b923f017b52cab373234e From 1b944dba39f3d6e95d3303e4cce6e4725ef64a81 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 1 Sep 2017 15:28:33 -0700 Subject: [PATCH 18/77] Fix confusing comment (#931) --- rules/config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rules/config b/rules/config index 5403c981f170..2d6e6a82b6a8 100644 --- a/rules/config +++ b/rules/config @@ -12,9 +12,8 @@ # container. SONIC_CONFIG_BUILD_JOBS = 1 -# SONIC_CONFIG_BUILD_JOBS - set number of jobs for number of jobs per package. +# SONIC_CONFIG_MAKE_JOBS - set number of parallel make jobs per package. # Corresponding -j argument will be passed to make/dpkg commands that build separate packages -# container. SONIC_CONFIG_MAKE_JOBS = $(shell nproc) # SONIC_CONFIG_ENABLE_COLORS - enable colored output in build system. From bb1a7b2e22fe7d7db3d5a4552fb24a0503242686 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 1 Sep 2017 15:28:46 -0700 Subject: [PATCH 19/77] Replace CRLF line endings with LF (#932) --- .../led_proc_init.soc | 325 ++++---- .../x86_64-cel_seastone-r0/led_proc_init.soc | 19 +- .../minigraph.xml | 242 +++--- .../minigraph.xml | 718 +++++++++--------- 4 files changed, 650 insertions(+), 654 deletions(-) diff --git a/device/accton/x86_64-accton_as5712_54x-r0/led_proc_init.soc b/device/accton/x86_64-accton_as5712_54x-r0/led_proc_init.soc index e27679db9ab0..85030e1db349 100644 --- a/device/accton/x86_64-accton_as5712_54x-r0/led_proc_init.soc +++ b/device/accton/x86_64-accton_as5712_54x-r0/led_proc_init.soc @@ -1,163 +1,162 @@ -# LED setting for active -# ----------------------------------------------------------------------------- -# for as5712_54x (48xg+6qxg) -# -# on green - if link up -# off - if link down -# blink - if active -# ----------------------------------------------------------------------------- -m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=0 -m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_62=1 -m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_61=2 -m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 -m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=4 -m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_58=5 -m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_57=6 -m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 -m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=8 -m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_54=9 -m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_53=10 -m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 -m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=12 -m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_50=13 -m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_49=14 -m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=15 -m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 -m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_34=17 -m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_33=18 -m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=19 -m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 -m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_38=21 -m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_37=22 -m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 -m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=24 -m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_42=25 -m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_41=26 -m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=27 -m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=28 -m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_46=29 -m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_45=30 -m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=31 -m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=32 -m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_30=33 -m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_29=34 -m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=35 -m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=36 -m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_26=37 -m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_25=38 -m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=39 -m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=40 -m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_22=41 -m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_21=42 -m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=43 -m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=44 -m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_18=45 -m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_17=46 -m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=47 -m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=48 -m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_2=49 -m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_1=50 -m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=51 -m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=52 -m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_6=53 -m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_5=54 -m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=55 -m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 -m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_10=57 -m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=58 -m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=59 -m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 -m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_14=61 -m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_13=62 -m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=63 -m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=0 -m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_62=1 -m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_61=2 -m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 -m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=4 -m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_58=5 -m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_57=6 -m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 -m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=8 -m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_54=9 -m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_53=10 -m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 -m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=12 -m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_50=13 -m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_49=14 -m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=15 -m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 -m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_34=17 -m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_33=18 -m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=19 -m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 -m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_38=21 -m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_37=22 -m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 -m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=24 -m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_42=25 -m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_41=26 -m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=27 -m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=28 -m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_46=29 -m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_45=30 -m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=31 -m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=32 -m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_30=33 -m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_29=34 -m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=35 -m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=36 -m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_26=37 -m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_25=38 -m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=39 -m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=40 -m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_22=41 -m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_21=42 -m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=43 -m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=44 -m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_18=45 -m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_17=46 -m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=47 -m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=48 -m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_2=49 -m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_1=50 -m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=51 -m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=52 -m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_6=53 -m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_5=54 -m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=55 -m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 -m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_10=57 -m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=58 -m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=59 -m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 -m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_14=61 -m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_13=62 -m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=63 - -led 0 stop -led 0 prog \ - 06 FE 80 D2 19 71 08 E0 60 FE E9 D2 0F 75 10 81 \ - 61 FD 02 3F 60 FF 28 32 0F 87 67 4A 96 FF 06 FF \ - D2 2B 74 16 02 1F 60 FF 28 32 0F 87 67 4A 96 FF \ - 06 FF D2 13 74 28 02 0F 60 FF 28 32 0F 87 67 4A \ - 96 FF 06 FF D2 0B 74 3A 3A 48 32 07 32 08 C7 32 \ - 04 C7 97 71 57 77 69 32 00 32 01 B7 97 71 63 32 \ - 0E 77 6B 26 FD 97 27 77 6B 32 0F 87 57 00 00 00 -led 0 start - -led 1 stop -led 1 prog \ - 06 FE 80 D2 19 71 08 E0 60 FE E9 D2 0F 75 10 81 \ - 61 FD 02 20 67 89 02 24 67 89 02 10 67 89 02 28 \ - 67 89 02 2C 67 89 02 0C 67 89 02 2C 67 79 02 28 \ - 67 79 02 24 67 79 02 20 67 79 02 10 67 79 02 0C \ - 67 79 02 0B 60 FF 28 32 0F 87 67 56 96 FF 06 FF \ - D2 FF 74 46 3A 36 32 07 32 08 C7 32 04 C7 97 71 \ - 63 77 75 32 00 32 01 B7 97 71 6F 32 0E 77 77 26 \ - FD 97 27 77 77 32 0F 87 57 12 A0 F8 15 1A 01 75 \ - 85 28 67 56 57 32 0F 87 57 12 A0 F8 15 1A 01 71 \ - A1 28 67 56 80 28 67 56 80 28 67 56 80 28 67 56 \ - 57 32 0F 87 32 0F 87 32 0F 87 32 0F 87 57 00 00 -led 1 start - +# LED setting for active +# ----------------------------------------------------------------------------- +# for as5712_54x (48xg+6qxg) +# +# on green - if link up +# off - if link down +# blink - if active +# ----------------------------------------------------------------------------- +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=0 +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_62=1 +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_61=2 +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=4 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_58=5 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_57=6 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=8 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_54=9 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_53=10 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=12 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_50=13 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_49=14 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=15 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_34=17 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_33=18 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=19 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_38=21 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_37=22 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=24 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_42=25 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_41=26 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=27 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=28 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_46=29 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_45=30 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=31 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=32 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_30=33 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_29=34 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=35 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=36 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_26=37 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_25=38 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=39 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=40 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_22=41 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_21=42 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=43 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=44 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_18=45 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_17=46 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=47 +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=48 +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_2=49 +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_1=50 +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=51 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=52 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_6=53 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_5=54 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=55 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_10=57 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=58 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=59 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_14=61 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_13=62 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=0 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_62=1 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_61=2 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=4 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_58=5 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_57=6 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=8 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_54=9 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_53=10 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=12 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_50=13 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_49=14 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=15 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_34=17 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_33=18 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=19 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_38=21 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_37=22 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=24 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_42=25 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_41=26 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=27 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=28 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_46=29 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_45=30 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=31 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=32 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_30=33 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_29=34 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=35 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=36 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_26=37 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_25=38 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=39 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=40 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_22=41 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_21=42 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=43 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=44 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_18=45 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_17=46 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=47 +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=48 +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_2=49 +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_1=50 +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=51 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=52 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_6=53 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_5=54 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=55 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_10=57 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=58 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=59 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_14=61 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_13=62 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=63 + +led 0 stop +led 0 prog \ + 06 FE 80 D2 19 71 08 E0 60 FE E9 D2 0F 75 10 81 \ + 61 FD 02 3F 60 FF 28 32 0F 87 67 4A 96 FF 06 FF \ + D2 2B 74 16 02 1F 60 FF 28 32 0F 87 67 4A 96 FF \ + 06 FF D2 13 74 28 02 0F 60 FF 28 32 0F 87 67 4A \ + 96 FF 06 FF D2 0B 74 3A 3A 48 32 07 32 08 C7 32 \ + 04 C7 97 71 57 77 69 32 00 32 01 B7 97 71 63 32 \ + 0E 77 6B 26 FD 97 27 77 6B 32 0F 87 57 00 00 00 +led 0 start + +led 1 stop +led 1 prog \ + 06 FE 80 D2 19 71 08 E0 60 FE E9 D2 0F 75 10 81 \ + 61 FD 02 20 67 89 02 24 67 89 02 10 67 89 02 28 \ + 67 89 02 2C 67 89 02 0C 67 89 02 2C 67 79 02 28 \ + 67 79 02 24 67 79 02 20 67 79 02 10 67 79 02 0C \ + 67 79 02 0B 60 FF 28 32 0F 87 67 56 96 FF 06 FF \ + D2 FF 74 46 3A 36 32 07 32 08 C7 32 04 C7 97 71 \ + 63 77 75 32 00 32 01 B7 97 71 6F 32 0E 77 77 26 \ + FD 97 27 77 77 32 0F 87 57 12 A0 F8 15 1A 01 75 \ + 85 28 67 56 57 32 0F 87 57 12 A0 F8 15 1A 01 71 \ + A1 28 67 56 80 28 67 56 80 28 67 56 80 28 67 56 \ + 57 32 0F 87 32 0F 87 32 0F 87 32 0F 87 57 00 00 +led 1 start diff --git a/device/celestica/x86_64-cel_seastone-r0/led_proc_init.soc b/device/celestica/x86_64-cel_seastone-r0/led_proc_init.soc index fb898fcadfc1..450533c0dc68 100755 --- a/device/celestica/x86_64-cel_seastone-r0/led_proc_init.soc +++ b/device/celestica/x86_64-cel_seastone-r0/led_proc_init.soc @@ -1,11 +1,8 @@ - -# Download LED code into LED processor and enable (if applicable). - -led 0 load /usr/share/sonic/platform/led-code/ledcode0; -led 0 auto on; led 0 start; -led 1 load /usr/share/sonic/platform/led-code/ledcode1; -led 1 auto on; led 1 start; -led 2 load /usr/share/sonic/platform/led-code/ledcode2; -led 2 auto on; led 2 start - - +# Download LED code into LED processor and enable (if applicable). + +led 0 load /usr/share/sonic/platform/led-code/ledcode0; +led 0 auto on; led 0 start; +led 1 load /usr/share/sonic/platform/led-code/ledcode1; +led 1 auto on; led 1 start; +led 2 load /usr/share/sonic/platform/led-code/ledcode2; +led 2 auto on; led 2 start diff --git a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/minigraph.xml b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/minigraph.xml index 470b07922b9d..98c87eb8af0e 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/minigraph.xml +++ b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/minigraph.xml @@ -1,121 +1,121 @@ - - - - - - OCPSCH0104001MS - 10.10.1.30 - OCPSCH01040HHLF - 10.10.1.29 - 1 - 10 - 3 - - - OCPSCH0104002MS - 10.10.2.30 - OCPSCH01040HHLF - 10.10.2.29 - 1 - 10 - 3 - - - - - 64536 - OCPSCH01040HHLF - - -
10.10.1.30
- - -
- -
10.10.2.30
- - -
-
- -
- - 64542 - OCPSCH0104001MS - - - - 64543 - OCPSCH0104002MS - - -
-
- - - - - - HostIP - Loopback0 - - 100.0.0.10/32 - - 100.0.0.10/32 - - - - - - - - OCPSCH01040HHLF - - - - - - Ethernet48 - 10.10.1.29/30 - - - - Ethernet52 - 10.10.2.29/30 - - - - - - - - - - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet48 - OCPSCH01040HHLF - Ethernet48 - - - 40000 - DeviceInterfaceLink - OCPSCH0104002MS - Ethernet0 - OCPSCH01040HHLF - Ethernet52 - - - - - OCPSCH01040HHLF - INGRASYS-S8900-54XC - - - - OCPSCH01040HHLF - INGRASYS-S8900-54XC -
+ + + + + + OCPSCH0104001MS + 10.10.1.30 + OCPSCH01040HHLF + 10.10.1.29 + 1 + 10 + 3 + + + OCPSCH0104002MS + 10.10.2.30 + OCPSCH01040HHLF + 10.10.2.29 + 1 + 10 + 3 + + + + + 64536 + OCPSCH01040HHLF + + +
10.10.1.30
+ + +
+ +
10.10.2.30
+ + +
+
+ +
+ + 64542 + OCPSCH0104001MS + + + + 64543 + OCPSCH0104002MS + + +
+
+ + + + + + HostIP + Loopback0 + + 100.0.0.10/32 + + 100.0.0.10/32 + + + + + + + + OCPSCH01040HHLF + + + + + + Ethernet48 + 10.10.1.29/30 + + + + Ethernet52 + 10.10.2.29/30 + + + + + + + + + + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet48 + OCPSCH01040HHLF + Ethernet48 + + + 40000 + DeviceInterfaceLink + OCPSCH0104002MS + Ethernet0 + OCPSCH01040HHLF + Ethernet52 + + + + + OCPSCH01040HHLF + INGRASYS-S8900-54XC + + + + OCPSCH01040HHLF + INGRASYS-S8900-54XC +
diff --git a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/minigraph.xml b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/minigraph.xml index fe96dc87acf6..8a7d765cefc1 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/minigraph.xml +++ b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/minigraph.xml @@ -1,359 +1,359 @@ - - - - - - BGPSession - OCPSCH0104001MS - 10.10.1.2 - OCPSCH01040AALF - 10.10.1.1 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.6 - OCPSCH01040BBLF - 10.10.1.5 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.10 - OCPSCH01040CCLF - 10.10.1.9 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.14 - OCPSCH01040DDLF - 10.10.1.13 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.18 - OCPSCH01040EELF - 10.10.1.17 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.22 - OCPSCH01040FFLF - 10.10.1.21 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.26 - OCPSCH01040GGLF - 10.10.1.25 - 1 - 10 - 3 - - - BGPSession - OCPSCH0104001MS - 10.10.1.30 - OCPSCH01040HHLF - 10.10.1.29 - 1 - 10 - 3 - - - - - 64542 - OCPSCH0104001MS - - - BGPPeer -
10.10.1.2
- - -
- - BGPPeer -
10.10.1.6
- - -
- - BGPPeer -
10.10.1.10
- - -
- - BGPPeer -
10.10.1.14
- - -
- - BGPPeer -
10.10.1.18
- - -
- - BGPPeer -
10.10.1.22
- - -
- - BGPPeer -
10.10.1.26
- - -
- - BGPPeer -
10.10.1.30
- - -
-
- -
- - 64536 - OCPSCH01040AALF - - - - 64536 - OCPSCH01040BBLF - - - - 64536 - OCPSCH01040CCLF - - - - 64536 - OCPSCH01040DDLF - - - - 64536 - OCPSCH01040EELF - - - - 64536 - OCPSCH01040FFLF - - - - 64536 - OCPSCH01040GGLF - - - - 64536 - OCPSCH01040HHLF - - -
-
- - - - - - LoopbackInterface - HostIP - Loopback0 - - 100.0.0.1/32 - - 100.0.0.1/32 - - - - - - - - OCPSCH0104001MS - - - - VlanInterface - Vlan851 - Ethernet0;Ethernet1;Ethernet2;Ethernet3;Ethernet96;Ethernet100;Ethernet104;Ethernet108 - False - 0.0.0.0/0 - - 851 - 10.20.1.0/24 - - - - - IPInterface - - Vlan851 - 10.20.1.1/24 - - - IPInterface - - Ethernet48 - 10.10.1.2/30 - - - IPInterface - - Ethernet52 - 10.10.1.6/30 - - - IPInterface - - Ethernet56 - 10.10.1.10/30 - - - IPInterface - - Ethernet60 - 10.10.1.14/30 - - - IPInterface - - Ethernet64 - 10.10.1.18/30 - - - IPInterface - - Ethernet68 - 10.10.1.22/30 - - - IPInterface - - Ethernet72 - 10.10.1.26/30 - - - IPInterface - - Ethernet76 - 10.10.1.30/30 - - - - - - - - - - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet48 - OCPSCH01040AALF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet52 - OCPSCH01040BBLF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet56 - OCPSCH01040CCLF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet60 - OCPSCH01040DDLF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet64 - OCPSCH01040EELF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet68 - OCPSCH01040FFLF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet72 - OCPSCH01040GGLF - Ethernet0 - - - 40000 - DeviceInterfaceLink - OCPSCH0104001MS - Ethernet76 - OCPSCH01040HHLF - Ethernet48 - - - - - OCPSCH0104001MS - INGRASYS-S8900-64XC - - - - - - - - OCPSCH0104001MS - INGRASYS-S8900-64XC -
+ + + + + + BGPSession + OCPSCH0104001MS + 10.10.1.2 + OCPSCH01040AALF + 10.10.1.1 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.6 + OCPSCH01040BBLF + 10.10.1.5 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.10 + OCPSCH01040CCLF + 10.10.1.9 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.14 + OCPSCH01040DDLF + 10.10.1.13 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.18 + OCPSCH01040EELF + 10.10.1.17 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.22 + OCPSCH01040FFLF + 10.10.1.21 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.26 + OCPSCH01040GGLF + 10.10.1.25 + 1 + 10 + 3 + + + BGPSession + OCPSCH0104001MS + 10.10.1.30 + OCPSCH01040HHLF + 10.10.1.29 + 1 + 10 + 3 + + + + + 64542 + OCPSCH0104001MS + + + BGPPeer +
10.10.1.2
+ + +
+ + BGPPeer +
10.10.1.6
+ + +
+ + BGPPeer +
10.10.1.10
+ + +
+ + BGPPeer +
10.10.1.14
+ + +
+ + BGPPeer +
10.10.1.18
+ + +
+ + BGPPeer +
10.10.1.22
+ + +
+ + BGPPeer +
10.10.1.26
+ + +
+ + BGPPeer +
10.10.1.30
+ + +
+
+ +
+ + 64536 + OCPSCH01040AALF + + + + 64536 + OCPSCH01040BBLF + + + + 64536 + OCPSCH01040CCLF + + + + 64536 + OCPSCH01040DDLF + + + + 64536 + OCPSCH01040EELF + + + + 64536 + OCPSCH01040FFLF + + + + 64536 + OCPSCH01040GGLF + + + + 64536 + OCPSCH01040HHLF + + +
+
+ + + + + + LoopbackInterface + HostIP + Loopback0 + + 100.0.0.1/32 + + 100.0.0.1/32 + + + + + + + + OCPSCH0104001MS + + + + VlanInterface + Vlan851 + Ethernet0;Ethernet1;Ethernet2;Ethernet3;Ethernet96;Ethernet100;Ethernet104;Ethernet108 + False + 0.0.0.0/0 + + 851 + 10.20.1.0/24 + + + + + IPInterface + + Vlan851 + 10.20.1.1/24 + + + IPInterface + + Ethernet48 + 10.10.1.2/30 + + + IPInterface + + Ethernet52 + 10.10.1.6/30 + + + IPInterface + + Ethernet56 + 10.10.1.10/30 + + + IPInterface + + Ethernet60 + 10.10.1.14/30 + + + IPInterface + + Ethernet64 + 10.10.1.18/30 + + + IPInterface + + Ethernet68 + 10.10.1.22/30 + + + IPInterface + + Ethernet72 + 10.10.1.26/30 + + + IPInterface + + Ethernet76 + 10.10.1.30/30 + + + + + + + + + + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet48 + OCPSCH01040AALF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet52 + OCPSCH01040BBLF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet56 + OCPSCH01040CCLF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet60 + OCPSCH01040DDLF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet64 + OCPSCH01040EELF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet68 + OCPSCH01040FFLF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet72 + OCPSCH01040GGLF + Ethernet0 + + + 40000 + DeviceInterfaceLink + OCPSCH0104001MS + Ethernet76 + OCPSCH01040HHLF + Ethernet48 + + + + + OCPSCH0104001MS + INGRASYS-S8900-64XC + + + + + + + + OCPSCH0104001MS + INGRASYS-S8900-64XC +
From 48f1a638cb669a4cd2f3f87f6d34ac527c740e84 Mon Sep 17 00:00:00 2001 From: lguohan Date: Tue, 5 Sep 2017 20:55:07 -0700 Subject: [PATCH 20/77] [sairedis]: revert deadlock fix in sonic-sairedis submodule (#934) The deadlock fix in sonic-sairedis introduce other race conditions which is more prevelant. --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 3f4afbbd9d7e..7e70b4d63020 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 3f4afbbd9d7ed2f077922e0cb0d59df743e34a9a +Subproject commit 7e70b4d63020fc9ea1aa009c264e4effab7bcda0 From 116ba4b180d6c8589123a73d5056628949a6a748 Mon Sep 17 00:00:00 2001 From: lguohan Date: Wed, 6 Sep 2017 20:07:32 -0700 Subject: [PATCH 21/77] [baseimage]: allocate varlog disk in the initramfs stage (#936) moving to initramfs unifies disk allocate on different platforms. use fallocate instead of dd to speed up the disk allocation. By default, mkfs.ext4 has -E discard option which discards the blocks at the mkfs time, also speed up the initialization time. --- build_debian.sh | 2 ++ files/initramfs-tools/arista-convertfs.j2 | 31 ++----------------- files/initramfs-tools/union-mount.j2 | 6 ++++ files/initramfs-tools/varlog | 36 +++++++++++++++++++++++ installer/x86_64/install.sh | 20 +------------ 5 files changed, 47 insertions(+), 48 deletions(-) create mode 100644 files/initramfs-tools/varlog diff --git a/build_debian.sh b/build_debian.sh index d7e7c3307536..21c370753592 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -132,6 +132,8 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/arista- ## 2. Bind-mount docker working directory (docker aufs cannot work over aufs rootfs) sudo cp files/initramfs-tools/union-mount $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/union-mount sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/union-mount +sudo cp files/initramfs-tools/varlog $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog +sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck sudo chroot $FILESYSTEM_ROOT update-initramfs -u diff --git a/files/initramfs-tools/arista-convertfs.j2 b/files/initramfs-tools/arista-convertfs.j2 index 81c6d9d1943f..75ce011e839a 100644 --- a/files/initramfs-tools/arista-convertfs.j2 +++ b/files/initramfs-tools/arista-convertfs.j2 @@ -82,28 +82,6 @@ run_cmd() { fi } -create_varlog_file() { - local err_msg="Error: create var-log ext4 file" - local cmd="[ -n "$varlog_size" ] && mkdir -p $root_mnt/disk-img && dd if=/dev/zero of=$root_mnt/disk-img/var-log.ext4 count=$((2048*$varlog_size)) && mke2fs -t ext4 -q -F $root_mnt/disk-img/var-log.ext4" - run_cmd "$cmd" "$err_msg" -} - -mount_and_create_varlog_file() { - [ -z "$varlog_size" ] && exit 0 - mkdir -p "$root_mnt" - mount -t ext4 "$root_dev" "$root_mnt" - # exit when the var_log.ext4 exists and the size matches - if [ -e "$root_mnt/disk-img/var-log.ext4" ]; then - cur_varlog_size=$(ls -l $root_mnt/disk-img/var-log.ext4 | awk '{print $5}') - if [ $cur_varlog_size == $((1024*1024*$varlog_size)) ]; then - exit 0 - fi - fi - create_varlog_file - umount "$root_mnt" - exit 0 -} - # Extract kernel parameters set -- $(cat /proc/cmdline) for x in "$@"; do @@ -114,9 +92,6 @@ for x in "$@"; do Aboot=*) aboot_flag="${x#Aboot=}" ;; - varlog_size=*) - varlog_size="${x#varlog_size=}" - ;; loop=*) x1="${x#loop=}" image_dir="${x1%/*}" @@ -135,8 +110,8 @@ if ! wait_for_root_dev; then exit 1 fi -# mount, create varlog file and exit when the root is ext4 -blkid | grep "$root_dev.*vfat" -q || mount_and_create_varlog_file +# exit when the root is ext4 +blkid | grep "$root_dev.*vfat" -q || exit 0 # Get flash dev name if [ -z "$block_flash" ]; then @@ -201,5 +176,3 @@ run_cmd "$cmd" "$err_msg" err_msg="Error: copying files form $tmp_mnt to $root_mnt failed" cmd="cp -a $tmp_mnt/. $root_mnt/" run_cmd "$cmd" "$err_msg" - -create_varlog_file diff --git a/files/initramfs-tools/union-mount.j2 b/files/initramfs-tools/union-mount.j2 index acc21e2885bc..db40d4f08601 100644 --- a/files/initramfs-tools/union-mount.j2 +++ b/files/initramfs-tools/union-mount.j2 @@ -1,6 +1,12 @@ #!/bin/sh -e + +PREREQS="varlog" + +prereqs() { echo "$PREREQS"; } + case $1 in prereqs) + prereqs exit 0 ;; esac diff --git a/files/initramfs-tools/varlog b/files/initramfs-tools/varlog new file mode 100644 index 000000000000..d1340eaa9d8b --- /dev/null +++ b/files/initramfs-tools/varlog @@ -0,0 +1,36 @@ +#!/bin/sh -e + +PREREQS="" + +prereqs() { echo "$PREREQS"; } + +case $1 in + prereqs) + prereqs + exit 0 + ;; +esac + +# Extract kernel parameters +set -- $(cat /proc/cmdline) +for x in "$@"; do + case "$x" in + varlog_size=*) + varlog_size="${x#varlog_size=}" + esac +done + +[ -z "$varlog_size" ] && 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}') + if [ $cur_varlog_size == $((1024*1024*$varlog_size)) ]; then + exit 0 + else + rm -rf ${rootmnt}/host/disk-img + fi +fi + +# create varlog disk +mkdir -p ${rootmnt}/host/disk-img && ${rootmnt}/usr/bin/fallocate -l "$varlog_size"M ${rootmnt}/host/disk-img/var-log.ext4 && mkfs.ext4 -q -F ${rootmnt}/host/disk-img/var-log.ext4 diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index ad1cc3691fbf..46942d6d58c3 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -450,24 +450,6 @@ TAR_EXTRA_OPTION="--numeric-owner" mkdir -p $demo_mnt/$image_dir/$DOCKERFS_DIR unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR -# Create loop device for /var/log to limit its size to $VAR_LOG_SIZE MB -if [ -f $demo_mnt/disk-img/var-log.ext4 ]; then - current_log_size_mb=$(ls -l --block-size=M $demo_mnt/disk-img/var-log.ext4 | cut -f5 -d" ") - if [ "$current_log_size_mb" = "$VAR_LOG_SIZE"M ]; then - echo "Log file system already exists. Size: ${VAR_LOG_SIZE}MB" - VAR_LOG_SIZE=0 - else - rm -rf $demo_mnt/disk-img - fi -fi - -if [ "$VAR_LOG_SIZE" != "0" ]; then - echo "Creating new log file system. Size: ${VAR_LOG_SIZE}MB" - mkdir -p $demo_mnt/disk-img - dd if=/dev/zero of=$demo_mnt/disk-img/var-log.ext4 count=$((2048*$VAR_LOG_SIZE)) - mkfs.ext4 -q $demo_mnt/disk-img/var-log.ext4 -F -fi - if [ "$install_env" = "onie" ]; then # Store machine description in target file system cp /etc/machine.conf $demo_mnt @@ -563,7 +545,7 @@ menuentry '$demo_grub_entry' { insmod ext2 linux /$image_dir/boot/vmlinuz-3.16.0-4-amd64 root=$demo_dev rw $GRUB_CMDLINE_LINUX \ loop=$image_dir/$FILESYSTEM_SQUASHFS loopfstype=squashfs \ - apparmor=1 security=apparmor $ONIE_PLATFORM_EXTRA_CMDLINE_LINUX + apparmor=1 security=apparmor varlog_size=$VAR_LOG_SIZE $ONIE_PLATFORM_EXTRA_CMDLINE_LINUX echo 'Loading $demo_volume_label $demo_type initial ramdisk ...' initrd /$image_dir/boot/initrd.img-3.16.0-4-amd64 } From 38cd1d5368f626243d3455c102b07db9289dfd46 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 6 Sep 2017 20:08:25 -0700 Subject: [PATCH 22/77] [Broadcom]: Remove BRCM_OPENNSL library and upgrade BRCM_SAI to 3.0.3.2 (#938) This library will be archived in to BRCM_SAI library --- platform/broadcom/rules.mk | 4 ++-- platform/broadcom/sai.mk | 9 ++++----- platform/broadcom/sdk.mk | 6 +----- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 529919d63e0d..21af44775dd3 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -29,7 +29,7 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE) \ $(DOCKER_FPM) # Inject brcm sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV) #$(LIBSAITHRIFT_DEV_BRCM) +$(LIBSAIREDIS)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV) #$(LIBSAITHRIFT_DEV_BRCM) # Runtime dependency on brcm sai is set only for syncd -$(SYNCD)_RDEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) +$(SYNCD)_RDEPENDS += $(BRCM_SAI) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 54655563d638..60a1d1f15eb7 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,12 +1,11 @@ -BRCM_SAI = libsaibcm_3.0.2.3_amd64.deb +BRCM_SAI = libsaibcm_3.0.3.2_amd64.deb # TODO: upload new SAI build to blob -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.2.3_amd64.deb" +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2_amd64.deb" -BRCM_SAI_DEV = libsaibcm-dev_3.0.2.3_amd64.deb +BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) # TODO: upload new SAI build to blob -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.2.3_amd64.deb" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2_amd64.deb" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) -$(BRCM_SAI)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) diff --git a/platform/broadcom/sdk.mk b/platform/broadcom/sdk.mk index 5824590c8d52..76a7671599f2 100644 --- a/platform/broadcom/sdk.mk +++ b/platform/broadcom/sdk.mk @@ -1,9 +1,5 @@ -BRCM_OPENNSL = libopennsl_3.2.3.3_amd64.deb -# TODO: upload new SDK build to blob -$(BRCM_OPENNSL)_URL = "https://sonicstorage.blob.core.windows.net/packages/libopennsl_3.2.3.3_amd64.deb" - BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb # TODO: upload new SDK build to blob $(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb" -SONIC_ONLINE_DEBS += $(BRCM_OPENNSL) $(BRCM_OPENNSL_KERNEL) +SONIC_ONLINE_DEBS += $(BRCM_OPENNSL_KERNEL) From e418675ba5ca0c489a7f834fc462253b47a03180 Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Thu, 7 Sep 2017 23:01:20 +0300 Subject: [PATCH 23/77] [rsyslog]: Use SONiC template in containers (#940) --- files/image_config/rsyslog/rsyslog.conf.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2 index 54e2eec3f999..07d81de9348e 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -30,11 +30,6 @@ $UDPServerRun 514 ########################### #### GLOBAL DIRECTIVES #### ########################### -#Set remote syslog server -{% for server in syslog_servers %} -*.* @{{ server }}:514 -{% endfor %} - # # Use traditional timestamp format. # To enable high precision timestamps, comment out the following line. @@ -45,6 +40,11 @@ $UDPServerRun 514 $template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionFileDefaultTemplate SONiCFileFormat +#Set remote syslog server +{% for server in syslog_servers %} +*.* @{{ server }}:514;SONiCFileFormat +{% endfor %} + # # Set the default permissions for all log files. # From 211689ad292c53934ae9d2664c906af75865bc0f Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 7 Sep 2017 14:02:17 -0700 Subject: [PATCH 24/77] [slave.mk]: Apply series of patches to SONIC_PYTHON_STDEB_DEBS targets if they exist (#941) --- slave.mk | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/slave.mk b/slave.mk index cc4a59a6d881..c44fe12642ac 100644 --- a/slave.mk +++ b/slave.mk @@ -179,13 +179,13 @@ SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES)) # SONIC_MAKE_DEBS += $(SOME_NEW_DEB) $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(HEADER) - # remove target to force rebuild + # Remove target to force rebuild rm -f $(addprefix $(DEBS_PATH)/, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) - # apply series of patches if exist + # Apply series of patches if exist if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi - # build project and take package + # Build project and take package make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG) - # clean up + # Clean up if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi $(FOOTER) @@ -199,16 +199,18 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) # SONIC_DPKG_DEBS += $(SOME_NEW_DEB) $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(HEADER) - # Build project and take package + # Remove old build logs if they exist rm -f $($*_SRC_PATH)/debian/*.debhelper.log - # apply series of patches if exist + # Apply series of patches if exist if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + # Build project pushd $($*_SRC_PATH) $(LOG) [ ! -f ./autogen.sh ] || ./autogen.sh $(LOG) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) $(LOG) popd $(LOG) - # clean up + # Clean up if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + # Take built package(s) mv $(addprefix $($*_SRC_PATH)/../, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) $(DEBS_PATH) $(LOG) $(FOOTER) @@ -222,10 +224,15 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) # SONIC_PYTHON_STDEB_DEBS += $(SOME_NEW_DEB) $(addprefix $(DEBS_PATH)/, $(SONIC_PYTHON_STDEB_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(HEADER) - # Build project and take package + # Apply series of patches if exist + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + # Build project pushd $($*_SRC_PATH) $(LOG) python setup.py --command-packages=stdeb.command bdist_deb $(LOG) popd $(LOG) + # Clean up + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + # Take built package(s) mv $(addprefix $($*_SRC_PATH)/deb_dist/, $* $($*_DERIVED_DEBS)) $(DEBS_PATH) $(LOG) $(FOOTER) @@ -374,7 +381,7 @@ $(DOCKER_LOAD_TARGETS) : $(TARGET_PATH)/%.gz-load : .platform docker-start $$(TA # targets for building installers with base image $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform onie-image.conf $$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS)) $$(addprefix $(DEBS_PATH)/,$$($$*_INSTALLS)) $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) $(addprefix $(DEBS_PATH)/,$(INITRAMFS_TOOLS) $(LINUX_KERNEL) $(IGB_DRIVER) $(SONIC_DEVICE_DATA) $(SONIC_UTILS)) $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) $$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CONFIG_ENGINE)) $(HEADER) - ## Pass initramfs and linux kernel explicitly. They are used for all platforms + # Pass initramfs and linux kernel explicitly. They are used for all platforms export initramfs_tools="$(DEBS_PATH)/$(INITRAMFS_TOOLS)" export linux_kernel="$(DEBS_PATH)/$(LINUX_KERNEL)" export kversion="$(KVERSION)" From 5098d98976b4173fd3ce492d8a0c1179ccf787aa Mon Sep 17 00:00:00 2001 From: lguohan Date: Fri, 8 Sep 2017 08:26:30 -0700 Subject: [PATCH 25/77] [dell]: remove nos_to_sonic_grub.cfg (#943) no longer needed in the build image --- build_image.sh | 4 -- .../nos_to_sonic_grub.cfg | 44 ------------------- .../nos_to_sonic_grub.cfg | 44 ------------------- 3 files changed, 92 deletions(-) delete mode 100644 device/dell/x86_64-dell_s6100_c2538-r0/nos_to_sonic_grub.cfg delete mode 100644 device/dell/x86_64-dell_z9100_c2538-r0/nos_to_sonic_grub.cfg diff --git a/build_image.sh b/build_image.sh index 2d229c2d194b..ee7fb8a75823 100755 --- a/build_image.sh +++ b/build_image.sh @@ -25,10 +25,6 @@ generate_onie_installer_image() cp ./device/$VENDOR/$PLATFORM/installer.conf ./installer/x86_64/platforms/$PLATFORM fi - if [ "$IMAGE_TYPE" = "raw" ] && [ -f ./device/$VENDOR/$PLATFORM/nos_to_sonic_grub.cfg ]; then - sed -i -e "s/%%IMAGE_VERSION%%/$IMAGE_VERSION/g" ./device/$VENDOR/$PLATFORM/nos_to_sonic_grub.cfg - echo "IMAGE_VERSION is $IMAGE_VERSION" - fi done done diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/nos_to_sonic_grub.cfg b/device/dell/x86_64-dell_s6100_c2538-r0/nos_to_sonic_grub.cfg deleted file mode 100644 index 058b1a9ea118..000000000000 --- a/device/dell/x86_64-dell_s6100_c2538-r0/nos_to_sonic_grub.cfg +++ /dev/null @@ -1,44 +0,0 @@ -# -# Grub config to launch SONiC -# with ONIE boot option - -insmod serial -# Initialize USB-Serial com2 port -serial --unit=1 --speed=9600 -#Serial port config;Defaults: COM1,9600 -serial --unit=0 --speed=9600 -terminal_output serial_com0 -terminal_input serial_com0 -#terminfo added to prevent text wrap issue. -terminfo -g 80x100 serial_com0 -terminfo -g 80x100 serial_com1 - -echo -n "Press Esc to stop autoboot ... " -if sleep --verbose --interruptible 5 ; then - insmod gzio - insmod part_msdos - insmod ext2 - set root='(hd0,gpt8)' - linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor - initrd /image-%%IMAGE_VERSION%%/boot/initrd.img-3.16.0-4-amd64 - boot -else - menuentry 'SONiC' { - insmod gzio - insmod part_msdos - insmod ext2 - set root='(hd0,gpt8)' - linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor - initrd /image-%%IMAGE_VERSION%%/boot/initrd.img-3.16.0-4-amd64 - boot - } - - menuentry 'ONIE' { - insmod force10 - onieboot - } - - menuentry 'DELL-DIAG' { - delldiagboot - } -fi diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/nos_to_sonic_grub.cfg b/device/dell/x86_64-dell_z9100_c2538-r0/nos_to_sonic_grub.cfg deleted file mode 100644 index 058b1a9ea118..000000000000 --- a/device/dell/x86_64-dell_z9100_c2538-r0/nos_to_sonic_grub.cfg +++ /dev/null @@ -1,44 +0,0 @@ -# -# Grub config to launch SONiC -# with ONIE boot option - -insmod serial -# Initialize USB-Serial com2 port -serial --unit=1 --speed=9600 -#Serial port config;Defaults: COM1,9600 -serial --unit=0 --speed=9600 -terminal_output serial_com0 -terminal_input serial_com0 -#terminfo added to prevent text wrap issue. -terminfo -g 80x100 serial_com0 -terminfo -g 80x100 serial_com1 - -echo -n "Press Esc to stop autoboot ... " -if sleep --verbose --interruptible 5 ; then - insmod gzio - insmod part_msdos - insmod ext2 - set root='(hd0,gpt8)' - linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor - initrd /image-%%IMAGE_VERSION%%/boot/initrd.img-3.16.0-4-amd64 - boot -else - menuentry 'SONiC' { - insmod gzio - insmod part_msdos - insmod ext2 - set root='(hd0,gpt8)' - linux /image-%%IMAGE_VERSION%%/boot/vmlinuz-3.16.0-4-amd64 root=/dev/sda8 rw console=tty0 console=ttyS1,9600n8 loop=image-%%IMAGE_VERSION%%/fs.squashfs loopfstype=squashfs apparmor=1 security=apparmor - initrd /image-%%IMAGE_VERSION%%/boot/initrd.img-3.16.0-4-amd64 - boot - } - - menuentry 'ONIE' { - insmod force10 - onieboot - } - - menuentry 'DELL-DIAG' { - delldiagboot - } -fi From 8f1ac5d5ecbc1d95cd617575edc6efcb14f86e25 Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Sat, 9 Sep 2017 04:25:25 +0300 Subject: [PATCH 26/77] [rsyslog]: Use timegenerated instead of timestamp (#944) * [rsyslog]: Use timegenerated instead of timestamp This is useful when rsyslog is used to put markers generated on other machines. This way all messages will have a timestamp from a single system. * [rsyslog] Use subseconds from local machine --- files/image_config/rsyslog/rsyslog.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2 index 07d81de9348e..264ddd8dd7bf 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -37,7 +37,7 @@ $UDPServerRun 514 #$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # Define a custom template -$template SONiCFileFormat,"%TIMESTAMP%.%timestamp:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionFileDefaultTemplate SONiCFileFormat #Set remote syslog server From 2cd2f95384fc8662f89b5ed408ce843b37c0212a Mon Sep 17 00:00:00 2001 From: lguohan Date: Fri, 8 Sep 2017 21:27:15 -0700 Subject: [PATCH 27/77] [github]: add templates for submitting issues and PR (#947) --- .github/ISSUE_TEMPLATE.md | 60 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 26 ++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000000..05f39760b195 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,60 @@ + + +**Description** + + + +**Steps to reproduce the issue:** +1. +2. +3. + +**Describe the results you received:** + + +**Describe the results you expected:** + + +**Additional information you deem important (e.g. issue happens only occasionally):** + + **Output of `show version`:** + + ``` + (paste your output here) + ``` + + **Attach debug file `sudo generate_dump`:** + + ``` + (paste your output here) + ``` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..2ac7d9e47730 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ + + +**- What I did** + +**- How I did it** + +**- How to verify it** + +**- Description for the changelog** + + + +**- A picture of a cute animal (not mandatory but encouraged)** From d3997f4a356d0669bccbd96cd12c191fecfe0212 Mon Sep 17 00:00:00 2001 From: lguohan Date: Sat, 9 Sep 2017 15:22:52 -0700 Subject: [PATCH 28/77] [sonic-slave]: SLAVE_TAG should be for both Dockerfile and Dockerfile.user (#950) Should rebuild both Dockerfile and Dockerfile.user when any of the two files change. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d779c30718dc..7240237c2744 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ $(shell rm -f .screen) MAKEFLAGS += -B SLAVE_BASE_TAG = $(shell shasum sonic-slave/Dockerfile | awk '{print substr($$1,0,11);}') -SLAVE_TAG = $(shell shasum sonic-slave/Dockerfile.user | awk '{print substr($$1,0,11);}') +SLAVE_TAG = $(shell cat sonic-slave/Dockerfile.user sonic-slave/Dockerfile | shasum | awk '{print substr($$1,0,11);}') SLAVE_BASE_IMAGE = sonic-slave-base SLAVE_IMAGE = sonic-slave-$(USER) From bc730829225226eb6c9526a263321750a9ac30af Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 11 Sep 2017 15:29:42 -0700 Subject: [PATCH 29/77] [devices]: Add led plugin for Arista 7060CX-32S and 7260CX3-64 (#945) * Bump sonic-platform-modules-arista submodule * Allow image specific mount option for containers * Add led plugin for DCS-7060CX-32S * Add led plugin for DCS-7260CX3-64 --- .../arista/x86_64-arista_7060_cx32s/plugins/led_control.py | 6 ++++++ .../arista/x86_64-arista_7260cx3_64/plugins/led_control.py | 6 ++++++ platform/broadcom/sonic-platform-modules-arista | 2 +- rules/docker-platform-monitor.mk | 3 +++ slave.mk | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py create mode 100644 device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py b/device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py new file mode 100644 index 000000000000..8d387e513c6c --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py @@ -0,0 +1,6 @@ +try: + import arista.utils.sonic_leds as arista_leds +except ImportError, e: + raise ImportError (str(e) + "- required module not found") + +LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py b/device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py new file mode 100644 index 000000000000..8d387e513c6c --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py @@ -0,0 +1,6 @@ +try: + import arista.utils.sonic_leds as arista_leds +except ImportError, e: + raise ImportError (str(e) + "- required module not found") + +LedControl = arista_leds.getLedControl() diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 4ad9358d16b8..d1417bff1778 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 4ad9358d16b8cd0b57d5922353f38055f83042e4 +Subproject commit d1417bff17780255d4cc371b315f620087673eb8 diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 39f8cdd3f297..76e7dac4ab63 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -12,4 +12,7 @@ $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --net=host --privileged -t $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +# Mount Arista python library on Aboot images to be used by plugins +$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/arista:/usr/lib/python2.7/dist-packages/arista:ro + $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += sensors:/usr/bin/sensors diff --git a/slave.mk b/slave.mk index c44fe12642ac..caed4279dcc3 100644 --- a/slave.mk +++ b/slave.mk @@ -400,6 +400,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform export docker_image="$(docker)" export docker_image_name="$(basename $(docker))" export docker_container_name="$($(docker)_CONTAINER_NAME)" + $(eval $(docker)_RUN_OPT += $($(docker)_$($*_IMAGE_TYPE)_RUN_OPT)) export docker_image_run_opt="$($(docker)_RUN_OPT)" j2 files/build_templates/docker_image_ctl.j2 > $($(docker)_CONTAINER_NAME).sh if [ -f files/build_templates/$($(docker)_CONTAINER_NAME).service.j2 ]; then From c9cc7aea41f9d6864ee606f3eae9209f70193d61 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Tue, 12 Sep 2017 14:13:27 -0700 Subject: [PATCH 30/77] [configdb] Migrate minigraph configurations to DB (#942) Modify minigraph parser output format so it fit DB schema Modify configuration templates to fit new schema Systemd services dependencies are modified so database starts before any configuration consumer --- dockers/docker-dhcp-relay/Dockerfile.j2 | 1 + dockers/docker-dhcp-relay/isc-dhcp-relay.j2 | 20 +- dockers/docker-dhcp-relay/start.sh | 34 +-- dockers/docker-dhcp-relay/wait_for_intf.sh.j2 | 28 ++ dockers/docker-fpm-frr/bgpd.conf.j2 | 28 +- dockers/docker-fpm-frr/config.sh | 8 +- dockers/docker-fpm-frr/zebra.conf.j2 | 40 +-- dockers/docker-fpm-gobgp/gobgpd.conf.j2 | 2 +- dockers/docker-fpm-gobgp/start.sh | 8 +- dockers/docker-fpm-gobgp/zebra.conf.j2 | 40 +-- dockers/docker-fpm-quagga/bgpd.conf.j2 | 40 +-- dockers/docker-fpm-quagga/zebra.conf.j2 | 40 +-- dockers/docker-lldp-sv2/lldpd.conf.j2 | 6 +- dockers/docker-lldp-sv2/start.sh | 2 +- dockers/docker-orchagent/arp_update | 2 +- dockers/docker-orchagent/ipinip.json.j2 | 4 +- dockers/docker-orchagent/mirror.json.j2 | 13 +- dockers/docker-orchagent/orchagent.sh | 2 +- dockers/docker-orchagent/ports.json.j2 | 10 +- dockers/docker-orchagent/start.sh | 10 +- dockers/docker-orchagent/swssconfig.sh | 2 +- dockers/docker-snmp-sv2/alias_map.j2 | 4 +- dockers/docker-snmp-sv2/snmpd.conf.j2 | 16 +- dockers/docker-snmp-sv2/start.sh | 6 +- dockers/docker-snmp-sv2/sysDescription.j2 | 2 +- dockers/docker-teamd/start.sh | 4 +- dockers/docker-teamd/teamd.j2 | 4 +- files/build_templates/docker_image_ctl.j2 | 14 +- files/build_templates/swss.service.j2 | 1 + .../interfaces/interfaces-config.service | 3 +- .../interfaces/interfaces-config.sh | 2 +- files/image_config/interfaces/interfaces.j2 | 88 +++--- files/image_config/ntp/ntp-config.service | 2 + files/image_config/ntp/ntp-config.sh | 2 +- files/image_config/ntp/ntp.conf.j2 | 6 +- .../rsyslog/rsyslog-config.service | 2 + files/image_config/rsyslog/rsyslog-config.sh | 2 +- files/image_config/rsyslog/rsyslog.conf.j2 | 2 +- .../updategraph/updategraph.service | 4 +- src/sonic-config-engine/minigraph.py | 255 ++++++------------ src/sonic-config-engine/sonic-cfggen | 50 +++- .../tests/sample_output/interfaces | 10 + .../tests/sample_output/mirror.json | 2 +- src/sonic-config-engine/tests/test_cfggen.py | 48 ++-- src/sonic-config-engine/tests/test_j2files.py | 4 +- src/sonic-config-engine/translate_acl | 17 +- src/sonic-py-swsssdk | 2 +- 47 files changed, 461 insertions(+), 431 deletions(-) create mode 100755 dockers/docker-dhcp-relay/wait_for_intf.sh.j2 diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index a7e1a1cffb9d..3c6614c4921f 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -25,5 +25,6 @@ RUN rm -rf /debs COPY ["start.sh", "isc-dhcp-relay.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["isc-dhcp-relay.j2", "/usr/share/sonic/templates/"] +COPY ["wait_for_intf.sh.j2", "/usr/share/sonic/templates/"] ENTRYPOINT ["/usr/bin/supervisord"] diff --git a/dockers/docker-dhcp-relay/isc-dhcp-relay.j2 b/dockers/docker-dhcp-relay/isc-dhcp-relay.j2 index 1c50b685ebda..cdedfcf9692b 100644 --- a/dockers/docker-dhcp-relay/isc-dhcp-relay.j2 +++ b/dockers/docker-dhcp-relay/isc-dhcp-relay.j2 @@ -1,25 +1,25 @@ -SERVERS="{{ dhcp_servers | join(' ') }}" +SERVERS="{{ DHCP_SERVER | join(' ') }}" INTERFACES=" {%- set add_preceding_space = { 'flag': False } %} -{%- for interface in minigraph_interfaces %} -{%- if interface['addr'] | ipv4 %} +{%- for (name, prefix) in INTERFACE %} +{%- if prefix | ipv4 %} {%- if add_preceding_space.flag %} {% endif %} -{{ interface['attachto'] }} +{{ name }} {%- set _dummy = add_preceding_space.update({'flag': True}) %} {%- endif %} {%- endfor %} -{%- for vlan_interface in minigraph_vlan_interfaces %} -{%- if vlan_interface['addr'] | ipv4 %} +{%- for (name, prefix) in VLAN_INTERFACE %} +{%- if prefix | ipv4 %} {%- if add_preceding_space.flag %} {% endif %} -{{ vlan_interface['attachto'] }} +{{ name }} {%- set _dummy = add_preceding_space.update({'flag': True}) %} {%- endif %} {%- endfor %} -{%- for pc_interface in minigraph_portchannel_interfaces %} -{%- if pc_interface['addr'] | ipv4 %} +{%- for (name, prefix) in PORTCHANNEL_INTERFACE %} +{%- if prefix | ipv4 %} {%- if add_preceding_space.flag %} {% endif %} -{{ pc_interface['attachto'] }} +{{ name }} {%- set _dummy = add_preceding_space.update({'flag': True}) %} {%- endif %} {%- endfor %}" diff --git a/dockers/docker-dhcp-relay/start.sh b/dockers/docker-dhcp-relay/start.sh index 5c2e9de09703..37c3f488a5c7 100755 --- a/dockers/docker-dhcp-relay/start.sh +++ b/dockers/docker-dhcp-relay/start.sh @@ -1,42 +1,16 @@ #!/usr/bin/env bash -function wait_until_iface_exists -{ - IFACE=$1 - - echo "Waiting for interface ${IFACE}..." - - # Wait for the interface to come up (i.e., 'ip link show' returns 0) - until ip link show $IFACE > /dev/null 2>&1; do - sleep 1 - done - - echo "Interface ${IFACE} is created" -} - # Create isc-dhcp-relay config file -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/isc-dhcp-relay.j2 > /etc/default/isc-dhcp-relay +sonic-cfggen -d -t /usr/share/sonic/templates/isc-dhcp-relay.j2 > /etc/default/isc-dhcp-relay rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd # Wait for all interfaces to come up before starting the DHCP relay - -FRONT_PANEL_IFACES=$(sonic-cfggen -m /etc/sonic/minigraph.xml --var-json "minigraph_interfaces" | grep "\"attachto\":" | sed 's/^\s*"attachto":\s"\(.*\)".*$/\1/') -for IFACE in $FRONT_PANEL_IFACES; do - wait_until_iface_exists $IFACE -done - -VLAN_IFACES=$(sonic-cfggen -m /etc/sonic/minigraph.xml --var-json "minigraph_vlan_interfaces" | grep "\"attachto\":" | sed 's/^\s*"attachto":\s"\(.*\)".*$/\1/') -for IFACE in $VLAN_IFACES; do - wait_until_iface_exists $IFACE -done - -PORTCHANNEL_IFACES=$(sonic-cfggen -m /etc/sonic/minigraph.xml --var-json "minigraph_portchannel_interfaces" | grep "\"attachto\":" | sed 's/^\s*"attachto":\s"\(.*\)".*$/\1/') -for IFACE in $PORTCHANNEL_IFACES; do - wait_until_iface_exists $IFACE -done +sonic-cfggen -d -t /usr/share/sonic/templates/wait_for_intf.sh.j2 > /usr/bin/wait_for_intf.sh +chmod +x /usr/bin/wait_for_intf.sh +/usr/bin/wait_for_intf.sh # Start the DHCP relay supervisorctl start isc-dhcp-relay diff --git a/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 b/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 new file mode 100755 index 000000000000..b859a43b07b1 --- /dev/null +++ b/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +function wait_until_iface_exists +{ + IFACE=$1 + + echo "Waiting for interface ${IFACE}..." + + # Wait for the interface to come up (i.e., 'ip link show' returns 0) + until ip link show $IFACE > /dev/null 2>&1; do + sleep 1 + done + + echo "Interface ${IFACE} is created" +} + + +# Wait for all interfaces to come up before starting the DHCP relay +{% for (name, prefix) in INTERFACE %} +wait_until_iface_exists {{ name }} +{% endfor %} +{% for (name, prefix) in VLAN_INTERFACE %} +wait_until_iface_exists {{ name }} +{% endfor %} +{% for (name, prefix) in PORTCHANNEL_INTERFACE %} +wait_until_iface_exists {{ name }} +{% endfor %} + diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index c66d5bfb232f..0f1e255b5cd1 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -1,13 +1,13 @@ ! {% block banner %} ! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== -! generated by templates/quagga/bgpd.conf.j2 using minigraph_facts.py +! generated by templates/quagga/bgpd.conf.j2 with config DB data ! file: bgpd.conf ! {% endblock banner %} ! {% block system_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra log syslog informational log facility local4 @@ -23,25 +23,25 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} bgp bestpath as-path multipath-relax no bgp default ipv4-unicast {# TODO: use lo[0] for backward compatibility, will revisit the case with multiple lo interfaces #} - bgp router-id {{ minigraph_lo_interfaces[0]['addr'] }} + bgp router-id {{ LOOPBACK_INTERFACE.keys()[0][1] }} {# advertise loopback #} -{% for lo in minigraph_lo_interfaces %} -{% if lo['addr'] | ipv4 %} - network {{ lo['addr'] }}/32 -{% elif lo['addr'] | ipv6 %} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% if prefix | ipv4 %} + network {{ prefix | ip }}/32 +{% elif prefix | ipv6 %} address-family ipv6 - network {{ lo['addr'] }}/128 + network {{ prefix | ip }}/128 exit-address-family {% endif %} {% endfor %} {% endblock bgp_init %} {% block vlan_advertisement %} -{% for vlan_interface in minigraph_vlan_interfaces %} -{% if vlan_interface['addr'] | ipv4 %} - network {{ vlan_interface['subnet'] }} -{% elif vlan_interface['addr'] | ipv6 %} +{% for (name, prefix) in VLAN_INTERFACE %} +{% if prefix | ipv4 %} + network {{ prefix }} +{% elif prefix | ipv6 %} address-family ipv6 - network {{ vlan_interface['subnet'] }} + network {{ prefix }} exit-address-family {% endif %} {% endfor %} @@ -51,7 +51,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if bgp_session['asn'] != 0 %} neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} {% if neighbor_addr | ipv4 %} diff --git a/dockers/docker-fpm-frr/config.sh b/dockers/docker-fpm-frr/config.sh index 0636a6dc413c..ef7a13a214f4 100755 --- a/dockers/docker-fpm-frr/config.sh +++ b/dockers/docker-fpm-frr/config.sh @@ -1,14 +1,14 @@ #!/bin/bash mkdir -p /etc/frr -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/bgpd.conf.j2 >/etc/frr/bgpd.conf -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/zebra.conf.j2 >/etc/frr/zebra.conf +sonic-cfggen -d -t /usr/share/sonic/templates/bgpd.conf.j2 >/etc/frr/bgpd.conf +sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 >/etc/frr/zebra.conf -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/isolate.j2 >/usr/sbin/bgp-isolate +sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 >/usr/sbin/bgp-isolate chown root:root /usr/sbin/bgp-isolate chmod 0755 /usr/sbin/bgp-isolate -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/unisolate.j2 >/usr/sbin/bgp-unisolate +sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 >/usr/sbin/bgp-unisolate chown root:root /usr/sbin/bgp-unisolate chmod 0755 /usr/sbin/bgp-unisolate diff --git a/dockers/docker-fpm-frr/zebra.conf.j2 b/dockers/docker-fpm-frr/zebra.conf.j2 index 1ce06eecd2d9..8b967f98671c 100644 --- a/dockers/docker-fpm-frr/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/zebra.conf.j2 @@ -1,26 +1,26 @@ ! {% block banner %} ! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== -! generated by templates/quagga/zebra.conf.j2 using minigraph_facts.py +! generated by templates/quagga/zebra.conf.j2 using config DB data ! file: zebra.conf ! {% endblock banner %} ! {% block sys_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra enable password zebra {% endblock sys_init %} ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for interface in minigraph_interfaces %} -interface {{ interface['attachto'] }} +{% for (name, prefix) in INTERFACE %} +interface {{ name }} link-detect ! {% endfor %} -{% for interface in minigraph_portchannels.keys() %} -interface {{ interface }} +{% for pc in PORTCHANNEL %} +interface {{ pc }} link-detect ! {% endfor %} @@ -28,26 +28,34 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 {{ minigraph_mgmt_interface['gwaddr'] }} 200 +{% for (name, prefix) in MGMT_INTERFACE %} +{% if prefix | ipv4 %} +ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 +{% endif %} +{% endfor %} {% endblock default_route %} ! {% block source_loopback %} -! Set ip source to loopback for bgp learned routes -route-map RM_SET_SRC permit 10 - set src {{ minigraph_lo_interfaces[0]['addr'] }} -! +{% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} -{% if minigraph_lo_interfaces is defined %} -{% for interface in minigraph_lo_interfaces %} -{% if interface['addr'] is defined and interface['addr']|ipv6 %} -{% if lo_ipv6_addrs.append(interface['addr']) %} +{% if LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% if prefix | ipv6 %} +{% if lo_ipv6_addrs.append(prefix) %} +{% endif %} +{% else %} +{% if lo_ipv4_addrs.append(prefix) %} {% endif %} {% endif %} {% endfor %} {% endif %} +! Set ip source to loopback for bgp learned routes +route-map RM_SET_SRC permit 10 + set src {{ lo_ipv4_addrs[0] | ip }} +! {% if lo_ipv6_addrs|length > 0 %} route-map RM_SET_SRC6 permit 10 - set src {{ lo_ipv6_addrs[0] }} + set src {{ lo_ipv6_addrs[0] | ip }} ! {% endif %} ip protocol bgp route-map RM_SET_SRC diff --git a/dockers/docker-fpm-gobgp/gobgpd.conf.j2 b/dockers/docker-fpm-gobgp/gobgpd.conf.j2 index c6ec7a4fd166..c51c10563b59 100644 --- a/dockers/docker-fpm-gobgp/gobgpd.conf.j2 +++ b/dockers/docker-fpm-gobgp/gobgpd.conf.j2 @@ -1,6 +1,6 @@ [global.config] as = {{ DEVICE_METADATA['localhost']['bgp_asn'] }} - router-id = "{{ minigraph_lo_interfaces[0]['addr'] }}" + router-id = "{{ LOOPBACK_INTERFACE.keys()[0][1] }}" {% for neighbor_addr, bgp_session in BGP_NEIGHBOR.iteritems() %} {% if bgp_session['asn'] != 0 %} [[neighbors]] diff --git a/dockers/docker-fpm-gobgp/start.sh b/dockers/docker-fpm-gobgp/start.sh index 636fceea0cbd..83afbda4f736 100755 --- a/dockers/docker-fpm-gobgp/start.sh +++ b/dockers/docker-fpm-gobgp/start.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash mkdir -p /etc/quagga -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/gobgpd.conf.j2 > /etc/gobgp/gobgpd.conf -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/quagga/zebra.conf +sonic-cfggen -d -t /usr/share/sonic/templates/gobgpd.conf.j2 > /etc/gobgp/gobgpd.conf +sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/quagga/zebra.conf -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate +sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate chown root:root /usr/sbin/bgp-isolate chmod 0755 /usr/sbin/bgp-isolate -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate +sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate chown root:root /usr/sbin/bgp-unisolate chmod 0755 /usr/sbin/bgp-unisolate diff --git a/dockers/docker-fpm-gobgp/zebra.conf.j2 b/dockers/docker-fpm-gobgp/zebra.conf.j2 index 1ce06eecd2d9..8b967f98671c 100644 --- a/dockers/docker-fpm-gobgp/zebra.conf.j2 +++ b/dockers/docker-fpm-gobgp/zebra.conf.j2 @@ -1,26 +1,26 @@ ! {% block banner %} ! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== -! generated by templates/quagga/zebra.conf.j2 using minigraph_facts.py +! generated by templates/quagga/zebra.conf.j2 using config DB data ! file: zebra.conf ! {% endblock banner %} ! {% block sys_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra enable password zebra {% endblock sys_init %} ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for interface in minigraph_interfaces %} -interface {{ interface['attachto'] }} +{% for (name, prefix) in INTERFACE %} +interface {{ name }} link-detect ! {% endfor %} -{% for interface in minigraph_portchannels.keys() %} -interface {{ interface }} +{% for pc in PORTCHANNEL %} +interface {{ pc }} link-detect ! {% endfor %} @@ -28,26 +28,34 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 {{ minigraph_mgmt_interface['gwaddr'] }} 200 +{% for (name, prefix) in MGMT_INTERFACE %} +{% if prefix | ipv4 %} +ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 +{% endif %} +{% endfor %} {% endblock default_route %} ! {% block source_loopback %} -! Set ip source to loopback for bgp learned routes -route-map RM_SET_SRC permit 10 - set src {{ minigraph_lo_interfaces[0]['addr'] }} -! +{% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} -{% if minigraph_lo_interfaces is defined %} -{% for interface in minigraph_lo_interfaces %} -{% if interface['addr'] is defined and interface['addr']|ipv6 %} -{% if lo_ipv6_addrs.append(interface['addr']) %} +{% if LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% if prefix | ipv6 %} +{% if lo_ipv6_addrs.append(prefix) %} +{% endif %} +{% else %} +{% if lo_ipv4_addrs.append(prefix) %} {% endif %} {% endif %} {% endfor %} {% endif %} +! Set ip source to loopback for bgp learned routes +route-map RM_SET_SRC permit 10 + set src {{ lo_ipv4_addrs[0] | ip }} +! {% if lo_ipv6_addrs|length > 0 %} route-map RM_SET_SRC6 permit 10 - set src {{ lo_ipv6_addrs[0] }} + set src {{ lo_ipv6_addrs[0] | ip }} ! {% endif %} ip protocol bgp route-map RM_SET_SRC diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index 02cf40fa8b47..295cb2563aff 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -1,13 +1,13 @@ ! {% block banner %} ! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== -! generated by templates/quagga/bgpd.conf.j2 using minigraph_facts.py +! generated by templates/quagga/bgpd.conf.j2 with config DB data ! file: bgpd.conf ! {% endblock banner %} ! {% block system_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra log syslog informational log facility local4 @@ -28,30 +28,34 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} bgp bestpath as-path multipath-relax no bgp default ipv4-unicast {# Advertise graceful restart capability for ToR #} -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} bgp graceful-restart {% endif %} -{# TODO: use lo[0] for backward compatibility, will revisit the case with multiple lo interfaces #} - bgp router-id {{ minigraph_lo_interfaces[0]['addr'] }} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{# TODO: use v4 lo for backward compatibility, will revisit the case with multiple lo interfaces #} +{% if prefix | ipv4 %} + bgp router-id {{ prefix | ip }} +{% endif %} +{% endfor %} {# advertise loopback #} -{% for lo in minigraph_lo_interfaces %} -{% if lo['addr'] | ipv4 %} - network {{ lo['addr'] }}/32 -{% elif lo['addr'] | ipv6 %} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% if prefix | ipv4 %} + network {{ prefix | ip }}/32 +{% elif prefix | ipv6 %} address-family ipv6 - network {{ lo['addr'] }}/128 + network {{ prefix | ip }}/128 exit-address-family {% endif %} {% endfor %} {% endblock bgp_init %} {% endif %} {% block vlan_advertisement %} -{% for vlan_interface in minigraph_vlan_interfaces %} -{% if vlan_interface['addr'] | ipv4 %} - network {{ vlan_interface['subnet'] }} -{% elif vlan_interface['addr'] | ipv6 %} +{% for (name, prefix) in VLAN_INTERFACE %} +{% if prefix | ipv4 %} + network {{ prefix }} +{% elif prefix | ipv6 %} address-family ipv6 - network {{ vlan_interface['subnet'] }} + network {{ prefix }} exit-address-family {% endif %} {% endfor %} @@ -66,7 +70,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endif %} {% if neighbor_addr | ipv4 %} address-family ipv4 -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} neighbor {{ neighbor_addr }} activate @@ -75,7 +79,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endif %} {% if neighbor_addr | ipv6 %} address-family ipv6 -{% if minigraph_devices[inventory_hostname]['type'] == 'ToRRouter' %} +{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} neighbor {{ neighbor_addr }} allowas-in 1 {% endif %} neighbor {{ neighbor_addr }} activate @@ -86,6 +90,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endfor %} {% endblock bgp_sessions %} {% block bgp_peers_with_range %} +{% if BGP_PEER_RANGE %} {% for bgp_peer in BGP_PEER_RANGE.values() %} neighbor {{ bgp_peer['name'] }} peer-group neighbor {{ bgp_peer['name'] }} passive @@ -107,6 +112,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} maximum-paths 64 exit-address-family {% endfor %} +{% endif %} {% endblock bgp_peers_with_range %} ! {% if DEVICE_METADATA['localhost'].has_key('bgp_asn') %} diff --git a/dockers/docker-fpm-quagga/zebra.conf.j2 b/dockers/docker-fpm-quagga/zebra.conf.j2 index 1ce06eecd2d9..8b967f98671c 100644 --- a/dockers/docker-fpm-quagga/zebra.conf.j2 +++ b/dockers/docker-fpm-quagga/zebra.conf.j2 @@ -1,26 +1,26 @@ ! {% block banner %} ! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== -! generated by templates/quagga/zebra.conf.j2 using minigraph_facts.py +! generated by templates/quagga/zebra.conf.j2 using config DB data ! file: zebra.conf ! {% endblock banner %} ! {% block sys_init %} -hostname {{ inventory_hostname }} +hostname {{ DEVICE_METADATA['localhost']['hostname'] }} password zebra enable password zebra {% endblock sys_init %} ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for interface in minigraph_interfaces %} -interface {{ interface['attachto'] }} +{% for (name, prefix) in INTERFACE %} +interface {{ name }} link-detect ! {% endfor %} -{% for interface in minigraph_portchannels.keys() %} -interface {{ interface }} +{% for pc in PORTCHANNEL %} +interface {{ pc }} link-detect ! {% endfor %} @@ -28,26 +28,34 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 {{ minigraph_mgmt_interface['gwaddr'] }} 200 +{% for (name, prefix) in MGMT_INTERFACE %} +{% if prefix | ipv4 %} +ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 +{% endif %} +{% endfor %} {% endblock default_route %} ! {% block source_loopback %} -! Set ip source to loopback for bgp learned routes -route-map RM_SET_SRC permit 10 - set src {{ minigraph_lo_interfaces[0]['addr'] }} -! +{% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} -{% if minigraph_lo_interfaces is defined %} -{% for interface in minigraph_lo_interfaces %} -{% if interface['addr'] is defined and interface['addr']|ipv6 %} -{% if lo_ipv6_addrs.append(interface['addr']) %} +{% if LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% if prefix | ipv6 %} +{% if lo_ipv6_addrs.append(prefix) %} +{% endif %} +{% else %} +{% if lo_ipv4_addrs.append(prefix) %} {% endif %} {% endif %} {% endfor %} {% endif %} +! Set ip source to loopback for bgp learned routes +route-map RM_SET_SRC permit 10 + set src {{ lo_ipv4_addrs[0] | ip }} +! {% if lo_ipv6_addrs|length > 0 %} route-map RM_SET_SRC6 permit 10 - set src {{ lo_ipv6_addrs[0] }} + set src {{ lo_ipv6_addrs[0] | ip }} ! {% endif %} ip protocol bgp route-map RM_SET_SRC diff --git a/dockers/docker-lldp-sv2/lldpd.conf.j2 b/dockers/docker-lldp-sv2/lldpd.conf.j2 index 4cfe48065e11..ffbf7e6993e9 100644 --- a/dockers/docker-lldp-sv2/lldpd.conf.j2 +++ b/dockers/docker-lldp-sv2/lldpd.conf.j2 @@ -1,5 +1,3 @@ -{% for member in minigraph_ports.keys() %} -{% if member in minigraph_neighbors %} -configure ports {{ member }} lldp portidsubtype local {{ minigraph_ports[member]['alias'] }} description {{ minigraph_neighbors[member]['name'] }}:{{ minigraph_neighbors[member]['port'] }} -{% endif %} +{% for neighbor in DEVICE_NEIGHBOR %} +configure ports {{ DEVICE_NEIGHBOR[neighbor]['local_port'] }} lldp portidsubtype local {{ PORT[DEVICE_NEIGHBOR[neighbor]['local_port']]['alias'] }} description {{ neighbor }}:{{ DEVICE_NEIGHBOR[neighbor]['port'] }} {% endfor %} diff --git a/dockers/docker-lldp-sv2/start.sh b/dockers/docker-lldp-sv2/start.sh index 63c8d32c34e6..3a765c6f5482 100755 --- a/dockers/docker-lldp-sv2/start.sh +++ b/dockers/docker-lldp-sv2/start.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/lldpd.conf.j2 > /etc/lldpd.conf +sonic-cfggen -d -t /usr/share/sonic/templates/lldpd.conf.j2 > /etc/lldpd.conf mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status diff --git a/dockers/docker-orchagent/arp_update b/dockers/docker-orchagent/arp_update index 8291818e50fb..cfd87c1dc51f 100755 --- a/dockers/docker-orchagent/arp_update +++ b/dockers/docker-orchagent/arp_update @@ -4,7 +4,7 @@ # arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh # the neighbors state. -VLAN=`sonic-cfggen -m /etc/sonic/minigraph.xml -v 'minigraph_vlans.keys() | join(" ")'` +VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` for vlan in $VLAN; do # generate a list of arping commands: # arping -q -w 0 -c 1 -i ; diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index 6ffafd297496..2f411b088e6d 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -2,8 +2,8 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "src_ip":"{{ minigraph_lo_interfaces[0]['addr'] }}", - "dst_ip":"{{ minigraph_lo_interfaces[0]['addr'] }}", + "src_ip":"{{ LOOPBACK_INTERFACE.keys()[0][1] | ip }}", + "dst_ip":"{{ LOOPBACK_INTERFACE.keys()[0][1] | ip }}", {% if onie_switch_asic == "mlnx" %} "dscp_mode":"uniform", "ecn_mode":"standard", diff --git a/dockers/docker-orchagent/mirror.json.j2 b/dockers/docker-orchagent/mirror.json.j2 index 4aa710cfcb71..3a3fc6eed079 100644 --- a/dockers/docker-orchagent/mirror.json.j2 +++ b/dockers/docker-orchagent/mirror.json.j2 @@ -1,9 +1,10 @@ [ -{% if erspan_dst %} +{% if MIRROR_SESSION %} +{% for session in MIRROR_SESSION %} { - "MIRROR_SESSION_TABLE:everflow": { - "src_ip": "{{ minigraph_lo_interfaces[0]['addr'] }}", - "dst_ip": "{{ erspan_dst[0] }}", + "MIRROR_SESSION_TABLE:{{session}}": { + "src_ip": "{{ MIRROR_SESSION[session]['src_ip'] }}", + "dst_ip": "{{ MIRROR_SESSION[session]['dst_ip'] }}", {% if onie_switch_asic == "mlnx" %} "gre_type": "0x6558", "queue": "1", @@ -15,7 +16,9 @@ "ttl": "255" }, "OP": "SET" - } + }{% if not loop.last %},{% endif %} + +{% endfor %} {% endif %} ] diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 328ce8fc053d..7103afcb81e9 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -2,7 +2,7 @@ # Export platform information. Required to be able to write # vendor specific code. -export platform=`sonic-cfggen -m /etc/sonic/minigraph.xml -v onie_switch_asic` +export platform=`sonic-cfggen -v onie_switch_asic` ASIC=`sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type` diff --git a/dockers/docker-orchagent/ports.json.j2 b/dockers/docker-orchagent/ports.json.j2 index f59ee993eead..48be831025f8 100644 --- a/dockers/docker-orchagent/ports.json.j2 +++ b/dockers/docker-orchagent/ports.json.j2 @@ -1,11 +1,15 @@ [ -{% for interface in ethernet_interfaces %} +{% if PORT %} +{% for port in PORT %} +{% if PORT[port].has_key('speed') %} { - "PORT_TABLE:{{ interface['name'] }}": { - "speed": "{{ interface['speed'] }}" + "PORT_TABLE:{{ port }}": { + "speed": "{{ PORT[port]['speed'] }}" }, "OP": "SET" }{% if not loop.last %},{% endif %} +{% endif %} {% endfor %} +{% endif %} ] diff --git a/dockers/docker-orchagent/start.sh b/dockers/docker-orchagent/start.sh index 5f961a8bd294..1eba99192b21 100755 --- a/dockers/docker-orchagent/start.sh +++ b/dockers/docker-orchagent/start.sh @@ -2,11 +2,11 @@ mkdir -p /etc/swss/config.d/ -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/mirror.json.j2 > /etc/swss/config.d/mirror.json -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ports.json.j2 > /etc/swss/config.d/ports.json +sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json +sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/mirror.json.j2 > /etc/swss/config.d/mirror.json +sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/ports.json.j2 > /etc/swss/config.d/ports.json -export platform=`sonic-cfggen -m /etc/sonic/minigraph.xml -v platform` +export platform=`sonic-cfggen -v platform` rm -f /var/run/rsyslogd.pid @@ -34,7 +34,7 @@ supervisorctl start neighsyncd supervisorctl start swssconfig # Start arp_update when VLAN exists -VLAN=`sonic-cfggen -m /etc/sonic/minigraph.xml -v 'minigraph_vlans.keys() | join(" ")'` +VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` if [ "$VLAN" != "" ]; then supervisorctl start arp_update fi diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 2530aca06bb3..c4043bd86de7 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -36,7 +36,7 @@ function fast_reboot { # Restore FDB and ARP table ASAP fast_reboot -HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -v minigraph_hwsku` +HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -d -v DEVICE_METADATA["localhost"]["hwsku"]` SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json ports.json " diff --git a/dockers/docker-snmp-sv2/alias_map.j2 b/dockers/docker-snmp-sv2/alias_map.j2 index 0f91fa26eabe..bd68353a91e3 100644 --- a/dockers/docker-snmp-sv2/alias_map.j2 +++ b/dockers/docker-snmp-sv2/alias_map.j2 @@ -1,5 +1,5 @@ { -{% for member in minigraph_ports.keys() %} - "{{member}}": "{{minigraph_ports[member]['alias']}}"{% if not loop.last %},{% endif %} +{% for member in PORT %} + "{{member}}": "{{PORT[member]['alias']}}"{% if not loop.last %},{% endif %} {% endfor %} } diff --git a/dockers/docker-snmp-sv2/snmpd.conf.j2 b/dockers/docker-snmp-sv2/snmpd.conf.j2 index c5d299af05ef..246924cfd387 100644 --- a/dockers/docker-snmp-sv2/snmpd.conf.j2 +++ b/dockers/docker-snmp-sv2/snmpd.conf.j2 @@ -13,18 +13,22 @@ # AGENT BEHAVIOUR # -{% if minigraph_mgmt_interface.addr | ipv4 %} +{% if MGMT_INTERFACE %} # Listen for connections on localhost, loopback ip and mgmt (eth0) ip agentAddress udp:127.0.0.1:161 -agentAddress udp:{{ minigraph_mgmt_interface.addr }}:161 -{% for minigraph_lo_interface in minigraph_lo_interfaces %} +{% for (name, prefix) in MGMT_INTERFACE %} +{% if prefix | ipv4 %} +agentAddress udp:{{ prefix | ip }}:161 +{% endif %} +{% endfor %} # TODO: only support ipv4 lo addresses, add ipv6 support later -{% if minigraph_lo_interface.addr | ipv4 %} -agentAddress udp:{{ minigraph_lo_interface.addr }}:161 +{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% if prefix | ipv4 %} +agentAddress udp:{{ prefix | ip }}:161 {% endif %} {% endfor %} {% else %} -# Listen on all addresses as mgmt ip not specified in minigraph +# Listen on all addresses as mgmt ip not specified agentAddress udp:161 {% endif %} diff --git a/dockers/docker-snmp-sv2/start.sh b/dockers/docker-snmp-sv2/start.sh index ffbe8f196722..201239b1e7db 100755 --- a/dockers/docker-snmp-sv2/start.sh +++ b/dockers/docker-snmp-sv2/start.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash mkdir -p /etc/ssw -sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sysDescription.j2 > /etc/ssw/sysDescription +sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sysDescription.j2 > /etc/ssw/sysDescription mkdir -p /etc/snmp -sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/snmp.yml -t /usr/share/sonic/templates/snmpd.conf.j2 > /etc/snmp/snmpd.conf -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/alias_map.j2 > /etc/snmp/alias_map.json +sonic-cfggen -d -y /etc/sonic/snmp.yml -t /usr/share/sonic/templates/snmpd.conf.j2 > /etc/snmp/snmpd.conf +sonic-cfggen -d -t /usr/share/sonic/templates/alias_map.j2 > /etc/snmp/alias_map.json mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status diff --git a/dockers/docker-snmp-sv2/sysDescription.j2 b/dockers/docker-snmp-sv2/sysDescription.j2 index 648ed161046e..207a8bf7de9a 100644 --- a/dockers/docker-snmp-sv2/sysDescription.j2 +++ b/dockers/docker-snmp-sv2/sysDescription.j2 @@ -1 +1 @@ -SONiC Software Version: SONiC.{{ build_version }} - HwSku: {{ minigraph_hwsku }} - Distribution: Debian {{ debian_version }} - Kernel: {{ kernel_version }} +SONiC Software Version: SONiC.{{ build_version }} - HwSku: {{ DEVICE_METADATA['localhost']['hwsku'] }} - Distribution: Debian {{ debian_version }} - Kernel: {{ kernel_version }} diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index fe4bfe1c584f..6b0a3d785894 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -15,8 +15,8 @@ if [ "$SONIC_ASIC_TYPE" == "mellanox" -o "$SONIC_ASIC_TYPE" == "centec" ]; then MAC_ADDRESS=$(python -c "print '$MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC fi -for pc in `sonic-cfggen -m /etc/sonic/minigraph.xml -v "minigraph_portchannels.keys() | join(' ')"`; do - sonic-cfggen -m /etc/sonic/minigraph.xml -a '{"pc":"'$pc'","hwaddr":"'$MAC_ADDRESS'"}' -t /usr/share/sonic/templates/teamd.j2 > $TEAMD_CONF_PATH/$pc.conf +for pc in `sonic-cfggen -d -v "PORTCHANNEL.keys() | join(' ') if PORTCHANNEL"`; do + sonic-cfggen -d -a '{"pc":"'$pc'","hwaddr":"'$MAC_ADDRESS'"}' -t /usr/share/sonic/templates/teamd.j2 > $TEAMD_CONF_PATH/$pc.conf done mkdir -p /var/sonic diff --git a/dockers/docker-teamd/teamd.j2 b/dockers/docker-teamd/teamd.j2 index d6693719f1ad..d9ea1b790f89 100644 --- a/dockers/docker-teamd/teamd.j2 +++ b/dockers/docker-teamd/teamd.j2 @@ -5,14 +5,14 @@ "name": "lacp", "active": true, {# Use 75% links upperbound as min-links #} - "min_ports": {{ (minigraph_portchannels[pc]['members'] | length * 0.75) | round(0, 'ceil') | int }}, + "min_ports": {{ (PORTCHANNEL[pc]['members'] | length * 0.75) | round(0, 'ceil') | int }}, "tx_hash": ["eth", "ipv4", "ipv6"] }, "link_watch": { "name": "ethtool" }, "ports": { -{% for member in minigraph_portchannels[pc]['members'] %} +{% for member in PORTCHANNEL[pc]['members'] %} "{{ member }}": {}{% if not loop.last %},{% endif %} {% endfor %} diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 3ae3acaed33b..042db764df97 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -2,7 +2,9 @@ # Obtain our platform and HWSKU as we will mount directories with these names in each docker PLATFORM=`sonic-cfggen -v platform` -HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -v minigraph_hwsku` +{%- if docker_container_name != "database" %} +HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'` +{%- endif %} start() { docker inspect --type container {{docker_container_name}} &>/dev/null @@ -16,9 +18,19 @@ start() { {%- endif %} -v /var/run/redis:/var/run/redis:rw \ -v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \ +{%- if docker_container_name != "database" %} -v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \ +{%- endif %} --name={{docker_container_name}} {{docker_image_name}}:latest fi +{%- if docker_container_name == "database" %} + while true; do + if [[ "$(docker exec -i database redis-cli ping)" =~ PONG.* ]]; then + break + fi + sleep 1 + done +{%- endif %} } attach() { diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index ed6b852f18f9..af922530d8a2 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -5,6 +5,7 @@ Requires=database.service Requires=opennsl-modules-3.16.0-4-amd64.service {% endif %} After=database.service +After=interfaces-config.service {% if sonic_asic_platform == 'broadcom' %} After=opennsl-modules-3.16.0-4-amd64.service {% endif %} diff --git a/files/image_config/interfaces/interfaces-config.service b/files/image_config/interfaces/interfaces-config.service index 0cc7f2981505..86706da22518 100644 --- a/files/image_config/interfaces/interfaces-config.service +++ b/files/image_config/interfaces/interfaces-config.service @@ -1,6 +1,7 @@ [Unit] Description=Update interfaces configuration -Before=database.service +Requires=database.service +After=database.service [Service] Type=oneshot diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index d2b42051cc8d..400b89a594c7 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -1,6 +1,6 @@ #!/bin/bash -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/interfaces.j2 >/etc/network/interfaces +sonic-cfggen -d -t /usr/share/sonic/templates/interfaces.j2 >/etc/network/interfaces [ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid service networking restart ifdown lo && ifup lo diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index 425badf7f21f..f96c0740c572 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -10,34 +10,36 @@ auto lo iface lo inet loopback # Use command 'ip addr list dev lo' to check all addresses -{% for minigraph_lo_interface in minigraph_lo_interfaces %} -iface lo {{ 'inet' if minigraph_lo_interface['addr'] | ipv4 else 'inet6' }} static - address {{ minigraph_lo_interface['addr'] }} - netmask {{ minigraph_lo_interface['mask'] }} +{% for (name, prefix) in LOOPBACK_INTERFACE %} +iface lo {{ 'inet' if prefix | ipv4 else 'inet6' }} static + address {{ prefix | ip }} + netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # {% endfor %} {% endblock loopback %} {% block mgmt_interface %} # The management network interface auto eth0 -{% if minigraph_mgmt_interface['addr'] %} -iface eth0 inet static - address {{ minigraph_mgmt_interface['addr'] }} - netmask {{ minigraph_mgmt_interface['mask'] }} +{% if MGMT_INTERFACE %} +{% for (name, prefix) in MGMT_INTERFACE %} +iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static + address {{ prefix | ip }} + netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} ########## management network policy routing rules # management port up rules - up ip route add default via {{ minigraph_mgmt_interface['gwaddr'] }} dev eth0 table default - up ip rule add from {{ minigraph_mgmt_interface['addr'] }}/32 table default -{% for prefix in forced_mgmt_routes %} - up ip rule add to {{ prefix }} table default + up ip route add default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table default + up ip rule add from {{ prefix | ip }}/32 table default +{% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} + up ip rule add to {{ route }} table default {% endfor %} # management port down rules - down ip route delete default via {{ minigraph_mgmt_interface['gwaddr'] }} dev eth0 table default - down ip rule delete from {{ minigraph_mgmt_interface['addr'] }}/32 table default -{% for prefix in forced_mgmt_routes %} - down ip rule delete to {{ prefix }} table default + down ip route delete default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table default + down ip rule delete from {{ prefix | ip }}/32 table default +{% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} + down ip rule delete to {{ route }} table default {% endfor %} {# TODO: COPP policy type rules #} +{% endfor %} {% else %} iface eth0 inet dhcp {% endif %} @@ -45,19 +47,18 @@ iface eth0 inet dhcp {% endblock mgmt_interface %} {% block front_panel_interfaces %} # The switch front panel interfaces -{% for interface in minigraph_interfaces %} -allow-hotplug {{ interface['attachto'] }} -iface {{ interface['attachto'] }} {{ 'inet' if interface['addr'] | ipv4 else 'inet6' }} static +{% for (name, prefix) in INTERFACE %} +allow-hotplug {{ name }} +iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static mtu 9216 - address {{ interface['addr'] }} - netmask {{ interface['mask'] }} + address {{ prefix | ip }} + netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # {% endfor %} -{% if minigraph_vlans.keys() | length %} +{% if VLAN %} # "|| true" is added to suppress the error when interface is already a member of VLAN -{% endif %} -{% for vlan in minigraph_vlans.keys()|sort %} -{% for member in minigraph_vlans[vlan]['members'] %} +{% for vlan in VLAN.keys()|sort %} +{% for member in VLAN[vlan]['members'] %} allow-hotplug {{ member }} iface {{ member }} inet manual pre-up ifconfig {{ member }} up mtu 9216 @@ -66,12 +67,12 @@ iface {{ member }} inet manual # {% endfor %} {% endfor %} -{% if minigraph_portchannels.keys() | length %} +{% endif %} +{% if PORTCHANNEL %} # "|| true" is added to suppress the error when interface is already a member of LAG # "ip link show | grep -q master" is added to ensure interface is enslaved -{% endif %} -{% for pc in minigraph_portchannels.keys()|sort %} -{% for member in minigraph_portchannels[pc]['members'] %} +{% for pc in PORTCHANNEL.keys()|sort %} +{% for member in PORTCHANNEL[pc]['members'] %} allow-hotplug {{ member }} iface {{ member }} inet manual pre-up teamdctl {{ pc }} port add {{ member }} || true @@ -80,30 +81,31 @@ iface {{ member }} inet manual # {% endfor %} {% endfor %} +{% endif %} {% endblock front_panel_interfaces %} -{% if minigraph_vlans.keys() | length %} {% block vlan_interfaces %} +{% if VLAN_INTERFACE %} # Vlan interfaces -{% for vlan_interface in minigraph_vlan_interfaces %} -auto {{ vlan_interface['attachto'] }} -iface {{ vlan_interface['attachto'] }} {{ 'inet' if vlan_interface['addr'] | ipv4 else 'inet6' }} static +{% for (name, prefix) in VLAN_INTERFACE.keys() | sort %} +auto {{ name }} +iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static bridge_ports none - address {{ vlan_interface['addr'] }} - netmask {{ vlan_interface['mask'] }} + address {{ prefix | ip }} + netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} {% endfor %} # -{% endblock vlan_interfaces %} {% endif %} -{% if minigraph_portchannels.keys() | length %} +{% endblock vlan_interfaces %} {% block pc_interfaces %} +{% if PORTCHANNEL_INTERFACE %} # Portchannel interfaces -{% for pc_interface in minigraph_portchannel_interfaces %} -allow-hotplug {{ pc_interface['attachto'] }} -iface {{ pc_interface['attachto'] }} {{ 'inet' if pc_interface['addr'] | ipv4 else 'inet6' }} static +{% for (name, prefix) in PORTCHANNEL_INTERFACE.keys() | sort %} +allow-hotplug {{ name }} +iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static mtu 9216 - address {{ pc_interface['addr'] }} - netmask {{ pc_interface['mask'] }} + address {{ prefix | ip }} + netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # {% endfor %} -{% endblock pc_interfaces %} {% endif %} +{% endblock pc_interfaces %} diff --git a/files/image_config/ntp/ntp-config.service b/files/image_config/ntp/ntp-config.service index 948e7f4953c8..05e6211b9782 100644 --- a/files/image_config/ntp/ntp-config.service +++ b/files/image_config/ntp/ntp-config.service @@ -1,6 +1,8 @@ [Unit] Description=Update NTP configuration Before=ntp.service +Requires=database.service +After=database.service [Service] Type=oneshot diff --git a/files/image_config/ntp/ntp-config.sh b/files/image_config/ntp/ntp-config.sh index 2465058ba021..7c79a16c0ef3 100755 --- a/files/image_config/ntp/ntp-config.sh +++ b/files/image_config/ntp/ntp-config.sh @@ -1,3 +1,3 @@ #!/bin/bash -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf +sonic-cfggen -d -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf diff --git a/files/image_config/ntp/ntp.conf.j2 b/files/image_config/ntp/ntp.conf.j2 index 3ae0c1804e52..ae72820339be 100644 --- a/files/image_config/ntp/ntp.conf.j2 +++ b/files/image_config/ntp/ntp.conf.j2 @@ -23,13 +23,15 @@ filegen clockstats file clockstats type day enable # pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will # pick a different set every time it starts up. Please consider joining the # pool: -{% for ntp_server in ntp_servers %} +{% for ntp_server in NTP_SERVER %} server {{ ntp_server }} iburst {% endfor %} #only listen on localhost and eth0 ips (default is to listen on all ip addresses) interface ignore wildcard -interface listen {{ minigraph_mgmt_interface.addr }} +{% for (mgmt_intf, mgmt_prefix) in MGMT_INTERFACE %} +interface listen {{ mgmt_prefix | ip }} +{% endfor %} interface listen 127.0.0.1 # Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for diff --git a/files/image_config/rsyslog/rsyslog-config.service b/files/image_config/rsyslog/rsyslog-config.service index be3c209e7560..e013b992030d 100644 --- a/files/image_config/rsyslog/rsyslog-config.service +++ b/files/image_config/rsyslog/rsyslog-config.service @@ -1,5 +1,7 @@ [Unit] Description=Update rsyslog configuration +Requires=database.service +After=database.service [Service] Type=oneshot diff --git a/files/image_config/rsyslog/rsyslog-config.sh b/files/image_config/rsyslog/rsyslog-config.sh index 06a4934a4be5..c8ba7b99453c 100755 --- a/files/image_config/rsyslog/rsyslog-config.sh +++ b/files/image_config/rsyslog/rsyslog-config.sh @@ -1,4 +1,4 @@ #!/bin/bash -sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/rsyslog.conf.j2 >/etc/rsyslog.conf +sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog.conf.j2 >/etc/rsyslog.conf systemctl restart rsyslog diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2 index 264ddd8dd7bf..063f119f6bdd 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -41,7 +41,7 @@ $template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HO $ActionFileDefaultTemplate SONiCFileFormat #Set remote syslog server -{% for server in syslog_servers %} +{% for server in SYSLOG_SERVER %} *.* @{{ server }}:514;SONiCFileFormat {% endfor %} diff --git a/files/image_config/updategraph/updategraph.service b/files/image_config/updategraph/updategraph.service index ba0b5dcb85e2..c66e9be75702 100644 --- a/files/image_config/updategraph/updategraph.service +++ b/files/image_config/updategraph/updategraph.service @@ -1,8 +1,6 @@ [Unit] Description=download minigraph from graph service -Before=ntp-config.service -Before=rsyslog-config.service -Before=interfaces-config.service +Before=database.service [Service] Type=oneshot diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 1877e552858e..565a1a43d060 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -91,18 +91,20 @@ def parse_png(png, hname): if enddevice == hname: if port_alias_map.has_key(endport): endport = port_alias_map[endport] - neighbors[endport] = {'name': startdevice, 'port': startport} + neighbors[startdevice] = {'local_port': endport, 'port': startport} else: if port_alias_map.has_key(startport): startport = port_alias_map[startport] - neighbors[startport] = {'name': enddevice, 'port': endport} + neighbors[enddevice] = {'local_port': startport, 'port': endport} if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "Device"))): (lo_prefix, mgmt_prefix, name, hwsku, d_type) = parse_device(device) - lo_addr = None if not lo_prefix else lo_prefix.split('/')[0] - mgmt_addr = None if not mgmt_prefix else mgmt_prefix.split('/')[0] - devices[name] = {'lo_addr': lo_addr, 'type': d_type, 'mgmt_addr': mgmt_addr, 'hwsku': hwsku} + device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku } + if neighbors.has_key(name): + neighbors[name].update(device_data) + else: + devices[name] = device_data if child.tag == str(QName(ns, "DeviceInterfaceLinks")): for if_link in child.findall(str(QName(ns, 'DeviceLinkBase'))): @@ -131,71 +133,28 @@ def parse_dpg(dpg, hname): continue ipintfs = child.find(str(QName(ns, "IPInterfaces"))) - intfs = [] + intfs = {} for ipintf in ipintfs.findall(str(QName(ns, "IPInterface"))): intfalias = ipintf.find(str(QName(ns, "AttachTo"))).text intfname = port_alias_map.get(intfalias, intfalias) ipprefix = ipintf.find(str(QName(ns, "Prefix"))).text - ipn = ipaddress.IPNetwork(ipprefix) - ipaddr = ipn.ip - prefix_len = ipn.prefixlen - addr_bits = ipn.max_prefixlen - subnet = ipaddress.IPNetwork(str(ipn.network) + '/' + str(prefix_len)) - ipmask = ipn.netmask - - intf = {'addr': ipaddr, 'subnet': subnet} - if isinstance(ipn, ipaddress.IPv4Network): - intf['mask'] = ipmask - else: - intf['mask'] = str(prefix_len) - intf.update({'attachto': intfname, 'prefixlen': int(prefix_len)}) - - # TODO: remove peer_addr after dependency removed - ipaddr_val = int(ipn.ip) - peer_addr_val = None - if int(prefix_len) == addr_bits - 2: - if ipaddr_val & 0x3 == 1: - peer_addr_val = ipaddr_val + 1 - else: - peer_addr_val = ipaddr_val - 1 - elif int(prefix_len) == addr_bits - 1: - if ipaddr_val & 0x1 == 0: - peer_addr_val = ipaddr_val + 1 - else: - peer_addr_val = ipaddr_val - 1 - if peer_addr_val is not None: - intf['peer_addr'] = ipaddress.IPAddress(peer_addr_val) - intfs.append(intf) + intfs[(intfname, ipprefix)] = {} lointfs = child.find(str(QName(ns, "LoopbackIPInterfaces"))) - lo_intfs = [] + lo_intfs = {} for lointf in lointfs.findall(str(QName(ns1, "LoopbackIPInterface"))): intfname = lointf.find(str(QName(ns, "AttachTo"))).text ipprefix = lointf.find(str(QName(ns1, "PrefixStr"))).text - ipn = ipaddress.IPNetwork(ipprefix) - ipaddr = ipn.ip - prefix_len = ipn.prefixlen - ipmask = ipn.netmask - lo_intf = {'name': intfname, 'addr': ipaddr, 'prefixlen': prefix_len} - if isinstance(ipn, ipaddress.IPv4Network): - lo_intf['mask'] = ipmask - else: - lo_intf['mask'] = str(prefix_len) - lo_intfs.append(lo_intf) - + lo_intfs[(intfname, ipprefix)] = {} + mgmtintfs = child.find(str(QName(ns, "ManagementIPInterfaces"))) - mgmt_intf = None + mgmt_intf = {} for mgmtintf in mgmtintfs.findall(str(QName(ns1, "ManagementIPInterface"))): + intfname = mgmtintf.find(str(QName(ns, "AttachTo"))).text ipprefix = mgmtintf.find(str(QName(ns1, "PrefixStr"))).text mgmtipn = ipaddress.IPNetwork(ipprefix) - # Ignore IPv6 management address - if mgmtipn.version == 6: - continue - ipaddr = mgmtipn.ip - prefix_len = str(mgmtipn.prefixlen) - ipmask = mgmtipn.netmask gwaddr = ipaddress.IPAddress(int(mgmtipn.network) + 1) - mgmt_intf = {'addr': ipaddr, 'prefixlen': prefix_len, 'mask': ipmask, 'gwaddr': gwaddr} + mgmt_intf[(intfname, ipprefix)] = {'gwaddr': gwaddr} pcintfs = child.find(str(QName(ns, "PortChannelInterfaces"))) pc_intfs = [] @@ -206,7 +165,7 @@ def parse_dpg(dpg, hname): pcmbr_list = pcintfmbr.split(';') for i, member in enumerate(pcmbr_list): pcmbr_list[i] = port_alias_map.get(member, member) - pcs[pcintfname] = {'name': pcintfname, 'members': pcmbr_list} + pcs[pcintfname] = {'members': pcmbr_list} vlanintfs = child.find(str(QName(ns, "VlanInterfaces"))) vlan_intfs = [] @@ -218,7 +177,7 @@ def parse_dpg(dpg, hname): vmbr_list = vintfmbr.split(';') for i, member in enumerate(vmbr_list): vmbr_list[i] = port_alias_map.get(member, member) - vlan_attributes = {'name': vintfname, 'members': vmbr_list, 'vlanid': vlanid} + vlan_attributes = {'members': vmbr_list, 'vlanid': vlanid} sonic_vlan_name = "Vlan%s" % vlanid vlans[sonic_vlan_name] = vlan_attributes @@ -243,7 +202,7 @@ def parse_dpg(dpg, hname): acl_intfs = port_alias_map.values() break; if acl_intfs: - acls[aclname] = { 'AttachTo': acl_intfs, 'IsMirror': is_mirror } + acls[aclname] = { 'policy_desc': aclname, 'ports': acl_intfs, 'type': 'mirror' if is_mirror else 'L3'} return intfs, lo_intfs, mgmt_intf, vlans, pcs, acls return None, None, None, None, None, None @@ -326,51 +285,17 @@ def parse_meta(meta, hname): return syslog_servers, dhcp_servers, ntp_servers, mgmt_routes, erspan_dst, deployment_id def parse_deviceinfo(meta, hwsku): - ethernet_interfaces = [] - + ethernet_interfaces = {} for device_info in meta.findall(str(QName(ns, "DeviceInfo"))): dev_sku = device_info.find(str(QName(ns, "HwSku"))).text if dev_sku == hwsku: interfaces = device_info.find(str(QName(ns, "EthernetInterfaces"))) for interface in interfaces.findall(str(QName(ns1, "EthernetInterface"))): - name = interface.find(str(QName(ns, "InterfaceName"))).text + alias = interface.find(str(QName(ns, "InterfaceName"))).text speed = interface.find(str(QName(ns, "Speed"))).text - ethernet_interfaces.append({ 'name':name, 'speed':speed }) - + ethernet_interfaces[port_alias_map.get(alias, alias)] = speed return ethernet_interfaces -def get_console_info(devices, dev, port): - for k, v in devices.items(): - if k == dev: - break - else: - return {} - - ret_val = v - ret_val.update({ - 'ts_port': port, - 'ts_dev': dev - }) - - return ret_val - - -def get_mgmt_info(devices, dev, port): - for k, v in devices.items(): - if k == dev: - break - else: - return {} - - ret_val = v - ret_val.update({ - 'mgmt_port': port, - 'mgmt_dev': dev - }) - - return ret_val - - def parse_port_config(hwsku, platform=None, port_config_file=None): port_config_candidates = [] if port_config_file != None: @@ -401,7 +326,7 @@ def parse_port_config(hwsku, platform=None, port_config_file=None): alias = name else: alias = tokens[2].strip() - ports[name] = {'name': name, 'alias': alias} + ports[name] = {'alias': alias} port_alias_map[alias] = name return ports @@ -424,7 +349,7 @@ def parse_xml(filename, platform=None, port_config_file=None): neighbors = None devices = None hostname = None - ethernet_interfaces = [] + port_speeds = {} syslog_servers = [] dhcp_servers = [] ntp_servers = [] @@ -455,93 +380,91 @@ def parse_xml(filename, platform=None, port_config_file=None): elif child.tag == str(QName(ns, "MetadataDeclaration")): (syslog_servers, dhcp_servers, ntp_servers, mgmt_routes, erspan_dst, deployment_id) = parse_meta(child, hostname) elif child.tag == str(QName(ns, "DeviceInfos")): - ethernet_interfaces = parse_deviceinfo(child, hwsku) + port_speeds = parse_deviceinfo(child, hwsku) results = {} - results['minigraph_hwsku'] = hwsku - # sorting by lambdas are not easily done without custom filters. - # TODO: add jinja2 filter to accept a lambda to sort a list of dictionaries by attribute. - # TODO: alternatively (preferred), implement class containers for multiple-attribute entries, enabling sort by attr + results['DEVICE_METADATA'] = {'localhost': { + 'bgp_asn': bgp_asn, + 'deployment_id': deployment_id, + 'hostname': hostname, + 'hwsku': hwsku, + 'type': devices[hostname]['type'] + }} results['BGP_NEIGHBOR'] = bgp_sessions - results['DEVICE_METADATA'] = {'localhost': { 'bgp_asn': bgp_asn }} results['BGP_PEER_RANGE'] = bgp_peers_with_range - # TODO: sort does not work properly on all interfaces of varying lengths. Need to sort by integer group(s). - - phyport_intfs = [] - vlan_intfs = [] - pc_intfs = [] + if mgmt_routes: + # TODO: differentiate v4 and v6 + mgmt_intf.itervalues().next()['forced_mgmt_routes'] = mgmt_routes + results['MGMT_INTERFACE'] = mgmt_intf + results['LOOPBACK_INTERFACE'] = lo_intfs + + phyport_intfs = {} + vlan_intfs = {} + pc_intfs = {} for intf in intfs: - intfname = intf['attachto'] - if intfname[0:4] == 'Vlan': - vlan_intfs.append(intf) - elif intfname[0:11] == 'PortChannel': - pc_intfs.append(intf) + if intf[0][0:4] == 'Vlan': + vlan_intfs[intf] = {} + elif intf[0][0:11] == 'PortChannel': + pc_intfs[intf] = {} else: - phyport_intfs.append(intf) - - results['minigraph_interfaces'] = sorted(phyport_intfs, key=lambda x: x['attachto']) - results['minigraph_vlan_interfaces'] = sorted(vlan_intfs, key=lambda x: x['attachto']) - results['minigraph_portchannel_interfaces'] = sorted(pc_intfs, key=lambda x: x['attachto']) - results['minigraph_ports'] = ports - results['minigraph_vlans'] = vlans - results['minigraph_portchannels'] = pcs - results['minigraph_mgmt_interface'] = mgmt_intf - results['minigraph_lo_interfaces'] = lo_intfs - results['minigraph_acls'] = acls - results['minigraph_neighbors'] = neighbors - results['minigraph_devices'] = devices - results['minigraph_underlay_neighbors'] = u_neighbors - results['minigraph_underlay_devices'] = u_devices - results['minigraph_as_xml'] = mini_graph_path - if devices != None: - results['minigraph_console'] = get_console_info(devices, console_dev, console_port) - results['minigraph_mgmt'] = get_mgmt_info(devices, mgmt_dev, mgmt_port) - results['minigraph_hostname'] = hostname - results['inventory_hostname'] = hostname - results['syslog_servers'] = syslog_servers - results['dhcp_servers'] = dhcp_servers - results['ntp_servers'] = ntp_servers - results['forced_mgmt_routes'] = mgmt_routes - results['erspan_dst'] = erspan_dst - results['deployment_id'] = deployment_id - results['ethernet_interfaces'] = ethernet_interfaces + phyport_intfs[intf] = {} + + results['INTERFACE'] = phyport_intfs + results['VLAN_INTERFACE'] = vlan_intfs + results['PORTCHANNEL_INTERFACE'] = pc_intfs + + for port_name in port_speeds: + ports.setdefault(port_name, {})['speed'] = port_speeds[port_name] + results['PORT'] = ports + results['PORTCHANNEL'] = pcs + results['VLAN'] = vlans + + results['DEVICE_NEIGHBOR'] = neighbors + results['SYSLOG_SERVER'] = dict((item, {}) for item in syslog_servers) + results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) + results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) + + results['ACL_TABLE'] = acls + mirror_sessions = {} + if erspan_dst: + lo_addr = '0.0.0.0' + for lo in lo_intfs: + lo_network = ipaddress.IPNetwork(lo[1]) + if lo_network.version == 4: + lo_addr = str(lo_network.ip) + break + count = 0 + for dst in erspan_dst: + mirror_sessions['everflow{}'.format(count)] = {"dst_ip": dst, "src_ip": lo_addr} + count += 1 + results['MIRROR_SESSION'] = mirror_sessions return results + def parse_device_desc_xml(filename): root = ET.parse(filename).getroot() (lo_prefix, mgmt_prefix, hostname, hwsku, d_type) = parse_device(root) results = {} - results['minigraph_hwsku'] = hwsku - results['minigraph_hostname'] = hostname - results['inventory_hostname'] = hostname - - lo_intfs = [] - ipn = ipaddress.IPNetwork(lo_prefix) - ipaddr = ipn.ip - prefix_len = ipn.prefixlen - ipmask = ipn.netmask - lo_intf = {'name': None, 'addr': ipaddr, 'prefixlen': prefix_len} - if isinstance(ipn, ipaddress.IPv4Network): - lo_intf['mask'] = ipmask - else: - lo_intf['mask'] = str(prefix_len) - lo_intfs.append(lo_intf) - results['minigraph_lo_interfaces'] = lo_intfs + results['DEVICE_METADATA'] = {'localhost': { + 'hostname': hostname, + 'hwsku': hwsku, + }} + + results['LOOPBACK_INTERFACE'] = {('lo', lo_prefix): {}} + + mgmt_intf = {} + mgmtipn = ipaddress.IPNetwork(mgmt_prefix) + gwaddr = ipaddress.IPAddress(int(mgmtipn.network) + 1) + results['MGMT_INTERFACE'] = {('eth0', mgmt_prefix): {'gwaddr': gwaddr}} - mgmt_intf = None - mgmt_ipn = ipaddress.IPNetwork(mgmt_prefix) - ipaddr = mgmt_ipn.ip - prefix_len = str(mgmt_ipn.prefixlen) - ipmask = mgmt_ipn.netmask - gwaddr = ipaddress.IPAddress(int(mgmt_ipn.network) + 1) - mgmt_intf = {'addr': ipaddr, 'prefixlen': prefix_len, 'mask': ipmask, 'gwaddr': gwaddr} - results['minigraph_mgmt_interface'] = mgmt_intf return results + port_alias_map = {} + def print_parse_xml(filename): results = parse_xml(filename) print(json.dumps(results, indent=3, cls=minigraph_encoder)) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 070b3100ea5a..5303557c4fb4 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -22,6 +22,7 @@ import yaml import jinja2 import netaddr import json +from functools import partial from minigraph import minigraph_encoder from minigraph import parse_xml from minigraph import parse_device_desc_xml @@ -32,11 +33,11 @@ from swsssdk import ConfigDBConnector def is_ipv4(value): if not value: return False - if isinstance(value, netaddr.IPAddress): + if isinstance(value, netaddr.IPNetwork): addr = value else: try: - addr = netaddr.IPAddress(str(value)) + addr = netaddr.IPNetwork(str(value)) except: return False return addr.version == 4 @@ -44,15 +45,25 @@ def is_ipv4(value): def is_ipv6(value): if not value: return False - if isinstance(value, netaddr.IPAddress): + if isinstance(value, netaddr.IPNetwork): addr = value else: try: - addr = netaddr.IPAddress(str(value)) + addr = netaddr.IPNetwork(str(value)) except: return False return addr.version == 6 +def prefix_attr(attr, value): + if not value: + return None + else: + try: + prefix = netaddr.IPNetwork(str(value)) + except: + return None + return str(getattr(prefix, attr)) + def unique_name(l): name_list = [] new_list = [] @@ -79,10 +90,31 @@ TODO(taoyl): Current version of config db only supports BGP admin states. def output_to_db(output_data): db_data = {} for table_name in output_data: - if table_name == 'BGP_NEIGHBOR' or table_name == 'BGP_PEER_RANGE' or table_name == 'DEVICE_METADATA': + if table_name[0].isupper(): db_data[table_name] = output_data[table_name] return db_data + @staticmethod + def to_serialized(data): + for table in data: + if type(data[table]) is dict: + for key in data[table].keys(): + new_key = ConfigDBConnector.serialize_key(key) + if new_key != key: + data[table][new_key] = data[table].pop(key) + return data + + @staticmethod + def to_deserialized(data): + for table in data: + if type(data[table]) is dict: + for key in data[table].keys(): + new_key = ConfigDBConnector.deserialize_key(key) + if new_key != key: + data[table][new_key] = data[table].pop(key) + return data + + def deep_update(dst, src): for key, value in src.iteritems(): if isinstance(value, dict): @@ -138,11 +170,11 @@ def main(): for yaml_file in args.yaml: with open(yaml_file, 'r') as stream: additional_data = yaml.load(stream) - deep_update(data, additional_data) + deep_update(data, FormatConverter.to_deserialized(additional_data)) for json_file in args.json: with open(json_file, 'r') as stream: - deep_update(data, json.load(stream)) + deep_update(data, FormatConverter.to_deserialized(json.load(stream))) if args.additional_data != None: deep_update(data, json.loads(args.additional_data)) @@ -158,6 +190,8 @@ def main(): env.filters['ipv4'] = is_ipv4 env.filters['ipv6'] = is_ipv6 env.filters['unique_name'] = unique_name + for attr in ['ip', 'network', 'prefixlen', 'netmask']: + env.filters[attr] = partial(prefix_attr, attr) template = env.get_template(template_file) print template.render(data) @@ -174,7 +208,7 @@ def main(): configdb.set_config(FormatConverter.output_to_db(data)) if args.print_data: - print json.dumps(data, indent=4, cls=minigraph_encoder) + print json.dumps(FormatConverter.to_serialized(data), indent=4, cls=minigraph_encoder) if __name__ == "__main__": diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index 5c57bf8fac85..aed23f8a5c26 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -27,6 +27,16 @@ iface eth0 inet static # management port down rules down ip route delete default via 10.0.0.1 dev eth0 table default down ip rule delete from 10.0.0.100/32 table default +iface eth0 inet6 static + address 2603:10e2:0:2902::8 + netmask 64 + ########## management network policy routing rules + # management port up rules + up ip route add default via 2603:10e2:0:2902::1 dev eth0 table default + up ip rule add from 2603:10e2:0:2902::8/32 table default + # management port down rules + down ip route delete default via 2603:10e2:0:2902::1 dev eth0 table default + down ip rule delete from 2603:10e2:0:2902::8/32 table default # # The switch front panel interfaces # "|| true" is added to suppress the error when interface is already a member of VLAN diff --git a/src/sonic-config-engine/tests/sample_output/mirror.json b/src/sonic-config-engine/tests/sample_output/mirror.json index 54065700a282..225235067e23 100644 --- a/src/sonic-config-engine/tests/sample_output/mirror.json +++ b/src/sonic-config-engine/tests/sample_output/mirror.json @@ -1,6 +1,6 @@ [ { - "MIRROR_SESSION_TABLE:everflow": { + "MIRROR_SESSION_TABLE:everflow0": { "src_ip": "10.1.0.32", "dst_ip": "2.2.2.2", "gre_type": "0x88be", diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 153b0bb14f36..cf0eb4d8cc5c 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -31,17 +31,17 @@ def test_dummy_run(self): self.assertEqual(output, '') def test_device_desc(self): - argument = '-v minigraph_hwsku -M "' + self.sample_device_desc + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -M "' + self.sample_device_desc + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'ACS-MSN2700') def test_device_desc_mgmt_ip(self): - argument = '-v "minigraph_mgmt_interface[\'addr\']" -M "' + self.sample_device_desc + '"' + argument = '-v "MGMT_INTERFACE.keys()[0]" -M "' + self.sample_device_desc + '"' output = self.run_script(argument) - self.assertEqual(output.strip(), '10.0.1.5') + self.assertEqual(output.strip(), "('eth0', '10.0.1.5/28')") def test_minigraph_sku(self): - argument = '-v minigraph_hwsku -m "' + self.sample_graph + '"' + argument = '-v "DEVICE_METADATA[\'localhost\'][\'hwsku\']" -m "' + self.sample_graph + '"' output = self.run_script(argument) self.assertEqual(output.strip(), 'Force10-Z9100') @@ -51,7 +51,7 @@ def test_print_data(self): self.assertTrue(len(output.strip()) > 0) def test_jinja_expression(self): - argument = '-m "' + self.sample_graph + '" -v "minigraph_devices[minigraph_hostname][\'type\']"' + argument = '-m "' + self.sample_graph + '" -v "DEVICE_METADATA[\'localhost\'][\'type\']"' output = self.run_script(argument) self.assertEqual(output.strip(), 'LeafRouter') @@ -71,44 +71,44 @@ def test_render_template(self): self.assertEqual(output.strip(), 'value1\nvalue2') def test_minigraph_acl(self): - argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v minigraph_acls' + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v ACL_TABLE' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'dataacl': {'IsMirror': False, 'AttachTo': ['Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124']}}") + self.assertEqual(output.strip(), "{'dataacl': {'type': 'L3', 'policy_desc': 'dataacl', 'ports': ['Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124']}}") def test_minigraph_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v minigraph_interfaces' + argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v \'INTERFACE.keys()\'' output = self.run_script(argument) - self.assertEqual(output.strip(), "[{'subnet': IPv4Network('10.0.0.58/31'), 'peer_addr': IPv4Address('10.0.0.59'), 'addr': IPv4Address('10.0.0.58'), 'mask': IPv4Address('255.255.255.254'), 'attachto': 'Ethernet0', 'prefixlen': 31}, {'subnet': IPv6Network('fc00::74/126'), 'peer_addr': IPv6Address('fc00::76'), 'addr': IPv6Address('fc00::75'), 'mask': '126', 'attachto': 'Ethernet0', 'prefixlen': 126}]") + self.assertEqual(output.strip(), "[('Ethernet0', '10.0.0.58/31'), ('Ethernet0', 'FC00::75/126')]") def test_minigraph_vlans(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v minigraph_vlans' + argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'Vlan1000': {'name': 'Vlan1000', 'members': ['Ethernet8'], 'vlanid': '1000'}}") + self.assertEqual(output.strip(), "{'Vlan1000': {'members': ['Ethernet8'], 'vlanid': '1000'}}") def test_minigraph_vlan_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v minigraph_vlan_interfaces' + argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[{'prefixlen': 27, 'subnet': IPv4Network('192.168.0.0/27'), 'mask': IPv4Address('255.255.255.224'), 'addr': IPv4Address('192.168.0.1'), 'attachto': 'Vlan1000'}]") + self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27')]") def test_minigraph_portchannels(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v minigraph_portchannels' + argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v PORTCHANNEL' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'PortChannel01': {'name': 'PortChannel01', 'members': ['Ethernet4']}}") + self.assertEqual(output.strip(), "{'PortChannel01': {'members': ['Ethernet4']}}") def test_minigraph_portchannels_more_member(self): - argument = '-m "' + self.sample_graph_pc_test + '" -p "' + self.port_config + '" -v minigraph_portchannels' + argument = '-m "' + self.sample_graph_pc_test + '" -p "' + self.port_config + '" -v PORTCHANNEL' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'PortChannel01': {'name': 'PortChannel01', 'members': ['Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124']}}") + self.assertEqual(output.strip(), "{'PortChannel01': {'members': ['Ethernet112', 'Ethernet116', 'Ethernet120', 'Ethernet124']}}") def test_minigraph_portchannel_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v minigraph_portchannel_interfaces' + argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORTCHANNEL_INTERFACE.keys()"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[{'subnet': IPv4Network('10.0.0.56/31'), 'peer_addr': IPv4Address('10.0.0.57'), 'addr': IPv4Address('10.0.0.56'), 'mask': IPv4Address('255.255.255.254'), 'attachto': 'PortChannel01', 'prefixlen': 31}, {'subnet': IPv6Network('fc00::70/126'), 'peer_addr': IPv6Address('fc00::72'), 'addr': IPv6Address('fc00::71'), 'mask': '126', 'attachto': 'PortChannel01', 'prefixlen': 126}]") + self.assertEqual(output.strip(), "[('PortChannel01', 'FC00::71/126'), ('PortChannel01', '10.0.0.56/31')]") def test_minigraph_neighbors(self): - argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v minigraph_neighbors' + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "DEVICE_NEIGHBOR[\'ARISTA01T1\']"' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'Ethernet116': {'name': 'ARISTA02T1', 'port': 'Ethernet1/1'}, 'Ethernet124': {'name': 'ARISTA04T1', 'port': 'Ethernet1/1'}, 'Ethernet112': {'name': 'ARISTA01T1', 'port': 'Ethernet1/1'}, 'Ethernet120': {'name': 'ARISTA03T1', 'port': 'Ethernet1/1'}}") + self.assertEqual(output.strip(), "{'mgmt_addr': None, 'hwsku': 'Arista', 'lo_addr': None, 'local_port': 'Ethernet112', 'type': 'LeafRouter', 'port': 'Ethernet1/1'}") def test_minigraph_peers_with_range(self): argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v BGP_PEER_RANGE.values\(\)' @@ -116,11 +116,11 @@ def test_minigraph_peers_with_range(self): self.assertEqual(output.strip(), "[{'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]") def test_minigraph_deployment_id(self): - argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v deployment_id' + argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'deployment_id\']"' output = self.run_script(argument) self.assertEqual(output.strip(), "1") def test_minigraph_ethernet_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v ethernet_interfaces' + argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet8\']"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[{'speed': '10000', 'name': 'fortyGigE0/0'}, {'speed': '25000', 'name': 'fortyGigE0/4'}, {'speed': '40000', 'name': 'fortyGigE0/8'}, {'speed': '1000000', 'name': 'fortyGigE0/12'}]") + self.assertEqual(output.strip(), "{'alias': 'fortyGigE0/8', 'speed': '40000'}") diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 0f9264eb1d3b..9b71fc72b932 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -40,7 +40,7 @@ def test_render_teamd(self, pc, minigraph, sample_output): self.assertTrue(filecmp.cmp(sample_output, self.output_file)) # Test T0 minigraph - argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -v "minigraph_portchannels.keys() | join(\' \')"' + argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -v "PORTCHANNEL.keys() | join(\' \') if PORTCHANNEL"' output = self.run_script(argument) # Mock the output via config.sh in docker-teamd pc_list = output.split() @@ -51,7 +51,7 @@ def test_render_teamd(self, pc, minigraph, sample_output): test_render_teamd(self, pc_name, self.t0_minigraph, sample_output) # Test port channel test minigraph - argument = '-m ' + self.pc_minigraph + ' -p ' + self.t0_port_config + ' -v "minigraph_portchannels.keys() | join(\' \')"' + argument = '-m ' + self.pc_minigraph + ' -p ' + self.t0_port_config + ' -v "PORTCHANNEL.keys() | join(\' \') if PORTCHANNEL"' output = self.run_script(argument) # Mock the output via config.sh in docker-teamd pc_list = output.split() diff --git a/src/sonic-config-engine/translate_acl b/src/sonic-config-engine/translate_acl index 5525eff96774..b8138cf36b18 100755 --- a/src/sonic-config-engine/translate_acl +++ b/src/sonic-config-engine/translate_acl @@ -110,13 +110,14 @@ def generate_rule_json(table_name, rule, max_priority, mirror): rule_props["TCP_FLAGS"] = '0x{:02x}/0x{:02x}'.format(tcp_flags, tcp_flags) return rule_data -def generate_table_json(aclset, aclname, ports, mirror, max_priority, output_path='.'): +def generate_table_json(aclset, aclname, ports, t_type, max_priority, output_path='.'): table_name = aclname.replace(" ", "_").replace("-", "_") #table_name = generate_random_table_name() + mirror = (t_type == 'mirror') table_props = {} table_props["policy_desc"] = table_name - table_props["type"] = "mirror" if mirror else "L3" + table_props["type"] = t_type table_props["ports"] = ports table_data = [{}] @@ -138,7 +139,7 @@ def translate_acl_fixed_port(filename, output_path, port, max_priority): yang_acl = pybindJSON.load(filename, openconfig_acl, "openconfig_acl") for aclsetname in yang_acl.acl.acl_sets.acl_set: aclset = yang_acl.acl.acl_sets.acl_set[aclsetname] - generate_table_json(aclset, aclsetname, port, max_priority, output_path) + generate_table_json(aclset, aclsetname, port, 'l3', max_priority, output_path) return def translate_acl(filename, output_path, mini_acl, max_priority): @@ -146,10 +147,10 @@ def translate_acl(filename, output_path, mini_acl, max_priority): for aclsetname in yang_acl.acl.acl_sets.acl_set: tablename = aclsetname.replace(" ", "_").replace("-", "_") if mini_acl.has_key(tablename): - is_mirror = mini_acl[tablename]['IsMirror'] - ports = ','.join(mini_acl[tablename]['AttachTo']) + t_type = mini_acl[tablename]['type'] + ports = ','.join(mini_acl[tablename]['ports']) aclset = yang_acl.acl.acl_sets.acl_set[aclsetname] - generate_table_json(aclset, aclsetname, ports, is_mirror, max_priority, output_path) + generate_table_json(aclset, aclsetname, ports, t_type, max_priority, output_path) return def main(): @@ -166,8 +167,8 @@ def main(): translate_acl_fixed_port(args.input, args.output_path, args.port, args.max_priority) elif args.minigraph: mini_data = parse_xml(args.minigraph, port_config_file=args.port_config) - if mini_data['minigraph_acls']: - translate_acl(args.input, args.output_path, mini_data['minigraph_acls'], args.max_priority) + if mini_data['ACL_TABLE']: + translate_acl(args.input, args.output_path, mini_data['ACL_TABLE'], args.max_priority) if __name__ == "__main__": main() diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 9b54b80f1783..7f8e7c5ad974 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 9b54b80f1783808c5ae2a30e189f24a7404a8c95 +Subproject commit 7f8e7c5ad9747af1d8ce5317eb1ece65ed4c0c7a From 686e227dcccabdf9c3ed8bffec2e0c2a026ccbf4 Mon Sep 17 00:00:00 2001 From: nikos-li <31227248+nikos-li@users.noreply.github.com> Date: Tue, 12 Sep 2017 15:48:38 -0700 Subject: [PATCH 31/77] [frr]: RR client support in minigraph for FRR (#923) --- dockers/docker-fpm-frr/bgpd.conf.j2 | 6 ++++++ src/sonic-config-engine/minigraph.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index 0f1e255b5cd1..f17464e3f893 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -57,12 +57,18 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if neighbor_addr | ipv4 %} address-family ipv4 neighbor {{ neighbor_addr }} activate +{% if bgp_session['rrclient'] != 0 %} + neighbor {{ neighbor_addr }} route-reflector-client +{% endif %} maximum-paths 64 exit-address-family {% endif %} {% if neighbor_addr | ipv6 %} address-family ipv6 neighbor {{ neighbor_addr }} activate +{% if bgp_session['rrclient'] != 0 %} + neighbor {{ neighbor_addr }} route-reflector-client +{% endif %} maximum-paths 64 exit-address-family {% endif %} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 565a1a43d060..7cf4d2f829cc 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -233,6 +233,10 @@ def parse_cpg(cpg, hname): for router in child.findall(str(QName(ns1, "BGPRouterDeclaration"))): asn = router.find(str(QName(ns1, "ASN"))).text hostname = router.find(str(QName(ns1, "Hostname"))).text + if router.find(str(QName(ns1, "RRClient"))): + rrclient = '1' + else: + rrclient = '0' if hostname == hname: myasn = int(asn) peers = router.find(str(QName(ns1, "Peers"))) @@ -251,6 +255,7 @@ def parse_cpg(cpg, hname): bgp_session = bgp_sessions[peer] if hostname == bgp_session['name']: bgp_session['asn'] = int(asn) + bgp_session['rrclient'] = int(rrclient) return bgp_sessions, myasn, bgp_peers_with_range From e4cae4e8897b7f613365d9242df17f30a742dc78 Mon Sep 17 00:00:00 2001 From: cytsai0409 Date: Thu, 14 Sep 2017 10:18:26 +0800 Subject: [PATCH 32/77] [Ingrasys] update port_config.ini and sfputil for ingrasys platforms (#952) * [Ingrasys] update port_config.ini and sfputil for ingrasys platforms - What I did Update port_config.ini on S8810-32Q/S8900-54XC/S8900-64XC/S9100-C32 platforms - How I did it Update alias field and add port field in port_config.ini - How to verify it Check with the "sfputil show eeprom" command. If no error occurs, it is passed. - Description for the changelog Update port_config.ini on S8810-32Q/S8900-54XC/S8900-64XC/S9100-C32 platforms * [Ingrasys] remove debug message in sfputil.py on S8810-32Q - What I did remove debug message in sfputil.py on S8810-32Q - How I did it remove print in get_low_power_mode() and set_low_power_mode() - How to verify it There should be no debug message when executing "sfputil show lpmode" and "sfputil lpmode on Ethernet0"command. - Description for the changelog remove debug message in sfputil.py on S8810-32Q - A picture of a cute animal (not mandatory but encouraged) --- .../INGRASYS-S8810-32Q/port_config.ini | 66 ++--- .../plugins/sfputil.py | 200 +++++++++++----- .../INGRASYS-S8900-54XC/port_config.ini | 110 ++++----- .../plugins/sfputil.py | 225 ++++++++++++++++-- .../INGRASYS-S8900-64XC/port_config.ini | 130 +++++----- .../INGRASYS-S9100-C32/port_config.ini | 66 ++--- 6 files changed, 540 insertions(+), 257 deletions(-) diff --git a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini index fb9235101108..a313c9cda21f 100644 --- a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias -Ethernet0 37,38,39,40 -Ethernet4 33,34,35,36 -Ethernet8 45,46,47,48 -Ethernet12 41,42,43,44 -Ethernet16 53,54,55,56 -Ethernet20 49,50,51,52 -Ethernet24 61,62,63,64 -Ethernet28 57,58,59,60 -Ethernet32 69,70,71,72 -Ethernet36 65,66,67,68 -Ethernet40 77,78,79,80 -Ethernet44 73,74,75,76 -Ethernet48 85,86,87,88 -Ethernet52 81,82,83,84 -Ethernet56 93,94,95,96 -Ethernet60 89,90,91,92 -Ethernet64 101,102,103,104 -Ethernet68 97,98,99,100 -Ethernet72 109,110,111,112 -Ethernet76 105,106,107,108 -Ethernet80 117,118,119,120 -Ethernet84 113,114,115,116 -Ethernet88 125,126,127,128 -Ethernet92 121,122,123,124 -Ethernet96 5,6,7,8 -Ethernet100 1,2,3,4 -Ethernet104 13,14,15,16 -Ethernet108 9,10,11,12 -Ethernet112 21,22,23,24 -Ethernet116 17,18,19,20 -Ethernet120 29,30,31,32 -Ethernet124 25,26,27,28 +# name lanes alias port +Ethernet0 37,38,39,40 Ethernet1/1 0 +Ethernet4 33,34,35,36 Ethernet2/1 1 +Ethernet8 45,46,47,48 Ethernet3/1 2 +Ethernet12 41,42,43,44 Ethernet4/1 3 +Ethernet16 53,54,55,56 Ethernet5/1 4 +Ethernet20 49,50,51,52 Ethernet6/1 5 +Ethernet24 61,62,63,64 Ethernet7/1 6 +Ethernet28 57,58,59,60 Ethernet8/1 7 +Ethernet32 69,70,71,72 Ethernet9/1 8 +Ethernet36 65,66,67,68 Ethernet10/1 9 +Ethernet40 77,78,79,80 Ethernet11/1 10 +Ethernet44 73,74,75,76 Ethernet12/1 11 +Ethernet48 85,86,87,88 Ethernet13/1 12 +Ethernet52 81,82,83,84 Ethernet14/1 13 +Ethernet56 93,94,95,96 Ethernet15/1 14 +Ethernet60 89,90,91,92 Ethernet16/1 15 +Ethernet64 101,102,103,104 Ethernet17/1 16 +Ethernet68 97,98,99,100 Ethernet18/1 17 +Ethernet72 109,110,111,112 Ethernet19/1 18 +Ethernet76 105,106,107,108 Ethernet20/1 19 +Ethernet80 117,118,119,120 Ethernet21/1 20 +Ethernet84 113,114,115,116 Ethernet22/1 21 +Ethernet88 125,126,127,128 Ethernet23/1 22 +Ethernet92 121,122,123,124 Ethernet24/1 23 +Ethernet96 5,6,7,8 Ethernet25/1 24 +Ethernet100 1,2,3,4 Ethernet26/1 25 +Ethernet104 13,14,15,16 Ethernet27/1 26 +Ethernet108 9,10,11,12 Ethernet28/1 27 +Ethernet112 21,22,23,24 Ethernet29/1 28 +Ethernet116 17,18,19,20 Ethernet30/1 29 +Ethernet120 29,30,31,32 Ethernet31/1 30 +Ethernet124 25,26,27,28 Ethernet32/1 31 diff --git a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/plugins/sfputil.py b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/plugins/sfputil.py index 7bc71c27eeb6..bef254484ac4 100644 --- a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/plugins/sfputil.py +++ b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/plugins/sfputil.py @@ -1,61 +1,147 @@ -#!/usr/bin/env python +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# try: - from sonic_sfp.sfputilbase import sfputilbase -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - - -class sfputil(sfputilbase): - """Platform specific sfputil class""" - - port_start = 0 - port_end = 31 - ports_in_block = 32 - - port_to_eeprom_mapping = {} - #FIXME - port_to_i2c_mapping = { - 0: 18, - 1: 19, - 2: 20, - 3: 21, - 4: 22, - 5: 23, - 6: 24, - 7: 25, - 8: 26, - 9: 27, - 10: 28, - 11: 29, - 12: 30, - 13: 31, - 14: 32, - 15: 33, - 16: 34, - 17: 35, - 18: 36, - 19: 37, - 20: 38, - 21: 39, - 22: 40, - 23: 41, - 24: 42, - 25: 43, - 26: 44, - 27: 45, - 28: 46, - 29: 47, - 30: 48, - 31: 49 - } - - _qsfp_ports = range(0, ports_in_block + 1) - - def __init__(self, port_num): + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 0 + PORT_END = 31 + PORTS_IN_BLOCK = 32 + + EEPROM_OFFSET = 18 + + ABS_GPIO_BASE = 224 + #INT_GPIO_BASE = 192 + LP_GPIO_BASE = 160 + RST_GPIO_BASE = 128 + + BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction" + BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value" + + _port_to_eeprom_mapping = {} + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return range(0, self.PORTS_IN_BLOCK + 1) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): # Override port_to_eeprom_mapping for class initialization - eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' + eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" + for x in range(self.port_start, self.port_end + 1): - port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) - self.port_to_eeprom_mapping[x] = port_eeprom_path - sfputilbase.__init__(self, port_num) + self._port_to_eeprom_mapping[x] = eeprom_path.format(x + self.EEPROM_OFFSET) + + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + abs_device_file = self.BASE_VAL_PATH.format( + port_num + self.ABS_GPIO_BASE) + val_file = open(abs_device_file) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + lpmode_val_device_file = self.BASE_VAL_PATH.format( + port_num + self.LP_GPIO_BASE) + val_file = open(lpmode_val_device_file) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + lpmode_val_device_file = self.BASE_VAL_PATH.format( + port_num + self.LP_GPIO_BASE) + val_file = open(lpmode_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("1" if lpmode is True else "0") + val_file.close() + + return True + + def reset(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reset_val_device_file = self.BASE_VAL_PATH.format( + port_num + self.RST_GPIO_BASE) + val_file = open(reset_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("1") + val_file.close() + + # Sleep 1 second to allow it to settle + time.sleep(1) + + try: + reset_val_device_file = self.BASE_VAL_PATH.format( + port_num + self.RST_GPIO_BASE) + val_file = open(reset_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("0") + val_file.close() + + return True diff --git a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini index 24a2b8e29222..c1243db622f6 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini @@ -1,55 +1,55 @@ -# name lanes alias -Ethernet0 1 -Ethernet1 2 -Ethernet2 3 -Ethernet3 4 -Ethernet4 5 -Ethernet5 6 -Ethernet6 7 -Ethernet7 8 -Ethernet8 9 -Ethernet9 10 -Ethernet10 11 -Ethernet11 12 -Ethernet12 21 -Ethernet13 22 -Ethernet14 23 -Ethernet15 24 -Ethernet16 33 -Ethernet17 34 -Ethernet18 35 -Ethernet19 36 -Ethernet20 37 -Ethernet21 38 -Ethernet22 39 -Ethernet23 40 -Ethernet24 41 -Ethernet25 42 -Ethernet26 43 -Ethernet27 44 -Ethernet28 49 -Ethernet29 50 -Ethernet30 51 -Ethernet31 52 -Ethernet32 53 -Ethernet33 54 -Ethernet34 55 -Ethernet35 56 -Ethernet36 65 -Ethernet37 66 -Ethernet38 67 -Ethernet39 68 -Ethernet40 69 -Ethernet41 70 -Ethernet42 71 -Ethernet43 72 -Ethernet44 81 -Ethernet45 82 -Ethernet46 83 -Ethernet47 84 -Ethernet48 85,86,87,88 -Ethernet52 97,98,99,100 -Ethernet56 101,102,103,104 -Ethernet60 105,106,107,108 -Ethernet64 109,110,111,112 -Ethernet68 117,118,119,120 +# name lanes alias port +Ethernet0 1 Ethernet1 0 +Ethernet1 2 Ethernet2 1 +Ethernet2 3 Ethernet3 2 +Ethernet3 4 Ethernet4 3 +Ethernet4 5 Ethernet5 4 +Ethernet5 6 Ethernet6 5 +Ethernet6 7 Ethernet7 6 +Ethernet7 8 Ethernet8 7 +Ethernet8 9 Ethernet9 8 +Ethernet9 10 Ethernet10 9 +Ethernet10 11 Ethernet11 10 +Ethernet11 12 Ethernet12 11 +Ethernet12 21 Ethernet13 12 +Ethernet13 22 Ethernet14 13 +Ethernet14 23 Ethernet15 14 +Ethernet15 24 Ethernet16 15 +Ethernet16 33 Ethernet17 16 +Ethernet17 34 Ethernet18 17 +Ethernet18 35 Ethernet19 18 +Ethernet19 36 Ethernet20 19 +Ethernet20 37 Ethernet21 20 +Ethernet21 38 Ethernet22 21 +Ethernet22 39 Ethernet23 22 +Ethernet23 40 Ethernet24 23 +Ethernet24 41 Ethernet25 24 +Ethernet25 42 Ethernet26 25 +Ethernet26 43 Ethernet27 26 +Ethernet27 44 Ethernet28 27 +Ethernet28 49 Ethernet29 28 +Ethernet29 50 Ethernet30 29 +Ethernet30 51 Ethernet31 30 +Ethernet31 52 Ethernet32 31 +Ethernet32 53 Ethernet33 32 +Ethernet33 54 Ethernet34 33 +Ethernet34 55 Ethernet35 34 +Ethernet35 56 Ethernet36 35 +Ethernet36 65 Ethernet37 36 +Ethernet37 66 Ethernet38 37 +Ethernet38 67 Ethernet39 38 +Ethernet39 68 Ethernet40 39 +Ethernet40 69 Ethernet41 40 +Ethernet41 70 Ethernet42 41 +Ethernet42 71 Ethernet43 42 +Ethernet43 72 Ethernet44 43 +Ethernet44 81 Ethernet45 44 +Ethernet45 82 Ethernet46 45 +Ethernet46 83 Ethernet47 46 +Ethernet47 84 Ethernet48 47 +Ethernet48 85,86,87,88 Ethernet49/1 48 +Ethernet52 97,98,99,100 Ethernet50/1 49 +Ethernet56 101,102,103,104 Ethernet51/1 50 +Ethernet60 105,106,107,108 Ethernet52/1 51 +Ethernet64 109,110,111,112 Ethernet53/1 52 +Ethernet68 117,118,119,120 Ethernet54/1 53 diff --git a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/plugins/sfputil.py b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/plugins/sfputil.py index 96fa0fca86ce..0bb52e88616a 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/plugins/sfputil.py +++ b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/plugins/sfputil.py @@ -1,19 +1,27 @@ -#!/usr/bin/env python +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# try: - from sonic_sfp.sfputilbase import sfputilbase -except ImportError, e: - raise ImportError (str(e) + "- required module not found") + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) -class sfputil(sfputilbase): - """Platform specific sfputil class""" +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" - port_start = 0 - port_end = 53 - ports_in_block = 54 + PORT_START = 0 + PORT_END = 53 + QSFP_PORT_START = 48 + PORTS_IN_BLOCK = 54 + + BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction" + BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value" - port_to_eeprom_mapping = {} + _port_to_eeprom_mapping = {} port_to_i2c_mapping = { 0: 18, 1: 19, @@ -71,12 +79,201 @@ class sfputil(sfputilbase): 53: 71 } - _qsfp_ports = range(0, ports_in_block + 1) + abs_to_gpio_mapping = { + 0: 192, + 1: 193, + 2: 194, + 3: 195, + 4: 196, + 5: 197, + 6: 198, + 7: 199, + 8: 200, + 9: 201, + 10: 202, + 11: 203, + 12: 204, + 13: 205, + 14: 206, + 15: 207, + 16: 176, + 17: 177, + 18: 178, + 19: 179, + 20: 180, + 21: 181, + 22: 182, + 23: 183, + 24: 184, + 25: 185, + 26: 186, + 27: 187, + 28: 188, + 29: 189, + 30: 190, + 31: 191, + 32: 160, + 33: 161, + 34: 162, + 35: 163, + 36: 164, + 37: 165, + 38: 166, + 39: 167, + 40: 168, + 41: 169, + 42: 170, + 43: 171, + 44: 172, + 45: 173, + 46: 174, + 47: 175, + 48: 240, + 49: 241, + 50: 242, + 51: 243, + 52: 244, + 53: 245 + } + + lpmode_to_gpio_mapping = { + 48: 224, + 49: 225, + 50: 226, + 51: 227, + 52: 228, + 53: 229 + } + + reset_to_gpio_mapping = { + 48: 208, + 49: 209, + 50: 210, + 51: 211, + 52: 212, + 53: 213 + } + + @property + def port_start(self): + return self.PORT_START + + @property + def qsfp_port_start(self): + return self.QSFP_PORT_START - def __init__(self, port_num): + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return range(0, self.PORTS_IN_BLOCK + 1) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): # Override port_to_eeprom_mapping for class initialization - eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' + eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" + for x in range(self.port_start, self.port_end + 1): port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) self.port_to_eeprom_mapping[x] = port_eeprom_path - sfputilbase.__init__(self, port_num) + + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + abs_device_file = self.BASE_VAL_PATH.format( + self.abs_to_gpio_mapping[port_num]) + val_file = open(abs_device_file) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + return False + + try: + lpmode_val_device_file = self.BASE_VAL_PATH.format( + self.lpmode_to_gpio_mapping[port_num]) + val_file = open(lpmode_val_device_file) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + return False + + try: + lpmode_val_device_file = self.BASE_VAL_PATH.format( + self.lpmode_to_gpio_mapping[port_num]) + val_file = open(lpmode_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("1" if lpmode is True else "0") + val_file.close() + + return True + + def reset(self, port_num): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + print "Error: unable to reset non-QSFP module: port %s" % str(port_num) + return False + + try: + print "port %s" % str(port_num) + reset_val_device_file = self.BASE_VAL_PATH.format( + self.reset_to_gpio_mapping[port_num]) + val_file = open(reset_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("1") + val_file.close() + + # Sleep 1 second to allow it to settle + time.sleep(1) + + try: + reset_val_device_file = self.BASE_VAL_PATH.format( + self.reset_to_gpio_mapping[port_num]) + val_file = open(reset_val_device_file, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + val_file.write("0") + val_file.close() + + return True diff --git a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini index 3e5c7be570e1..20c2138dfeb3 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini @@ -1,65 +1,65 @@ -# name lanes alias -Ethernet0 17 -Ethernet1 18 -Ethernet2 19 -Ethernet3 20 -Ethernet4 24 -Ethernet5 23 -Ethernet6 22 -Ethernet7 21 -Ethernet8 28 -Ethernet9 27 -Ethernet10 26 -Ethernet11 25 -Ethernet12 32 -Ethernet13 31 -Ethernet14 30 -Ethernet15 29 -Ethernet16 1 -Ethernet17 2 -Ethernet18 3 -Ethernet19 4 -Ethernet20 8 -Ethernet21 7 -Ethernet22 6 -Ethernet23 5 -Ethernet24 12 -Ethernet25 11 -Ethernet26 10 -Ethernet27 9 -Ethernet28 13 -Ethernet29 14 -Ethernet30 15 -Ethernet31 16 -Ethernet32 33 -Ethernet33 34 -Ethernet34 35 -Ethernet35 36 -Ethernet36 38 -Ethernet37 39 -Ethernet38 40 -Ethernet39 37 -Ethernet40 41 -Ethernet41 42 -Ethernet42 43 -Ethernet43 44 -Ethernet44 48 -Ethernet45 45 -Ethernet46 46 -Ethernet47 47 -Ethernet48 49,50,51,52 -Ethernet52 53,54,55,56 -Ethernet56 57,58,59,60 -Ethernet60 61,62,63,64 -Ethernet64 65,66,67,68 -Ethernet68 69,70,71,72 -Ethernet72 73,74,75,76 -Ethernet76 77,78,79,80 -Ethernet80 81,82,83,84 -Ethernet84 85,86,87,88 -Ethernet88 89,90,91,92 -Ethernet92 93,94,95,96 -Ethernet96 97,98,99,100 -Ethernet100 101,102,103,104 -Ethernet104 105,106,107,108 -Ethernet108 109,110,111,112 +# name lanes alias port +Ethernet0 17 Ethernet1 0 +Ethernet1 18 Ethernet2 1 +Ethernet2 19 Ethernet3 2 +Ethernet3 20 Ethernet4 3 +Ethernet4 24 Ethernet5 4 +Ethernet5 23 Ethernet6 5 +Ethernet6 22 Ethernet7 6 +Ethernet7 21 Ethernet8 7 +Ethernet8 28 Ethernet9 8 +Ethernet9 27 Ethernet10 9 +Ethernet10 26 Ethernet11 10 +Ethernet11 25 Ethernet12 11 +Ethernet12 32 Ethernet13 12 +Ethernet13 31 Ethernet14 13 +Ethernet14 30 Ethernet15 14 +Ethernet15 29 Ethernet16 15 +Ethernet16 1 Ethernet17 16 +Ethernet17 2 Ethernet18 17 +Ethernet18 3 Ethernet19 18 +Ethernet19 4 Ethernet20 19 +Ethernet20 8 Ethernet21 20 +Ethernet21 7 Ethernet22 21 +Ethernet22 6 Ethernet23 22 +Ethernet23 5 Ethernet24 23 +Ethernet24 12 Ethernet25 24 +Ethernet25 11 Ethernet26 25 +Ethernet26 10 Ethernet27 26 +Ethernet27 9 Ethernet28 27 +Ethernet28 13 Ethernet29 28 +Ethernet29 14 Ethernet30 29 +Ethernet30 15 Ethernet31 30 +Ethernet31 16 Ethernet32 31 +Ethernet32 33 Ethernet33 32 +Ethernet33 34 Ethernet34 33 +Ethernet34 35 Ethernet35 34 +Ethernet35 36 Ethernet36 35 +Ethernet36 38 Ethernet37 36 +Ethernet37 39 Ethernet38 37 +Ethernet38 40 Ethernet39 38 +Ethernet39 37 Ethernet40 39 +Ethernet40 41 Ethernet41 40 +Ethernet41 42 Ethernet42 41 +Ethernet42 43 Ethernet43 42 +Ethernet43 44 Ethernet44 43 +Ethernet44 48 Ethernet45 44 +Ethernet45 45 Ethernet46 45 +Ethernet46 46 Ethernet47 46 +Ethernet47 47 Ethernet48 47 +Ethernet48 49,50,51,52 Ethernet49/1 48 +Ethernet52 53,54,55,56 Ethernet50/1 49 +Ethernet56 57,58,59,60 Ethernet51/1 50 +Ethernet60 61,62,63,64 Ethernet52/1 51 +Ethernet64 65,66,67,68 Ethernet53/1 52 +Ethernet68 69,70,71,72 Ethernet54/1 53 +Ethernet72 73,74,75,76 Ethernet55/1 54 +Ethernet76 77,78,79,80 Ethernet56/1 55 +Ethernet80 81,82,83,84 Ethernet57/1 56 +Ethernet84 85,86,87,88 Ethernet58/1 57 +Ethernet88 89,90,91,92 Ethernet59/1 58 +Ethernet92 93,94,95,96 Ethernet60/1 59 +Ethernet96 97,98,99,100 Ethernet61/1 60 +Ethernet100 101,102,103,104 Ethernet62/1 61 +Ethernet104 105,106,107,108 Ethernet63/1 62 +Ethernet108 109,110,111,112 Ethernet64/1 63 diff --git a/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini b/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini index d70c717fe4e2..6c62497b8927 100644 --- a/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias -Ethernet0 5,6,7,8 -Ethernet4 1,2,3,4 -Ethernet8 13,14,15,16 -Ethernet12 9,10,11,12 -Ethernet16 21,22,23,24 -Ethernet20 17,18,19,20 -Ethernet24 29,30,31,32 -Ethernet28 25,26,27,28 -Ethernet32 37,38,39,40 -Ethernet36 33,34,35,36 -Ethernet40 45,46,47,48 -Ethernet44 41,42,43,44 -Ethernet48 53,54,55,56 -Ethernet52 49,50,51,52 -Ethernet56 61,62,63,64 -Ethernet60 57,58,59,60 -Ethernet64 69,70,71,72 -Ethernet68 65,66,67,68 -Ethernet72 77,78,79,80 -Ethernet76 73,74,75,76 -Ethernet80 85,86,87,88 -Ethernet84 81,82,83,84 -Ethernet88 93,94,95,96 -Ethernet92 89,90,91,92 -Ethernet96 101,102,103,104 -Ethernet100 97,98,99,100 -Ethernet104 109,110,111,112 -Ethernet108 105,106,107,108 -Ethernet112 117,118,119,120 -Ethernet116 113,114,115,116 -Ethernet120 125,126,127,128 -Ethernet124 121,122,123,124 +# name lanes alias port +Ethernet0 5,6,7,8 Ethernet1/1 0 +Ethernet4 1,2,3,4 Ethernet2/1 1 +Ethernet8 13,14,15,16 Ethernet3/1 2 +Ethernet12 9,10,11,12 Ethernet4/1 3 +Ethernet16 21,22,23,24 Ethernet5/1 4 +Ethernet20 17,18,19,20 Ethernet6/1 5 +Ethernet24 29,30,31,32 Ethernet7/1 6 +Ethernet28 25,26,27,28 Ethernet8/1 7 +Ethernet32 37,38,39,40 Ethernet9/1 8 +Ethernet36 33,34,35,36 Ethernet10/1 9 +Ethernet40 45,46,47,48 Ethernet11/1 10 +Ethernet44 41,42,43,44 Ethernet12/1 11 +Ethernet48 53,54,55,56 Ethernet13/1 12 +Ethernet52 49,50,51,52 Ethernet14/1 13 +Ethernet56 61,62,63,64 Ethernet15/1 14 +Ethernet60 57,58,59,60 Ethernet16/1 15 +Ethernet64 69,70,71,72 Ethernet17/1 16 +Ethernet68 65,66,67,68 Ethernet18/1 17 +Ethernet72 77,78,79,80 Ethernet19/1 18 +Ethernet76 73,74,75,76 Ethernet20/1 19 +Ethernet80 85,86,87,88 Ethernet21/1 20 +Ethernet84 81,82,83,84 Ethernet22/1 21 +Ethernet88 93,94,95,96 Ethernet23/1 22 +Ethernet92 89,90,91,92 Ethernet24/1 23 +Ethernet96 101,102,103,104 Ethernet25/1 24 +Ethernet100 97,98,99,100 Ethernet26/1 25 +Ethernet104 109,110,111,112 Ethernet27/1 26 +Ethernet108 105,106,107,108 Ethernet28/1 27 +Ethernet112 117,118,119,120 Ethernet29/1 28 +Ethernet116 113,114,115,116 Ethernet30/1 29 +Ethernet120 125,126,127,128 Ethernet31/1 30 +Ethernet124 121,122,123,124 Ethernet32/1 31 From 72412797ff911dee502df40f2a26e635012cad76 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Thu, 14 Sep 2017 04:11:08 +0000 Subject: [PATCH 33/77] [mellanox]: Update Mellanox SAI version ansd SDK version --- platform/mellanox/mlnx-sai.mk | 4 ++-- platform/mellanox/sdk.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index fbf4f94b590e..d9ee588a0dfe 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIRel1.8.2-master -MLNX_SAI_REVISION = 6b094746adc7ef2321701b4868806bc54a95bbd1 +MLNX_SAI_VERSION = sonic1.9.1fixes-master +MLNX_SAI_REVISION = 4ebc01e95b754c56da7f8b5fb45b82fbe661d05a export MLNX_SAI_VERSION MLNX_SAI_REVISION diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 56e3145945f8..7c517627c23d 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,5 +1,5 @@ -MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/sonicv1.0.2/sdk -MLNX_SDK_VERSION = 4.2.5008 +MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/4ebc01e95b754c56da7f8b5fb45b82fbe661d05a/sdk +MLNX_SDK_VERSION = 4.2.5010 MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2) $(SX_ACL_RM) $(SX_COMPLIB) \ $(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \ $(SXD_LIBS) $(TESTX) From 2e3975d6ed76fe674bcb3fa88f493d913acacccd Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Wed, 13 Sep 2017 21:23:06 -0700 Subject: [PATCH 34/77] [config] Fix an issue that bgp asn data type is not consistent (#953) * Fix an issue that bgp asn data type is not consistent from minigraph parser and DB * Fix test typo --- dockers/docker-fpm-frr/bgpd.conf.j2 | 6 +++--- dockers/docker-fpm-gobgp/gobgpd.conf.j2 | 2 +- dockers/docker-fpm-quagga/bgpd.conf.j2 | 2 +- src/sonic-config-engine/minigraph.py | 6 +++--- src/sonic-config-engine/tests/test_cfggen.py | 5 +++++ 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index f17464e3f893..5452a976368a 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -48,7 +48,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endblock vlan_advertisement %} {% block bgp_sessions %} {% for neighbor_addr, bgp_session in BGP_NEIGHBOR.iteritems() %} -{% if bgp_session['asn'] != 0 %} +{% if bgp_session['asn'] | int != 0 %} neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} {% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} @@ -57,7 +57,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if neighbor_addr | ipv4 %} address-family ipv4 neighbor {{ neighbor_addr }} activate -{% if bgp_session['rrclient'] != 0 %} +{% if bgp_session['rrclient'] | int != 0 %} neighbor {{ neighbor_addr }} route-reflector-client {% endif %} maximum-paths 64 @@ -66,7 +66,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if neighbor_addr | ipv6 %} address-family ipv6 neighbor {{ neighbor_addr }} activate -{% if bgp_session['rrclient'] != 0 %} +{% if bgp_session['rrclient'] | int != 0 %} neighbor {{ neighbor_addr }} route-reflector-client {% endif %} maximum-paths 64 diff --git a/dockers/docker-fpm-gobgp/gobgpd.conf.j2 b/dockers/docker-fpm-gobgp/gobgpd.conf.j2 index c51c10563b59..a4fb80bf11ca 100644 --- a/dockers/docker-fpm-gobgp/gobgpd.conf.j2 +++ b/dockers/docker-fpm-gobgp/gobgpd.conf.j2 @@ -2,7 +2,7 @@ as = {{ DEVICE_METADATA['localhost']['bgp_asn'] }} router-id = "{{ LOOPBACK_INTERFACE.keys()[0][1] }}" {% for neighbor_addr, bgp_session in BGP_NEIGHBOR.iteritems() %} -{% if bgp_session['asn'] != 0 %} +{% if bgp_session['asn'] | int != 0 %} [[neighbors]] [neighbors.config] peer-as = {{ bgp_session['asn'] }} diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index 295cb2563aff..61d8f8ef3159 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -62,7 +62,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endblock vlan_advertisement %} {% block bgp_sessions %} {% for neighbor_addr, bgp_session in BGP_NEIGHBOR.iteritems() %} -{% if bgp_session['asn'] != 0 %} +{% if bgp_session['asn'] | int != 0 %} neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} {% if bgp_session.has_key('admin_status') and bgp_session['admin_status'] == 'down' or not bgp_session.has_key('admin_status') and DEVICE_METADATA['localhost'].has_key('default_bgp_status') and DEVICE_METADATA['localhost']['default_bgp_status'] == 'down' %} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 7cf4d2f829cc..b5e97b485b44 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -238,7 +238,7 @@ def parse_cpg(cpg, hname): else: rrclient = '0' if hostname == hname: - myasn = int(asn) + myasn = asn peers = router.find(str(QName(ns1, "Peers"))) for bgpPeer in peers.findall(str(QName(ns, "BGPPeer"))): addr = bgpPeer.find(str(QName(ns, "Address"))).text @@ -254,8 +254,8 @@ def parse_cpg(cpg, hname): for peer in bgp_sessions: bgp_session = bgp_sessions[peer] if hostname == bgp_session['name']: - bgp_session['asn'] = int(asn) - bgp_session['rrclient'] = int(rrclient) + bgp_session['asn'] = asn + bgp_session['rrclient'] = rrclient return bgp_sessions, myasn, bgp_peers_with_range diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index cf0eb4d8cc5c..4303f5a2492d 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -110,6 +110,11 @@ def test_minigraph_neighbors(self): output = self.run_script(argument) self.assertEqual(output.strip(), "{'mgmt_addr': None, 'hwsku': 'Arista', 'lo_addr': None, 'local_port': 'Ethernet112', 'type': 'LeafRouter', 'port': 'Ethernet1/1'}") + def test_minigraph_bgp(self): + argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v "BGP_NEIGHBOR[\'10.0.0.59\']"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "{'rrclient': '0', 'local_addr': '10.0.0.58', 'asn': '64600', 'name': 'ARISTA02T1'}") + def test_minigraph_peers_with_range(self): argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v BGP_PEER_RANGE.values\(\)' output = self.run_script(argument) From 56ae5edc7f6ee26926bad236378f55a45b72d083 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 14 Sep 2017 08:43:02 -0700 Subject: [PATCH 35/77] [service template] Starting new docker when HWSKU change is detected (#946) Existing dockers has paths mounted according to the HWSKU. When HWSKU changes, these dockers need to be destroyed and recreated with the correct paths mounted. --- files/build_templates/docker_image_ctl.j2 | 72 ++++++++++++++++------- 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 042db764df97..a7aee83c70e6 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -1,36 +1,68 @@ #!/bin/bash -# Obtain our platform and HWSKU as we will mount directories with these names in each docker -PLATFORM=`sonic-cfggen -v platform` +function getMountPoint() +{ + echo $1 | python -c "import sys, json, os; mnts = [x for x in json.load(sys.stdin)[0]['Mounts'] if x['Destination'] == '/usr/share/sonic/hwsku']; print '' if len(mnts) == 0 else os.path.basename(mnts[0]['Source'])" 2>/dev/null +} + +function postStartAction() +{ {%- if docker_container_name != "database" %} + : +{%- else %} + while true; do + if [[ "$(docker exec -i database redis-cli ping)" =~ PONG.* ]]; then + break + fi + sleep 1 + done +{%- endif %} +} + +# Obtain our platform as we will mount directories with these names in each docker +PLATFORM=`sonic-cfggen -v platform` + +{%- if docker_container_name == "database" %} +# Don't mount HWSKU in {{docker_container_name}} container. +HWSKU="" +{%- else %} +# Obtain our HWSKU as we will mount directories with these names in each docker HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'` {%- endif %} start() { - docker inspect --type container {{docker_container_name}} &>/dev/null + DOCKERCHECK=`docker inspect --type container {{docker_container_name}} 2>/dev/null` if [ "$?" -eq "0" ]; then - docker start {{docker_container_name}} - else + DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"` + if [ "$DOCKERMOUNT" == "$HWSKU" ]; then + echo "Starting existing {{docker_container_name}} container with HWSKU $HWSKU" + docker start {{docker_container_name}} + postStartAction + exit 0 + fi + + # docker created with a different HWSKU, remove and recreate + echo "Removing obsolete {{docker_container_name}} container with HWSKU $DOCKERMOUNT" + docker rm {{docker_container_name}} + fi - docker run -d {{docker_image_run_opt}} \ +{%- if docker_container_name == "database" %} + echo "Starting new {{docker_container_name}} container" +{%- else %} + echo "Starting new {{docker_container_name}} container with HWSKU $HWSKU" +{%- endif %} + docker run -d {{docker_image_run_opt}} \ {%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} - --log-opt max-size=2M --log-opt max-file=5 \ + --log-opt max-size=2M --log-opt max-file=5 \ {%- endif %} - -v /var/run/redis:/var/run/redis:rw \ - -v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \ + -v /var/run/redis:/var/run/redis:rw \ + -v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \ {%- if docker_container_name != "database" %} - -v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \ -{%- endif %} - --name={{docker_container_name}} {{docker_image_name}}:latest - fi -{%- if docker_container_name == "database" %} - while true; do - if [[ "$(docker exec -i database redis-cli ping)" =~ PONG.* ]]; then - break - fi - sleep 1 - done + -v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \ {%- endif %} + --name={{docker_container_name}} {{docker_image_name}}:latest + + postStartAction } attach() { From 3cbc080f7b3f4b65662795de4bdf832676bc8d7f Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Fri, 15 Sep 2017 11:15:04 -0700 Subject: [PATCH 36/77] [sairedis]: update sairedis submodule head (#956) This submodule update includes the deadlock fixes. --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 7e70b4d63020..4d7deba9354c 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 7e70b4d63020fc9ea1aa009c264e4effab7bcda0 +Subproject commit 4d7deba9354c922d18d75325dcd4255f4096560f From 48fd6fb4ec7f8111573131a3c57e7670ad29238e Mon Sep 17 00:00:00 2001 From: Shu0T1an ChenG Date: Thu, 14 Sep 2017 15:26:26 -0700 Subject: [PATCH 37/77] [swss]: Move swss/common/sairedis submodule to 201709 tag --- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-swss b/src/sonic-swss index eaccf67cabd2..7f5eca5e858f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit eaccf67cabd22df0ff7d0117fe55f4261bc961d9 +Subproject commit 7f5eca5e858f6a82966eed4564ded4c3646424bf diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 4f917f2cc345..96018b55e29a 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 4f917f2cc345c54d1bf9d9f01d96e4c01071ac9a +Subproject commit 96018b55e29a31ff22c50db30843d98eff847c35 From 034b47df6c9becc615bfbef5ec28bc55044d8cbe Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Fri, 15 Sep 2017 11:39:29 -0700 Subject: [PATCH 38/77] [Broadcom]: Update OpenNSL/SAI version (#959) --- platform/broadcom/sai.mk | 6 ++---- platform/broadcom/sdk.mk | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 60a1d1f15eb7..7118da438b22 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,11 +1,9 @@ BRCM_SAI = libsaibcm_3.0.3.2_amd64.deb -# TODO: upload new SAI build to blob -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2_amd64.deb" +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2_amd64.deb?sv=2015-04-05&sr=b&sig=d50c3WTnlQGVgybK4RyNFWqvXPHPpAotNSongSABpWg%3D&se=2031-05-25T18%3A52%3A35Z&sp=r" BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -# TODO: upload new SAI build to blob -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2_amd64.deb" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2_amd64.deb?sv=2015-04-05&sr=b&sig=psB%2BzhbludRstCuuGncrMOg5oETOY13U26yEXyR2yWc%3D&se=2031-05-25T18%3A50%3A38Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) diff --git a/platform/broadcom/sdk.mk b/platform/broadcom/sdk.mk index 76a7671599f2..701994c81073 100644 --- a/platform/broadcom/sdk.mk +++ b/platform/broadcom/sdk.mk @@ -1,5 +1,4 @@ BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb -# TODO: upload new SDK build to blob -$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb" +$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb?sv=2015-04-05&sr=b&sig=Qjb29DKq2%2FAvRJAju%2FU91Gu5orJC0R5LTJ%2BwYm%2BYFiA%3D&se=2031-05-25T18%3A36%3A33Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_OPENNSL_KERNEL) From 9d321fade60e6f55f1c17d693032530c81434ed4 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Fri, 15 Sep 2017 23:17:32 -0700 Subject: [PATCH 39/77] [syncd]: Comment out unused docker-ptf-brcm.mk --- platform/broadcom/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 21af44775dd3..b52118570251 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -15,7 +15,7 @@ include $(PLATFORM_PATH)/raw-image.mk include $(PLATFORM_PATH)/one-aboot.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/python-saithrift.mk -include $(PLATFORM_PATH)/docker-ptf-brcm.mk +#include $(PLATFORM_PATH)/docker-ptf-brcm.mk BCMCMD = bcmcmd $(BCMCMD)_URL = "https://sonicstorage.blob.core.windows.net/packages/20170518/bcmcmd?sv=2015-04-05&sr=b&sig=OCW4mfmbQ6D0BH8nllpAWrS8XL9uczrw32w3XgL4jws%3D&se=2030-03-31T23%3A06%3A15Z&sp=r" From 6935e00909d521a6ecb2cdf7ec04a31131f86a53 Mon Sep 17 00:00:00 2001 From: padmanarayana Date: Mon, 18 Sep 2017 00:11:30 +0530 Subject: [PATCH 40/77] [build/onie installer] Install grub for SONiC post migration from another NOS (#949) * Install grub for SONiC post migration from another NOS * Install grub from bundled debian package instead of using ONIE's. Address review comments --- build_debian.sh | 9 ++- files/image_config/platform/rc.local | 106 ++++++++++++++++++++++++++- installer/x86_64/install.sh | 11 ++- 3 files changed, 121 insertions(+), 5 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 21c370753592..9bdda3451009 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -63,6 +63,7 @@ if [[ -d $FILESYSTEM_ROOT ]]; then fi mkdir -p $FILESYSTEM_ROOT mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR +mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime ## Build a basic Debian system by debootstrap @@ -205,7 +206,13 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in curl \ kexec-tools \ less \ - unzip + unzip \ + gdisk + +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y download \ + grub-pc-bin + +sudo mv $FILESYSTEM_ROOT/grub-pc-bin*.deb $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub ## Disable kexec supported reboot which was installed by default sudo sed -i 's/LOAD_KEXEC=true/LOAD_KEXEC=false/' $FILESYSTEM_ROOT/etc/default/kexec diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 8b8db4a261c3..d3ecba7d8518 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -29,6 +29,7 @@ if [ ! -e /host/machine.conf ]; then done fi + migration="TRUE" umount /mnt/onie-boot fi @@ -36,6 +37,26 @@ fi echo "install platform dependent packages at the first boot time" +firsttime_exit() +{ + rm /host/image-$sonic_version/platform/firsttime + exit 0 +} + +# Given a string of tuples of the form field=value, extract the value for a field +# In : $string, $field +# Out: $value +value_extract() +{ +set -- $string +for x in "$@"; do + case "$x" in + $field=*) + value="${x#$field=}" + esac +done +} + sonic_version=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") if [ -f /host/image-$sonic_version/platform/firsttime ]; then @@ -46,8 +67,7 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then platform=$onie_platform else echo "Unknown sonic platform" - rm /host/image-$sonic_version/platform/firsttime - exit 0 + firsttime_exit fi # Try to take old configuration saved during installation @@ -76,6 +96,88 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then dpkg -i /host/image-$sonic_version/platform/$platform/*.deb fi + # If the unit booted into SONiC from another NOS's grub, + # we now install a grub for SONiC. + if [ -n "$onie_platform" ] && [ -n "$migration" ]; then + + grub_bin=$(ls /host/image-$sonic_version/platform/x86_64-grub/grub-pc-bin*.deb 2> /dev/null) + if [ -z "$grub_bin" ]; then + echo "Unable to locate grub package !" >> /etc/migration.log + firsttime_exit + fi + + dpkg -i $grub_bin > /dev/null 2>&1 + if [ $? != 0 ]; then + echo "Unable to install grub package !" >> /etc/migration.log + firsttime_exit + fi + + # Determine the block device to install grub + sonic_dev=$(blkid | grep SONiC-OS | head -n 1 | awk '{print $1}' | sed -e 's/[0-9]:.*$//') + if [ -z "$sonic_dev" ]; then + echo "Unable to determine sonic partition !" >> /etc/migration.log + firsttime_exit + fi + + grub-install --boot-directory=/host --recheck $sonic_dev 2>/dev/null + if [ $? != 0 ]; then + echo "grub install failed !" >> /etc/migration.log + firsttime_exit + fi + + # The SONiC "raw" build mode has already generated a proto grub.cfg + # as part of the migration. Platform specific constants need to be + # retrieved from installer.conf (if present) and assigned. + . /usr/share/sonic/device/$platform/installer.conf + + if [ ! -z "$CONSOLE_PORT" ]; then + field="\-\-port" + string=$(grep $field /host/grub.cfg) + value_extract $string $field + console_port=$value + if [ ! -z "$console_port" ] && [ "$console_port" != "$CONSOLE_PORT" ]; then + sed -i -e "s/\-\-port=$console_port/\-\-port=$CONSOLE_PORT/g" /host/grub.cfg + fi + echo "grub.cfg console port=$console_port & installer.conf CONSOLE_PORT=$CONSOLE_PORT" >> /etc/migration.log + fi + + if [ ! -z "$CONSOLE_DEV" ]; then + field="console" + string=$(grep $field /host/grub.cfg) + value_extract $string $field + console_dev_name=$(echo $value | sed -e "s/^.*=//" -e "s/,.*//") + console_dev="${console_dev_name#ttyS}" + if [ "$console_dev" != "$CONSOLE_DEV" ]; then + sed -i -e "s/console=ttyS$console_dev/console=ttyS$CONSOLE_DEV/g" /host/grub.cfg + fi + echo "grub.cfg console dev=$console_dev & installer.conf CONSOLE_DEV=$CONSOLE_DEV" >> /etc/migration.log + fi + + if [ ! -z "$VAR_LOG_SIZE" ]; then + field="var_log_size" + string=$(grep $field /host/grub.cfg) + value_extract $string $field + var_log_size=$value + if [ ! -z "$var_log_size" ] && [ "$var_log_size" != "$VAR_LOG_SIZE" ]; then + sed -i -e "s/var_log_size=$var_log_size/var_log_size=$VAR_LOG_SIZE/g" /host/grub.cfg + fi + echo "grub.cfg var_log_size=$var_log_size & installer.conf VAR_LOG_SIZE=$VAR_LOG_SIZE" >> /etc/migration.log + fi + + # Set the root based on the label + sonic_root=$(blkid | grep SONiC-OS | head -n 1 | awk '{print $1}' | sed -e 's/:.*$//') + sonic_root=$(echo "$sonic_root" | sed 's/\//\\\//g') + sed -i -e "s/%%SONIC_ROOT%%/$sonic_root/g" /host/grub.cfg + + # Add the Diag and ONIE entries + mount $onie_dev /mnt/onie-boot + . /mnt/onie-boot/onie/grub.d/50_onie_grub >> /host/grub.cfg + umount /mnt/onie-boot + + # Initialize the SONiC's grub config + mv /host/grub.cfg /host/grub/grub.cfg + fi + rm /host/image-$sonic_version/platform/firsttime fi diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index 46942d6d58c3..358da41071b5 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -423,7 +423,7 @@ else demo_mnt="build_raw_image_mnt" demo_dev=$cur_wd/"%%OUTPUT_RAW_IMAGE%%" - mkfs.ext4 $demo_dev + mkfs.ext4 -L $demo_volume_label $demo_dev echo "Mounting $demo_dev on $demo_mnt..." mkdir $demo_mnt @@ -535,6 +535,12 @@ if [ "$install_env" = "sonic" ]; then onie_menuentry=$(cat /host/grub/grub.cfg | sed "/menuentry ONIE/,/}/!d") fi +if [ "$install_env" = "build" ]; then + grub_cfg_root=%%SONIC_ROOT%% +else + grub_cfg_root=$demo_dev +fi + cat <> $grub_cfg menuentry '$demo_grub_entry' { search --no-floppy --label --set=root $demo_volume_label @@ -543,7 +549,7 @@ menuentry '$demo_grub_entry' { if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 - linux /$image_dir/boot/vmlinuz-3.16.0-4-amd64 root=$demo_dev rw $GRUB_CMDLINE_LINUX \ + linux /$image_dir/boot/vmlinuz-3.16.0-4-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \ loop=$image_dir/$FILESYSTEM_SQUASHFS loopfstype=squashfs \ apparmor=1 security=apparmor varlog_size=$VAR_LOG_SIZE $ONIE_PLATFORM_EXTRA_CMDLINE_LINUX echo 'Loading $demo_volume_label $demo_type initial ramdisk ...' @@ -564,6 +570,7 @@ EOF fi if [ "$install_env" = "build" ]; then + cp $grub_cfg $demo_mnt/grub.cfg umount $demo_mnt else cp $grub_cfg $onie_initrd_tmp/$demo_mnt/grub/grub.cfg From aa55b832a4c09da21d6c46a628581282e2a0cec6 Mon Sep 17 00:00:00 2001 From: wadelnn Date: Mon, 18 Sep 2017 06:38:51 +0800 Subject: [PATCH 41/77] [Ingrasys] Update Ingrasys submodule for S8900-54XC (#954) - What I did Update Ingrasys submodule for S8900-54XC QSFP reset function. - How I did it Add reset init scripts in S8900-54XC init function. - How to verify it Used the command "sfputil reset Ethernet48" to verify reset function. If no error occurs, it is passed. - Description for the changelog Update Ingrasys submodule for S8900-54XC QSFP reset function - A picture of a cute animal (not mandatory but encouraged) --- platform/broadcom/sonic-platform-modules-ingrasys | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-ingrasys b/platform/broadcom/sonic-platform-modules-ingrasys index 00ea01132665..2725c0f1d1db 160000 --- a/platform/broadcom/sonic-platform-modules-ingrasys +++ b/platform/broadcom/sonic-platform-modules-ingrasys @@ -1 +1 @@ -Subproject commit 00ea0113266590a5b17b923f017b52cab373234e +Subproject commit 2725c0f1d1db4a3301c00fac8d7e3bc028a37bce From aa549f208c78959aa09c3b3346d27fbfc1d11ed4 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Mon, 18 Sep 2017 13:04:29 -0700 Subject: [PATCH 42/77] [bgp]: Fix the deployment_id with DEVICE_METADATA (#962) --- dockers/docker-fpm-quagga/bgpd.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index 61d8f8ef3159..0ef144016246 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -94,7 +94,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% for bgp_peer in BGP_PEER_RANGE.values() %} neighbor {{ bgp_peer['name'] }} peer-group neighbor {{ bgp_peer['name'] }} passive - neighbor {{ bgp_peer['name'] }} remote-as {{deployment_id_asn_map[deployment_id] }} + neighbor {{ bgp_peer['name'] }} remote-as {{ deployment_id_asn_map[DEVICE_METADATA['localhost']['deployment_id']] }} neighbor {{ bgp_peer['name'] }} ebgp-multihop 255 neighbor {{ bgp_peer['name'] }} soft-reconfiguration inbound neighbor {{ bgp_peer['name'] }} update-source Loopback0 From a376c86b5c1d24bb1ffacc063a66418aba4dd596 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Mon, 18 Sep 2017 17:23:19 -0700 Subject: [PATCH 43/77] [swss]: Fix the command to get HWSKU with sonic-cfggen (#964) --- dockers/docker-orchagent/swssconfig.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index ff2953f94730..f075ca4f22ac 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -35,7 +35,7 @@ function fast_reboot { # Restore FDB and ARP table ASAP fast_reboot -HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -d -v DEVICE_METADATA["localhost"]["hwsku"]` +HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -d -v "DEVICE_METADATA['localhost']['hwsku']"` SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json ports.json " From 5ba6f53eedb2f804567cdd696f95f880860875fd Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Mon, 18 Sep 2017 18:46:51 -0700 Subject: [PATCH 44/77] Update sonic-utilities to be compatible with #942 (#965) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index a7be3b7ed905..b48573fce38a 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit a7be3b7ed905c753f785629ab85007008214ba62 +Subproject commit b48573fce38ad476fd9dccb11f57099085cc87d5 From 9139c7fe64108722770529d22e3d18102dad2bab Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Tue, 19 Sep 2017 12:27:18 -0700 Subject: [PATCH 45/77] Always start with Forwarding State flag set for bgpd (#963) --- dockers/docker-fpm-quagga/supervisord.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-fpm-quagga/supervisord.conf b/dockers/docker-fpm-quagga/supervisord.conf index 5a310a790f18..92d806ff281c 100644 --- a/dockers/docker-fpm-quagga/supervisord.conf +++ b/dockers/docker-fpm-quagga/supervisord.conf @@ -36,7 +36,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:bgpd] -command=/usr/lib/quagga/bgpd -A 127.0.0.1 +command=/usr/lib/quagga/bgpd -A 127.0.0.1 -F priority=5 autostart=false autorestart=false From 458093fee5a53105e937612b38a15f38966a89dc Mon Sep 17 00:00:00 2001 From: ravijo2 Date: Tue, 19 Sep 2017 16:23:31 -0700 Subject: [PATCH 46/77] Framework to plugin Organization specific scripts during ONIE Image build (#951) * Framework to plugin Organization specific scripts * Framework to plugin Organization specific scripts * Framework to plugin Organization specific scripts * add getopt option to organization script --- build_debian.sh | 8 +++ .../organization_extensions.sh | 52 +++++++++++++++++++ rules/config | 3 ++ slave.mk | 2 + 4 files changed, 65 insertions(+) create mode 100755 files/build_templates/organization_extensions.sh diff --git a/build_debian.sh b/build_debian.sh index 9bdda3451009..a21cdada0243 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -322,6 +322,14 @@ if [ -f sonic_debian_extension.sh ]; then ./sonic_debian_extension.sh $FILESYSTEM_ROOT $PLATFORM_DIR fi +## Organization specific extensions such as Configuration & Scripts for features like AAA, ZTP... +if [ "${enable_organization_extensions}" = "y" ]; then + if [ -f files/build_templates/organization_extensions.sh ]; then + sudo chmod 755 files/build_templates/organization_extensions.sh + ./files/build_templates/organization_extensions.sh -f $FILESYSTEM_ROOT -h $HOSTNAME + fi +fi + ## Clean up apt sudo LANG=C chroot $FILESYSTEM_ROOT apt-get autoremove sudo LANG=C chroot $FILESYSTEM_ROOT apt-get autoclean diff --git a/files/build_templates/organization_extensions.sh b/files/build_templates/organization_extensions.sh new file mode 100755 index 000000000000..db05a4e3f59d --- /dev/null +++ b/files/build_templates/organization_extensions.sh @@ -0,0 +1,52 @@ +#!/bin/bash +######################################################################### +## This script is to automate Orignaization specific extensions # +## such as Configuration & Scripts for features like AAA, ZTP, etc. # +## to include in ONIE installer image # +## # +## USAGE: # +## ./organization_extensions.sh -f -n # +## ./organization_extensions.sh \ # +## --fsroot \ # +## --hostname # +## PARAMETERS: # +## -f FILESYSTEM_ROOT # +## The location of the root file system # +## -h HOSTNAME # +## The hostname of the target system # +######################################################################### + +## Initialize the arguments to default values. +## The values get updated to user provided value, if supplied +FILESYSTEM_ROOT=./fsroot +HOSTNAME=sonic + +# read the options +TEMP=`getopt -o f:h: --long fsroot:,hostname: -- "$@"` +eval set -- "$TEMP" + +# extract options and their arguments into variables. +while true ; do + case "$1" in + -f|--fsroot) + case "$2" in + "") shift 2 ;; + *) FILESYSTEM_ROOT=$2 ; shift 2 ;; + esac ;; + -h|--hostname) + case "$2" in + "") shift 2 ;; + *) HOSTNAME=$2 ; shift 2 ;; + esac ;; + --) shift ; break ;; + *) echo "Internal error!" ; exit 1 ;; + esac +done + +echo "Executing SONIC Organization Extensions" + +## Place your Organization specific code / scipts here ... + + +echo "SONIC Organization Extensions - Done" + diff --git a/rules/config b/rules/config index 2d6e6a82b6a8..ad13ad047e04 100644 --- a/rules/config +++ b/rules/config @@ -48,3 +48,6 @@ SONIC_ROUTING_STACK = quagga # ENABLE_SYNCD_RPC - build docker-syncd with rpc packages for testing purposes. # Uncomment to enable: # ENABLE_SYNCD_RPC = y + +# Enable Origanization Extensions - Specific to the deployment scenarios of the Organization +ENABLE_ORGANIZATION_EXTENSIONS = y diff --git a/slave.mk b/slave.mk index caed4279dcc3..4e76661588fb 100644 --- a/slave.mk +++ b/slave.mk @@ -99,6 +99,7 @@ $(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)") $(info "SONIC_CONFIG_DEBUG" : "$(SONIC_CONFIG_DEBUG)") $(info "ROUTING_STACK" : "$(SONIC_ROUTING_STACK)") $(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)") +$(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info ) ############################################################################### @@ -388,6 +389,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform export image_type="$($*_IMAGE_TYPE)" export sonicadmin_user="$(USERNAME)" export sonic_asic_platform="$(CONFIGURED_PLATFORM)" + export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)" export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)" export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)" export installer_debs="$(addprefix $(DEBS_PATH)/,$($*_DEPENDS))" From 72f5d6bcb76dbec35e22c496af776a8b8da35a1a Mon Sep 17 00:00:00 2001 From: Prince Sunny Date: Tue, 19 Sep 2017 19:29:00 -0700 Subject: [PATCH 47/77] [interfaces]: Change MTU value to 9100 (#967) * Updated MTU to the widely used value with other devices --- files/image_config/interfaces/interfaces.j2 | 6 +- .../tests/sample_output/interfaces | 64 +++++++++---------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index f96c0740c572..fe1fac2cc77e 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -50,7 +50,7 @@ iface eth0 inet dhcp {% for (name, prefix) in INTERFACE %} allow-hotplug {{ name }} iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static - mtu 9216 + mtu 9100 address {{ prefix | ip }} netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # @@ -61,7 +61,7 @@ iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static {% for member in VLAN[vlan]['members'] %} allow-hotplug {{ member }} iface {{ member }} inet manual - pre-up ifconfig {{ member }} up mtu 9216 + pre-up ifconfig {{ member }} up mtu 9100 post-up brctl addif {{ vlan }} {{ member }} || true post-down ifconfig {{ member }} down # @@ -102,7 +102,7 @@ iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static {% for (name, prefix) in PORTCHANNEL_INTERFACE.keys() | sort %} allow-hotplug {{ name }} iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static - mtu 9216 + mtu 9100 address {{ prefix | ip }} netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index aed23f8a5c26..9f262a7f6b05 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -42,145 +42,145 @@ iface eth0 inet6 static # "|| true" is added to suppress the error when interface is already a member of VLAN allow-hotplug fortyGigE0/4 iface fortyGigE0/4 inet manual - pre-up ifconfig fortyGigE0/4 up mtu 9216 + pre-up ifconfig fortyGigE0/4 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/4 || true post-down ifconfig fortyGigE0/4 down # allow-hotplug fortyGigE0/8 iface fortyGigE0/8 inet manual - pre-up ifconfig fortyGigE0/8 up mtu 9216 + pre-up ifconfig fortyGigE0/8 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/8 || true post-down ifconfig fortyGigE0/8 down # allow-hotplug fortyGigE0/12 iface fortyGigE0/12 inet manual - pre-up ifconfig fortyGigE0/12 up mtu 9216 + pre-up ifconfig fortyGigE0/12 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/12 || true post-down ifconfig fortyGigE0/12 down # allow-hotplug fortyGigE0/16 iface fortyGigE0/16 inet manual - pre-up ifconfig fortyGigE0/16 up mtu 9216 + pre-up ifconfig fortyGigE0/16 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/16 || true post-down ifconfig fortyGigE0/16 down # allow-hotplug fortyGigE0/20 iface fortyGigE0/20 inet manual - pre-up ifconfig fortyGigE0/20 up mtu 9216 + pre-up ifconfig fortyGigE0/20 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/20 || true post-down ifconfig fortyGigE0/20 down # allow-hotplug fortyGigE0/24 iface fortyGigE0/24 inet manual - pre-up ifconfig fortyGigE0/24 up mtu 9216 + pre-up ifconfig fortyGigE0/24 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/24 || true post-down ifconfig fortyGigE0/24 down # allow-hotplug fortyGigE0/28 iface fortyGigE0/28 inet manual - pre-up ifconfig fortyGigE0/28 up mtu 9216 + pre-up ifconfig fortyGigE0/28 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/28 || true post-down ifconfig fortyGigE0/28 down # allow-hotplug fortyGigE0/32 iface fortyGigE0/32 inet manual - pre-up ifconfig fortyGigE0/32 up mtu 9216 + pre-up ifconfig fortyGigE0/32 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/32 || true post-down ifconfig fortyGigE0/32 down # allow-hotplug fortyGigE0/36 iface fortyGigE0/36 inet manual - pre-up ifconfig fortyGigE0/36 up mtu 9216 + pre-up ifconfig fortyGigE0/36 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/36 || true post-down ifconfig fortyGigE0/36 down # allow-hotplug fortyGigE0/40 iface fortyGigE0/40 inet manual - pre-up ifconfig fortyGigE0/40 up mtu 9216 + pre-up ifconfig fortyGigE0/40 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/40 || true post-down ifconfig fortyGigE0/40 down # allow-hotplug fortyGigE0/44 iface fortyGigE0/44 inet manual - pre-up ifconfig fortyGigE0/44 up mtu 9216 + pre-up ifconfig fortyGigE0/44 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/44 || true post-down ifconfig fortyGigE0/44 down # allow-hotplug fortyGigE0/48 iface fortyGigE0/48 inet manual - pre-up ifconfig fortyGigE0/48 up mtu 9216 + pre-up ifconfig fortyGigE0/48 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/48 || true post-down ifconfig fortyGigE0/48 down # allow-hotplug fortyGigE0/52 iface fortyGigE0/52 inet manual - pre-up ifconfig fortyGigE0/52 up mtu 9216 + pre-up ifconfig fortyGigE0/52 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/52 || true post-down ifconfig fortyGigE0/52 down # allow-hotplug fortyGigE0/56 iface fortyGigE0/56 inet manual - pre-up ifconfig fortyGigE0/56 up mtu 9216 + pre-up ifconfig fortyGigE0/56 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/56 || true post-down ifconfig fortyGigE0/56 down # allow-hotplug fortyGigE0/60 iface fortyGigE0/60 inet manual - pre-up ifconfig fortyGigE0/60 up mtu 9216 + pre-up ifconfig fortyGigE0/60 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/60 || true post-down ifconfig fortyGigE0/60 down # allow-hotplug fortyGigE0/64 iface fortyGigE0/64 inet manual - pre-up ifconfig fortyGigE0/64 up mtu 9216 + pre-up ifconfig fortyGigE0/64 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/64 || true post-down ifconfig fortyGigE0/64 down # allow-hotplug fortyGigE0/68 iface fortyGigE0/68 inet manual - pre-up ifconfig fortyGigE0/68 up mtu 9216 + pre-up ifconfig fortyGigE0/68 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/68 || true post-down ifconfig fortyGigE0/68 down # allow-hotplug fortyGigE0/72 iface fortyGigE0/72 inet manual - pre-up ifconfig fortyGigE0/72 up mtu 9216 + pre-up ifconfig fortyGigE0/72 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/72 || true post-down ifconfig fortyGigE0/72 down # allow-hotplug fortyGigE0/76 iface fortyGigE0/76 inet manual - pre-up ifconfig fortyGigE0/76 up mtu 9216 + pre-up ifconfig fortyGigE0/76 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/76 || true post-down ifconfig fortyGigE0/76 down # allow-hotplug fortyGigE0/80 iface fortyGigE0/80 inet manual - pre-up ifconfig fortyGigE0/80 up mtu 9216 + pre-up ifconfig fortyGigE0/80 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/80 || true post-down ifconfig fortyGigE0/80 down # allow-hotplug fortyGigE0/84 iface fortyGigE0/84 inet manual - pre-up ifconfig fortyGigE0/84 up mtu 9216 + pre-up ifconfig fortyGigE0/84 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/84 || true post-down ifconfig fortyGigE0/84 down # allow-hotplug fortyGigE0/88 iface fortyGigE0/88 inet manual - pre-up ifconfig fortyGigE0/88 up mtu 9216 + pre-up ifconfig fortyGigE0/88 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/88 || true post-down ifconfig fortyGigE0/88 down # allow-hotplug fortyGigE0/92 iface fortyGigE0/92 inet manual - pre-up ifconfig fortyGigE0/92 up mtu 9216 + pre-up ifconfig fortyGigE0/92 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/92 || true post-down ifconfig fortyGigE0/92 down # allow-hotplug fortyGigE0/96 iface fortyGigE0/96 inet manual - pre-up ifconfig fortyGigE0/96 up mtu 9216 + pre-up ifconfig fortyGigE0/96 up mtu 9100 post-up brctl addif Vlan1000 fortyGigE0/96 || true post-down ifconfig fortyGigE0/96 down # @@ -220,49 +220,49 @@ iface Vlan1000 inet static # Portchannel interfaces allow-hotplug PortChannel01 iface PortChannel01 inet static - mtu 9216 + mtu 9100 address 10.0.0.56 netmask 255.255.255.254 # allow-hotplug PortChannel01 iface PortChannel01 inet6 static - mtu 9216 + mtu 9100 address fc00::71 netmask 126 # allow-hotplug PortChannel02 iface PortChannel02 inet static - mtu 9216 + mtu 9100 address 10.0.0.58 netmask 255.255.255.254 # allow-hotplug PortChannel02 iface PortChannel02 inet6 static - mtu 9216 + mtu 9100 address fc00::75 netmask 126 # allow-hotplug PortChannel03 iface PortChannel03 inet static - mtu 9216 + mtu 9100 address 10.0.0.60 netmask 255.255.255.254 # allow-hotplug PortChannel03 iface PortChannel03 inet6 static - mtu 9216 + mtu 9100 address fc00::79 netmask 126 # allow-hotplug PortChannel04 iface PortChannel04 inet static - mtu 9216 + mtu 9100 address 10.0.0.62 netmask 255.255.255.254 # allow-hotplug PortChannel04 iface PortChannel04 inet6 static - mtu 9216 + mtu 9100 address fc00::7d netmask 126 # From 0c6fba69935907d92ba6b45dd19fa84df9c9c1a5 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 20 Sep 2017 12:39:36 -0700 Subject: [PATCH 48/77] [utilities]: Update sonic-utilities (#968) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b48573fce38a..0338eee64574 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b48573fce38ad476fd9dccb11f57099085cc87d5 +Subproject commit 0338eee645741937603c5686bb86b22cb5ab5322 From d117f093430de0915b3b59dffe2835ab470aeaf5 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 20 Sep 2017 15:18:11 -0700 Subject: [PATCH 49/77] [Broadcom]: Update OpenNSL modules (#970) - Increase the rx_buffer_size to 9238, the same MTU szie as in the hardware --- platform/broadcom/sdk.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/broadcom/sdk.mk b/platform/broadcom/sdk.mk index 701994c81073..04d540c64582 100644 --- a/platform/broadcom/sdk.mk +++ b/platform/broadcom/sdk.mk @@ -1,4 +1,4 @@ -BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb -$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.3_amd64.deb?sv=2015-04-05&sr=b&sig=Qjb29DKq2%2FAvRJAju%2FU91Gu5orJC0R5LTJ%2BwYm%2BYFiA%3D&se=2031-05-25T18%3A36%3A33Z&sp=r" +BRCM_OPENNSL_KERNEL = opennsl-modules-3.16.0-4-amd64_3.2.3.3-1_amd64.deb +$(BRCM_OPENNSL_KERNEL)_URL = "https://sonicstorage.blob.core.windows.net/packages/opennsl-modules-3.16.0-4-amd64_3.2.3.3-1_amd64.deb?sv=2015-04-05&sr=b&sig=Uepf4z2wOadX%2F6OR%2BCoQzjv2tkwEZ2AspBiuo5sb25s%3D&se=2031-05-30T19%3A37%3A19Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_OPENNSL_KERNEL) From 763205ff7d767c77ccb3945b7cd64f176482e648 Mon Sep 17 00:00:00 2001 From: Volodymyr Samotiy Date: Thu, 21 Sep 2017 09:55:50 +0300 Subject: [PATCH 50/77] [config]: Fix management interface configuration (#966) * [config]: Fix management interface configuration * [config]: Fix management interface configuration * Fix comments --- files/image_config/interfaces/interfaces.j2 | 8 ++++---- .../tests/sample_output/interfaces | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index fe1fac2cc77e..6521eb7a67e1 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -27,14 +27,14 @@ iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} ########## management network policy routing rules # management port up rules - up ip route add default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table default - up ip rule add from {{ prefix | ip }}/32 table default + up ip {{ '-4' if prefix | ipv4 else '-6' }} route add default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table default + up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table default {% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} up ip rule add to {{ route }} table default {% endfor %} # management port down rules - down ip route delete default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table default - down ip rule delete from {{ prefix | ip }}/32 table default + down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table default + down ip {{ '-4' if prefix | ipv4 else '-6' }} rule delete from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table default {% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %} down ip rule delete to {{ route }} table default {% endfor %} diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index 9f262a7f6b05..ec3b6f740bc4 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -22,21 +22,21 @@ iface eth0 inet static netmask 255.255.255.0 ########## management network policy routing rules # management port up rules - up ip route add default via 10.0.0.1 dev eth0 table default - up ip rule add from 10.0.0.100/32 table default + up ip -4 route add default via 10.0.0.1 dev eth0 table default + up ip -4 rule add from 10.0.0.100/32 table default # management port down rules - down ip route delete default via 10.0.0.1 dev eth0 table default - down ip rule delete from 10.0.0.100/32 table default + down ip -4 route delete default via 10.0.0.1 dev eth0 table default + down ip -4 rule delete from 10.0.0.100/32 table default iface eth0 inet6 static address 2603:10e2:0:2902::8 netmask 64 ########## management network policy routing rules # management port up rules - up ip route add default via 2603:10e2:0:2902::1 dev eth0 table default - up ip rule add from 2603:10e2:0:2902::8/32 table default + up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default + up ip -6 rule add from 2603:10e2:0:2902::8/128 table default # management port down rules - down ip route delete default via 2603:10e2:0:2902::1 dev eth0 table default - down ip rule delete from 2603:10e2:0:2902::8/32 table default + down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default + down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default # # The switch front panel interfaces # "|| true" is added to suppress the error when interface is already a member of VLAN From e0513d213bb6fa014262d24be265af93bba495e9 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Thu, 21 Sep 2017 09:17:29 -0700 Subject: [PATCH 51/77] lacp runner will send lacp update right after it received SIGINT (#969) --- ...r-will-send-lacp-update-right-after-.patch | 98 +++++++++++++++++++ src/libteam/Makefile | 1 + 2 files changed, 99 insertions(+) create mode 100644 src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch diff --git a/src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch b/src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch new file mode 100644 index 000000000000..1cae8bad21aa --- /dev/null +++ b/src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch @@ -0,0 +1,98 @@ +From 417e9dfdccbbee2cf86e46e994e8ece3433b46a4 Mon Sep 17 00:00:00 2001 +From: Pavel Shirshov +Date: Wed, 20 Sep 2017 00:34:07 +0000 +Subject: [PATCH] [teamd] lacp runner will send lacp update right after it + received SIGINT signal + +--- + teamd/teamd.c | 1 + + teamd/teamd.h | 3 +++ + teamd/teamd_events.c | 13 +++++++++++++ + teamd/teamd_runner_lacp.c | 10 ++++++++++ + 4 files changed, 27 insertions(+) + +diff --git a/teamd/teamd.c b/teamd/teamd.c +index aac2511..c987333 100644 +--- a/teamd/teamd.c ++++ b/teamd/teamd.c +@@ -386,6 +386,7 @@ static int teamd_run_loop_run(struct teamd_context *ctx) + case 'q': + if (quit_in_progress) + return -EBUSY; ++ teamd_refresh_ports(ctx); + err = teamd_flush_ports(ctx); + if (err) + return err; +diff --git a/teamd/teamd.h b/teamd/teamd.h +index 5dbfb9b..ef0fb1c 100644 +--- a/teamd/teamd.h ++++ b/teamd/teamd.h +@@ -189,11 +189,14 @@ struct teamd_event_watch_ops { + struct teamd_port *tdport, void *priv); + int (*port_ifname_changed)(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv); ++ void (*refresh)(struct teamd_context *ctx, ++ struct teamd_port *tdport, void *priv); + int (*option_changed)(struct teamd_context *ctx, + struct team_option *option, void *priv); + char *option_changed_match_name; + }; + ++void teamd_refresh_ports(struct teamd_context *ctx); + int teamd_event_port_added(struct teamd_context *ctx, + struct teamd_port *tdport); + void teamd_event_port_removed(struct teamd_context *ctx, +diff --git a/teamd/teamd_events.c b/teamd/teamd_events.c +index 1a95974..5c2ef56 100644 +--- a/teamd/teamd_events.c ++++ b/teamd/teamd_events.c +@@ -34,6 +34,19 @@ struct event_watch_item { + void *priv; + }; + ++void teamd_refresh_ports(struct teamd_context *ctx) ++{ ++ struct teamd_port *tdport; ++ struct event_watch_item *watch; ++ ++ teamd_for_each_tdport(tdport, ctx) { ++ list_for_each_node_entry(watch, &ctx->event_watch_list, list) { ++ if (!watch->ops->refresh) continue; ++ watch->ops->refresh(ctx, tdport, watch->priv); ++ } ++ } ++} ++ + int teamd_event_port_added(struct teamd_context *ctx, + struct teamd_port *tdport) + { +diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c +index 9c77fae..e38c291 100644 +--- a/teamd/teamd_runner_lacp.c ++++ b/teamd/teamd_runner_lacp.c +@@ -1383,12 +1383,22 @@ static int lacp_event_watch_port_changed(struct teamd_context *ctx, + return lacp_port_link_update(lacp_port); + } + ++static void lacp_event_watch_refresh(struct teamd_context *ctx, struct teamd_port *tdport, void *priv) ++{ ++ struct lacp *lacp = priv; ++ ++ struct lacp_port *lacp_port = lacp_port_get(lacp, tdport); ++ if (lacp_port_selected(lacp_port)) ++ (void) lacpdu_send(lacp_port); ++} ++ + static const struct teamd_event_watch_ops lacp_event_watch_ops = { + .hwaddr_changed = lacp_event_watch_hwaddr_changed, + .port_added = lacp_event_watch_port_added, + .port_removed = lacp_event_watch_port_removed, + .port_changed = lacp_event_watch_port_changed, + .admin_state_changed = lacp_event_watch_admin_state_changed, ++ .refresh = lacp_event_watch_refresh, + }; + + static int lacp_carrier_init(struct teamd_context *ctx, struct lacp *lacp) +-- +2.7.4 + diff --git a/src/libteam/Makefile b/src/libteam/Makefile index 283a6b56fbec..c84250749477 100644 --- a/src/libteam/Makefile +++ b/src/libteam/Makefile @@ -17,6 +17,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Apply patch git apply ../0001-libteam-Add-team_get_port_enabled-function.patch git apply ../0002-libteam-Temporarily-remove-redundant-debug-mes.patch + git apply ../0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch popd # Obtain debian packaging From 0d978b5b21bb6a2876aa34e0b7334536c71a63f4 Mon Sep 17 00:00:00 2001 From: lguohan Date: Thu, 21 Sep 2017 12:31:02 -0700 Subject: [PATCH 52/77] [sairedis]: update sairedis submodule (#974) --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 3cbff4026f2b..79bd891ca533 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 3cbff4026f2bb1afda1c5965db60d30666980675 +Subproject commit 79bd891ca5337222701cd51ee5b266d2e485c492 From 69ff2241699ad37e31f7c2953d748ab7397f9d80 Mon Sep 17 00:00:00 2001 From: Polly Hsu Date: Fri, 22 Sep 2017 03:37:22 +0800 Subject: [PATCH 53/77] [device/accton]: Add a new supported device, AS7312-54X (#955) * [device/accton]: Add a new supported device and platform, AS7312-54X Switch Vendor: Edge-core Switch SKU: AS7312-54X ASIC Vendor: Broadcom Swich ASIC: Tomahawk Port Configuration: 48x25G + 6x100G SONiC Image: SONiC-ONIE-Broadcom Signed-off-by: polly_hsu@accton.com * Update port_config.ini * Update sai.profile * Update installer.conf * Update led_proc_init.soc * Update minigraph.xml --- .../Accton-AS7312-54X/port_config.ini | 55 + .../Accton-AS7312-54X/sai.profile | 1 + .../installer.conf | 3 + .../led_proc_init.soc | 79 ++ .../x86_64-accton_as7312_54x-r0/minigraph.xml | 1184 +++++++++++++++++ 5 files changed, 1322 insertions(+) create mode 100644 device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/port_config.ini create mode 100644 device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/sai.profile create mode 100644 device/accton/x86_64-accton_as7312_54x-r0/installer.conf create mode 100755 device/accton/x86_64-accton_as7312_54x-r0/led_proc_init.soc create mode 100644 device/accton/x86_64-accton_as7312_54x-r0/minigraph.xml diff --git a/device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/port_config.ini b/device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/port_config.ini new file mode 100644 index 000000000000..8eeb6a993cb5 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/port_config.ini @@ -0,0 +1,55 @@ +# name lanes alias +Ethernet0 41 twentyfiveGigE1 +Ethernet1 42 twentyfiveGigE2 +Ethernet2 43 twentyfiveGigE3 +Ethernet3 44 twentyfiveGigE4 +Ethernet4 49 twentyfiveGigE5 +Ethernet5 50 twentyfiveGigE6 +Ethernet6 51 twentyfiveGigE7 +Ethernet7 52 twentyfiveGigE8 +Ethernet8 53 twentyfiveGigE9 +Ethernet9 54 twentyfiveGigE10 +Ethernet10 55 twentyfiveGigE11 +Ethernet11 56 twentyfiveGigE12 +Ethernet12 65 twentyfiveGigE13 +Ethernet13 66 twentyfiveGigE14 +Ethernet14 67 twentyfiveGigE15 +Ethernet15 68 twentyfiveGigE16 +Ethernet16 33 twentyfiveGigE17 +Ethernet17 34 twentyfiveGigE18 +Ethernet18 35 twentyfiveGigE19 +Ethernet19 36 twentyfiveGigE20 +Ethernet20 37 twentyfiveGigE21 +Ethernet21 38 twentyfiveGigE22 +Ethernet22 39 twentyfiveGigE23 +Ethernet23 40 twentyfiveGigE24 +Ethernet24 69 twentyfiveGigE25 +Ethernet25 70 twentyfiveGigE26 +Ethernet26 71 twentyfiveGigE27 +Ethernet27 72 twentyfiveGigE28 +Ethernet28 81 twentyfiveGigE29 +Ethernet29 82 twentyfiveGigE30 +Ethernet30 83 twentyfiveGigE31 +Ethernet31 84 twentyfiveGigE32 +Ethernet32 85 twentyfiveGigE33 +Ethernet33 86 twentyfiveGigE34 +Ethernet34 87 twentyfiveGigE35 +Ethernet35 88 twentyfiveGigE36 +Ethernet36 97 twentyfiveGigE37 +Ethernet37 98 twentyfiveGigE38 +Ethernet38 99 twentyfiveGigE39 +Ethernet39 100 twentyfiveGigE40 +Ethernet40 101 twentyfiveGigE41 +Ethernet41 102 twentyfiveGigE42 +Ethernet42 103 twentyfiveGigE43 +Ethernet43 104 twentyfiveGigE44 +Ethernet44 105 twentyfiveGigE45 +Ethernet45 106 twentyfiveGigE46 +Ethernet46 107 twentyfiveGigE47 +Ethernet47 108 twentyfiveGigE48 +Ethernet48 5,6,7,8 hundredGigE49 +Ethernet52 1,2,3,4 hundredGigE50 +Ethernet56 109,110,111,112 hundredGigE51 +Ethernet60 21,22,23,24 hundredGigE52 +Ethernet64 9,10,11,12 hundredGigE53 +Ethernet68 117,118,119,120 hundredGigE54 diff --git a/device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/sai.profile b/device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/sai.profile new file mode 100644 index 000000000000..f239b822834b --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/Accton-AS7312-54X/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/etc/bcm/th-as7312-48x25G+6x100G.config.bcm diff --git a/device/accton/x86_64-accton_as7312_54x-r0/installer.conf b/device/accton/x86_64-accton_as7312_54x-r0/installer.conf new file mode 100644 index 000000000000..14404194ef53 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/installer.conf @@ -0,0 +1,3 @@ +CONSOLE_PORT=0x2f8 +CONSOLE_DEV=1 +CONSOLE_SPEED=115200 diff --git a/device/accton/x86_64-accton_as7312_54x-r0/led_proc_init.soc b/device/accton/x86_64-accton_as7312_54x-r0/led_proc_init.soc new file mode 100755 index 000000000000..3074649497e0 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/led_proc_init.soc @@ -0,0 +1,79 @@ +# accton_as7312_54x 48x25G+6x100G SDK port LED macro init SOC +s CMIC_LEDUP0_DATA_RAM 0 +s CMIC_LEDUP1_DATA_RAM 0 + +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=63 REMAP_PORT_1=63 REMAP_PORT_2=63 REMAP_PORT_3=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=63 REMAP_PORT_5=63 REMAP_PORT_6=63 REMAP_PORT_7=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=27 REMAP_PORT_9=26 REMAP_PORT_10=25 REMAP_PORT_11=24 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=63 REMAP_PORT_13=63 REMAP_PORT_14=63 REMAP_PORT_15=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=63 REMAP_PORT_17=63 REMAP_PORT_18=63 REMAP_PORT_19=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=31 REMAP_PORT_21=30 REMAP_PORT_22=29 REMAP_PORT_23=28 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=15 REMAP_PORT_25=14 REMAP_PORT_26=13 REMAP_PORT_27=12 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=19 REMAP_PORT_29=18 REMAP_PORT_30=17 REMAP_PORT_31=16 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=63 REMAP_PORT_33=63 REMAP_PORT_34=63 REMAP_PORT_35=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=63 REMAP_PORT_37=63 REMAP_PORT_38=63 REMAP_PORT_39=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=35 REMAP_PORT_41=34 REMAP_PORT_42=33 REMAP_PORT_43=32 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=63 REMAP_PORT_45=63 REMAP_PORT_46=63 REMAP_PORT_47=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=23 REMAP_PORT_49=22 REMAP_PORT_50=21 REMAP_PORT_51=20 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 REMAP_PORT_53=10 REMAP_PORT_54=9 REMAP_PORT_55=8 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 REMAP_PORT_57=6 REMAP_PORT_58=5 REMAP_PORT_59=4 +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 REMAP_PORT_61=2 REMAP_PORT_62=1 REMAP_PORT_63=0 + +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=19 REMAP_PORT_1=18 REMAP_PORT_2=17 REMAP_PORT_3=16 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=23 REMAP_PORT_5=22 REMAP_PORT_6=21 REMAP_PORT_7=20 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=3 REMAP_PORT_9=2 REMAP_PORT_10=1 REMAP_PORT_11=0 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=63 REMAP_PORT_13=63 REMAP_PORT_14=63 REMAP_PORT_15=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=7 REMAP_PORT_17=6 REMAP_PORT_18=5 REMAP_PORT_19=4 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=11 REMAP_PORT_21=10 REMAP_PORT_22=9 REMAP_PORT_23=8 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=63 REMAP_PORT_25=63 REMAP_PORT_26=63 REMAP_PORT_27=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=63 REMAP_PORT_29=63 REMAP_PORT_30=63 REMAP_PORT_31=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=15 REMAP_PORT_33=14 REMAP_PORT_34=13 REMAP_PORT_35=12 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=27 REMAP_PORT_37=26 REMAP_PORT_38=25 REMAP_PORT_39=24 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=63 REMAP_PORT_41=63 REMAP_PORT_42=63 REMAP_PORT_43=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=63 REMAP_PORT_45=63 REMAP_PORT_46=63 REMAP_PORT_47=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=31 REMAP_PORT_49=30 REMAP_PORT_50=29 REMAP_PORT_51=28 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=35 REMAP_PORT_53=34 REMAP_PORT_54=33 REMAP_PORT_55=32 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=63 REMAP_PORT_57=63 REMAP_PORT_58=63 REMAP_PORT_59=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=63 REMAP_PORT_61=63 REMAP_PORT_62=63 REMAP_PORT_63=63 + +led 0 stop +led 0 prog \ + 02 FD 42 80 02 FF 42 00 02 FE 42 00 02 FA 42 7E \ + 02 FB 42 24 06 F9 D2 00 74 1E 02 F9 42 03 67 AC \ + 67 C3 67 52 86 FE 67 C3 67 52 86 FE 67 C3 67 52 \ + 86 FE 67 C3 67 52 86 FE 06 FB D6 FE 74 1E 86 FC \ + 3E FA 06 FE 88 4A 03 71 4C 67 84 57 67 84 57 67 \ + 98 57 06 FE 88 80 4A 00 27 97 75 4F 90 4A 00 27 \ + 4A 01 27 B7 97 71 69 77 42 06 F9 D6 FC 74 7C 02 \ + F9 4A 07 37 4E 07 02 FC 42 00 4E 07 06 F9 0A 07 \ + 71 4F 77 42 16 FF 06 FD 17 4D DA 07 74 95 12 FF \ + 52 00 86 FD 57 86 FF 57 16 FF 06 FD 07 4D DA 07 \ + 74 A9 12 FF 52 00 86 FD 57 86 FF 57 06 FE C2 FC \ + 98 98 12 F4 50 C2 FC 98 98 F2 F0 14 06 F4 C2 03 \ + 88 77 D1 06 FE C2 FC 98 98 F2 E0 14 06 FE C2 03 \ + 88 18 71 E2 80 18 71 DD 67 98 67 98 57 67 98 67 \ + 84 57 80 18 71 EB 67 84 67 98 57 67 84 67 84 57 \ + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 0 start +led auto on + +led 1 stop +led 1 prog \ + 02 FD 42 80 02 FF 42 00 02 FE 42 00 02 FA 42 7E \ + 02 FB 42 24 06 F9 D2 00 74 1E 02 F9 42 03 67 AC \ + 67 C3 67 52 86 FE 67 C3 67 52 86 FE 67 C3 67 52 \ + 86 FE 67 C3 67 52 86 FE 06 FB D6 FE 74 1E 86 FC \ + 3E FA 06 FE 88 4A 03 71 4C 67 84 57 67 84 57 67 \ + 98 57 06 FE 88 80 4A 00 27 97 75 4F 90 4A 00 27 \ + 4A 01 27 B7 97 71 69 77 42 06 F9 D6 FC 74 7C 02 \ + F9 4A 07 37 4E 07 02 FC 42 00 4E 07 06 F9 0A 07 \ + 71 4F 77 42 16 FF 06 FD 17 4D DA 07 74 95 12 FF \ + 52 00 86 FD 57 86 FF 57 16 FF 06 FD 07 4D DA 07 \ + 74 A9 12 FF 52 00 86 FD 57 86 FF 57 06 FE C2 FC \ + 98 98 12 F4 50 C2 FC 98 98 F2 F0 14 06 F4 C2 03 \ + 88 77 D1 06 FE C2 FC 98 98 F2 E0 14 06 FE C2 03 \ + 88 18 71 E2 80 18 71 DD 67 98 67 98 57 67 98 67 \ + 84 57 80 18 71 EB 67 84 67 98 57 67 84 67 84 57 \ + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 1 start +led auto on diff --git a/device/accton/x86_64-accton_as7312_54x-r0/minigraph.xml b/device/accton/x86_64-accton_as7312_54x-r0/minigraph.xml new file mode 100644 index 000000000000..8547ceacbc58 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/minigraph.xml @@ -0,0 +1,1184 @@ + + + + + + ARISTA01T0 + 10.0.0.33 + switch1 + 10.0.0.32 + 1 + 180 + 60 + + + switch1 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 180 + 60 + + + ARISTA02T0 + 10.0.0.35 + switch1 + 10.0.0.34 + 1 + 180 + 60 + + + switch1 + 10.0.0.2 + ARISTA02T2 + 10.0.0.3 + 1 + 180 + 60 + + + ARISTA03T0 + 10.0.0.37 + switch1 + 10.0.0.36 + 1 + 180 + 60 + + + switch1 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 180 + 60 + + + ARISTA04T0 + 10.0.0.39 + switch1 + 10.0.0.38 + 1 + 180 + 60 + + + switch1 + 10.0.0.6 + ARISTA04T2 + 10.0.0.7 + 1 + 180 + 60 + + + ARISTA05T0 + 10.0.0.41 + switch1 + 10.0.0.40 + 1 + 180 + 60 + + + switch1 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 180 + 60 + + + ARISTA06T0 + 10.0.0.43 + switch1 + 10.0.0.42 + 1 + 180 + 60 + + + switch1 + 10.0.0.10 + ARISTA06T2 + 10.0.0.11 + 1 + 180 + 60 + + + ARISTA07T0 + 10.0.0.45 + switch1 + 10.0.0.44 + 1 + 180 + 60 + + + switch1 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 180 + 60 + + + ARISTA08T0 + 10.0.0.47 + switch1 + 10.0.0.46 + 1 + 180 + 60 + + + switch1 + 10.0.0.14 + ARISTA08T2 + 10.0.0.15 + 1 + 180 + 60 + + + ARISTA09T0 + 10.0.0.49 + switch1 + 10.0.0.48 + 1 + 180 + 60 + + + switch1 + 10.0.0.16 + ARISTA09T2 + 10.0.0.17 + 1 + 180 + 60 + + + ARISTA10T0 + 10.0.0.51 + switch1 + 10.0.0.50 + 1 + 180 + 60 + + + switch1 + 10.0.0.18 + ARISTA10T2 + 10.0.0.19 + 1 + 180 + 60 + + + ARISTA11T0 + 10.0.0.53 + switch1 + 10.0.0.52 + 1 + 180 + 60 + + + switch1 + 10.0.0.20 + ARISTA11T2 + 10.0.0.21 + 1 + 180 + 60 + + + ARISTA12T0 + 10.0.0.55 + switch1 + 10.0.0.54 + 1 + 180 + 60 + + + switch1 + 10.0.0.22 + ARISTA12T2 + 10.0.0.23 + 1 + 180 + 60 + + + ARISTA13T0 + 10.0.0.57 + switch1 + 10.0.0.56 + 1 + 180 + 60 + + + switch1 + 10.0.0.24 + ARISTA13T2 + 10.0.0.25 + 1 + 180 + 60 + + + ARISTA14T0 + 10.0.0.59 + switch1 + 10.0.0.58 + 1 + 180 + 60 + + + switch1 + 10.0.0.26 + ARISTA14T2 + 10.0.0.27 + 1 + 180 + 60 + + + ARISTA15T0 + 10.0.0.61 + switch1 + 10.0.0.60 + 1 + 180 + 60 + + + switch1 + 10.0.0.28 + ARISTA15T2 + 10.0.0.29 + 1 + 180 + 60 + + + ARISTA16T0 + 10.0.0.63 + switch1 + 10.0.0.62 + 1 + 180 + 60 + + + switch1 + 10.0.0.30 + ARISTA16T2 + 10.0.0.31 + 1 + 180 + 60 + + + + + 65100 + switch1 + + +
10.0.0.33
+ + +
+ +
10.0.0.1
+ + +
+ +
10.0.0.35
+ + +
+ +
10.0.0.3
+ + +
+ +
10.0.0.37
+ + +
+ +
10.0.0.5
+ + +
+ +
10.0.0.39
+ + +
+ +
10.0.0.7
+ + +
+ +
10.0.0.41
+ + +
+ +
10.0.0.9
+ + +
+ +
10.0.0.43
+ + +
+ +
10.0.0.11
+ + +
+ +
10.0.0.45
+ + +
+ +
10.0.0.13
+ + +
+ +
10.0.0.47
+ + +
+ +
10.0.0.15
+ + +
+ +
10.0.0.49
+ + +
+ +
10.0.0.17
+ + +
+ +
10.0.0.51
+ + +
+ +
10.0.0.19
+ + +
+ +
10.0.0.53
+ + +
+ +
10.0.0.21
+ + +
+ +
10.0.0.55
+ + +
+ +
10.0.0.23
+ + +
+ +
10.0.0.57
+ + +
+ +
10.0.0.25
+ + +
+ +
10.0.0.59
+ + +
+ +
10.0.0.27
+ + +
+ +
10.0.0.61
+ + +
+ +
10.0.0.29
+ + +
+ +
10.0.0.63
+ + +
+ +
10.0.0.31
+ + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 65200 + ARISTA02T2 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 65200 + ARISTA04T2 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 65200 + ARISTA06T2 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 65200 + ARISTA08T2 + + + + 64009 + ARISTA09T0 + + + + 65200 + ARISTA09T2 + + + + 64010 + ARISTA10T0 + + + + 65200 + ARISTA10T2 + + + + 64011 + ARISTA11T0 + + + + 65200 + ARISTA11T2 + + + + 64012 + ARISTA12T0 + + + + 65200 + ARISTA12T2 + + + + 64013 + ARISTA13T0 + + + + 65200 + ARISTA13T2 + + + + 64014 + ARISTA14T0 + + + + 65200 + ARISTA14T2 + + + + 64015 + ARISTA15T0 + + + + 65200 + ARISTA15T2 + + + + 64016 + ARISTA16T0 + + + + 65200 + ARISTA16T2 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + + + + + + switch1 + + + + + + Ethernet0 + 10.0.0.0/31 + + + + Ethernet1 + 10.0.0.2/31 + + + + Ethernet2 + 10.0.0.4/31 + + + + Ethernet3 + 10.0.0.6/31 + + + + Ethernet4 + 10.0.0.8/31 + + + + Ethernet5 + 10.0.0.10/31 + + + + Ethernet6 + 10.0.0.12/31 + + + + Ethernet7 + 10.0.0.14/31 + + + + Ethernet8 + 10.0.0.16/31 + + + + Ethernet9 + 10.0.0.18/31 + + + + Ethernet10 + 10.0.0.20/31 + + + + Ethernet11 + 10.0.0.22/31 + + + + Ethernet12 + 10.0.0.24/31 + + + + Ethernet13 + 10.0.0.26/31 + + + + Ethernet14 + 10.0.0.28/31 + + + + Ethernet15 + 10.0.0.30/31 + + + + Ethernet16 + 10.0.0.32/31 + + + + Ethernet17 + 10.0.0.34/31 + + + + Ethernet18 + 10.0.0.36/31 + + + + Ethernet19 + 10.0.0.38/31 + + + + Ethernet20 + 10.0.0.40/31 + + + + Ethernet21 + 10.0.0.42/31 + + + + Ethernet22 + 10.0.0.44/31 + + + + Ethernet23 + 10.0.0.46/31 + + + + Ethernet24 + 10.0.0.48/31 + + + + Ethernet25 + 10.0.0.50/31 + + + + Ethernet26 + 10.0.0.52/31 + + + + Ethernet27 + 10.0.0.54/31 + + + + Ethernet28 + 10.0.0.56/31 + + + + Ethernet29 + 10.0.0.58/31 + + + + Ethernet30 + 10.0.0.60/31 + + + + Ethernet31 + 10.0.0.62/31 + + + + Ethernet32 + 10.0.0.64/31 + + + + Ethernet33 + 10.0.0.66/31 + + + + Ethernet34 + 10.0.0.68/31 + + + + Ethernet35 + 10.0.0.70/31 + + + + Ethernet36 + 10.0.0.72/31 + + + + Ethernet37 + 10.0.0.74/31 + + + + Ethernet38 + 10.0.0.76/31 + + + + Ethernet39 + 10.0.0.78/31 + + + + Ethernet40 + 10.0.0.80/31 + + + + Ethernet41 + 10.0.0.82/31 + + + + Ethernet42 + 10.0.0.84/31 + + + + Ethernet43 + 10.0.0.86/31 + + + + Ethernet44 + 10.0.0.88/31 + + + + Ethernet45 + 10.0.0.90/31 + + + + Ethernet46 + 10.0.0.92/31 + + + + Ethernet47 + 10.0.0.94/31 + + + + Ethernet48 + 10.0.0.96/31 + + + + Ethernet52 + 10.0.0.98/31 + + + + Ethernet56 + 10.0.0.100/31 + + + + Ethernet60 + 10.0.0.102/31 + + + + Ethernet64 + 10.0.0.104/31 + + + + Ethernet68 + 10.0.0.106/31 + + + + + + + + + + + + DeviceInterfaceLink + switch1 + Ethernet0 + ARISTA01T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet1 + ARISTA02T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet2 + ARISTA03T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet3 + ARISTA04T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet4 + ARISTA05T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet5 + ARISTA06T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet6 + ARISTA07T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet7 + ARISTA08T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet8 + ARISTA09T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet9 + ARISTA10T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet10 + ARISTA11T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet11 + ARISTA12T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet12 + ARISTA13T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet13 + ARISTA14T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet14 + ARISTA15T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet15 + ARISTA16T2 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet16 + ARISTA01T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet17 + ARISTA02T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet18 + ARISTA03T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet19 + ARISTA04T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet20 + ARISTA05T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet21 + ARISTA06T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet22 + ARISTA07T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet23 + ARISTA08T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet24 + ARISTA09T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet25 + ARISTA10T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet26 + ARISTA11T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet27 + ARISTA12T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet28 + ARISTA13T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet29 + ARISTA14T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet30 + ARISTA15T0 + Ethernet1 + + + DeviceInterfaceLink + switch1 + Ethernet31 + ARISTA16T0 + Ethernet1 + + + + + switch1 + Accton-AS7312-54X + + + + + + + switch1 + + + DhcpResources + + + + + NtpResources + + 0.debian.pool.ntp.org;1.debian.pool.ntp.org;2.debian.pool.ntp.org;3.debian.pool.ntp.org + + + SyslogResources + + + + + + + + + switch1 + Accton-AS7312-54X +
From 7a9894a99cc5992f96b7f046032de5bdb8072806 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 21 Sep 2017 13:19:44 -0700 Subject: [PATCH 54/77] [Broadcom]: Update libsai version to 3.0.3.2-2 (#973) Update Ingrasys/Accton config.bcm files --- platform/broadcom/sai.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 7118da438b22..ca1c76a32ff8 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,9 +1,9 @@ -BRCM_SAI = libsaibcm_3.0.3.2_amd64.deb -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2_amd64.deb?sv=2015-04-05&sr=b&sig=d50c3WTnlQGVgybK4RyNFWqvXPHPpAotNSongSABpWg%3D&se=2031-05-25T18%3A52%3A35Z&sp=r" +BRCM_SAI = libsaibcm_3.0.3.2-2_amd64.deb +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-2_amd64.deb?sv=2015-04-05&sr=b&sig=A9GjUgI9%2B7kRQHsCFqH07iRQLhdkwSH5tvSXepb3b%2BA%3D&se=2031-05-30T22%3A47%3A47Z&sp=r" -BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2_amd64.deb +BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-2_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2_amd64.deb?sv=2015-04-05&sr=b&sig=psB%2BzhbludRstCuuGncrMOg5oETOY13U26yEXyR2yWc%3D&se=2031-05-25T18%3A50%3A38Z&sp=r" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-2_amd64.deb?sv=2015-04-05&sr=b&sig=lDIwnDNHIA0WKc5ggTA4x3pVmBIM%2Bdib0hR7H1qyTe0%3D&se=2031-05-30T22%3A48%3A07Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) From 0f6c8c14e8ed38bcceb6bc31c990dc0a177e0ceb Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 21 Sep 2017 14:56:16 -0700 Subject: [PATCH 55/77] [teamd]: Remove deprecated blocking logic before starting teamd (#976) With the fixes in /etc/network/interfaces file, host interfaces could be added into the corresponding LAGs automatically. Thus, the logic of checking if port initialization is ready is no longer needed. Signed-off-by: Shu0T1an ChenG --- dockers/docker-teamd/teamd.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/dockers/docker-teamd/teamd.sh b/dockers/docker-teamd/teamd.sh index 37b617150a04..2b6d9fb53970 100755 --- a/dockers/docker-teamd/teamd.sh +++ b/dockers/docker-teamd/teamd.sh @@ -24,15 +24,5 @@ function clean_up { trap clean_up SIGTERM SIGKILL -# Before teamd could automatically add newly created host interfaces into the -# LAG, this workaround will wait until the host interfaces are created and then -# the processes will be started. -while true; do - # Check if front-panel ports are configured - result=`echo -en "SELECT 0\nHGETALL PORT_TABLE:ConfigDone" | redis-cli | sed -n 3p` - if [ "$result" == "0" ]; then - start_app - read - fi - sleep 1 -done +start_app +read From bec99f257a0af3fe60e441704cf5b43377249ec6 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Thu, 21 Sep 2017 17:31:39 -0700 Subject: [PATCH 56/77] Disable snmpd module disk_hw, so no syslog messages about unavailable disks (#977) * Revert "snmpd ignores unavailable disks (#607)" This reverts commit d70e9734966e542e0a0ed0f29eb5d128931f7b8f. * Disable snmpd module disk_hw, so no syslog messages about unavailable disks Signed-off-by: Qi Luo * Strip white spaces Signed-off-by: Qi Luo --- dockers/docker-snmp-sv2/snmpd.conf.j2 | 11 +++-------- dockers/docker-snmp-sv2/supervisord.conf | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/dockers/docker-snmp-sv2/snmpd.conf.j2 b/dockers/docker-snmp-sv2/snmpd.conf.j2 index 246924cfd387..b46871dfd6f8 100644 --- a/dockers/docker-snmp-sv2/snmpd.conf.j2 +++ b/dockers/docker-snmp-sv2/snmpd.conf.j2 @@ -28,7 +28,7 @@ agentAddress udp:{{ prefix | ip }}:161 {% endif %} {% endfor %} {% else %} -# Listen on all addresses as mgmt ip not specified +# Listen on all addresses as mgmt ip not specified agentAddress udp:161 {% endif %} @@ -61,7 +61,7 @@ sysServices 72 # # Process Monitoring # -# TODO: should we enable snmp based monitoring of sswsyncd and other processes? +# todo: should we enable snmp based monitoring of sswsyncd and other processes? # At least one 'sendmail' process, but no more than 10 #proc sendmail 10 1 @@ -76,12 +76,7 @@ sysServices 72 # 10MBs required on root disk, 5% free on /var, 10% free on all other disks disk / 10000 disk /var 5% - -# Note: includeAllDisks will conflict with ignoredisk -# TODO: /root/* are introduced by aufs union mount, happening in initramfs stage. Clean them in the mount list. -ignoredisk /root/host -ignoredisk /root/dev -ignoredisk /root/dev/pts +includeAllDisks 10% # Walk the UCD-SNMP-MIB::dskTable to see the resulting output # Note that this table will be empty if there are no "disk" entries in the snmpd.conf file diff --git a/dockers/docker-snmp-sv2/supervisord.conf b/dockers/docker-snmp-sv2/supervisord.conf index 60313c57f813..d80579506100 100644 --- a/dockers/docker-snmp-sv2/supervisord.conf +++ b/dockers/docker-snmp-sv2/supervisord.conf @@ -20,7 +20,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:snmpd] -command=/usr/sbin/snmpd -f -LS4d -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf,ifTable,ifXTable,inetCidrRouteTable,ipCidrRouteTable,ip -p /run/snmpd.pid +command=/usr/sbin/snmpd -f -LS4d -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf,ifTable,ifXTable,inetCidrRouteTable,ipCidrRouteTable,ip,disk_hw -p /run/snmpd.pid priority=3 autostart=false autorestart=false From 1ac10dfc6f42836730d986e3966a05e98b26bc9e Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Fri, 22 Sep 2017 00:52:15 -0700 Subject: [PATCH 57/77] [snmp]: Update sonic-snmpagent submodule (#978) Introducing the fix for SAI 1.0 FDB entry fix --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 186a4f65fbdd..45e4e7826bf3 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 186a4f65fbdde9d277d0aeef562e1fc196266fdb +Subproject commit 45e4e7826bf34850d8cc12861259c5f388e1102e From b5eb0c2ce2f0fd080c2d4f9bc05f0206a26e59f5 Mon Sep 17 00:00:00 2001 From: Rodny Molina Date: Fri, 22 Sep 2017 00:57:23 -0700 Subject: [PATCH 58/77] [Makefile] Allowing interactive session with the slave docker-container (#903) * Fixing a couple of issues to enable FRR to run with latest SONiC code. * Adjusting FRR's jinja template to meet latest sonic-cfgen requirements. Basically, i'm just extending #448 changes into FRR. * Eliminate FRR's integrated-config file to prevent daemons from bypassing their own config files. FRR daemons now default to an integrated-config file for config-parsing purposes. But we are still interested in having each daemon looking in their specific config file (bgpd.conf, zebra.conf, etc). So here i'm just deleting this integrating-config file to prevent FRR from running from a bogus config-file. * Allows interactive session with the slave docker-container after conclusion of the building process. Proposed changes provide a more direct access to the building pipeline, by allowing users to launch consecutive compilation tasks from the same slave container. --- Makefile | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 7240237c2744..d672edc6836a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,18 @@ ############################################################################### ## Wrapper for starting make inside sonic-slave container +# +# Supported parameters: +# +# * PLATFORM: Specific platform we wish to build images for. +# * BUILD_NUMBER: Desired version-number to pass to the building-system. +# * ENABLE_DHCP_GRAPH_SERVICE: Enables get-graph service to fetch minigraph files +# through http. +# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart. +# * SONIC_ENABLE_SYNCD_RPC: Enables rpc-based syncd builds. +# * USERNAME: Desired username -- default at rules/config +# * PASSWORD: Desired password -- default at rules/config +# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes. +# ############################################################################### SHELL = /bin/bash @@ -37,6 +50,16 @@ DOCKER_BUILD = docker build --no-cache \ sonic-slave && \ docker tag $(SLAVE_IMAGE):latest $(SLAVE_IMAGE):$(SLAVE_TAG) +SONIC_BUILD_INSTRUCTION := make \ + -f slave.mk \ + PLATFORM=$(PLATFORM) \ + BUILD_NUMBER=$(BUILD_NUMBER) \ + ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \ + SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \ + SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \ + PASSWORD=$(PASSWORD) \ + USERNAME=$(USERNAME) + .PHONY: sonic-slave-build sonic-slave-bash .DEFAULT_GOAL := all @@ -48,16 +71,11 @@ DOCKER_BUILD = docker build --no-cache \ @docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \ { echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \ $(DOCKER_BUILD) ; } - @$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) make \ - -f slave.mk \ - PLATFORM=$(PLATFORM) \ - BUILD_NUMBER=$(BUILD_NUMBER) \ - ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \ - SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \ - SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \ - PASSWORD=$(PASSWORD) \ - USERNAME=$(USERNAME) \ - $@ +ifeq "$(KEEP_SLAVE_ON)" "yes" + @$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash" +else + @$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) $(SONIC_BUILD_INSTRUCTION) $@ +endif sonic-slave-build : $(DOCKER_BASE_BUILD) From f570616b0dca24d0c38550e5c946e7e9bf00b342 Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Sat, 23 Sep 2017 03:58:10 +0800 Subject: [PATCH 59/77] [Ingrasys]: Change hwmon kernel modules installation order (#980) change hwmon kernel modules installation order on S8810-32Q/S8900-54XC/S8900-64XC/S9100-32X change hwmon kernel modules installation order in i2c_utils.sh and update related fancontrol file Check the hwmon kernel module insertion order in /sys/class/hwmon/hwmonX. w83795 should be in /sys/class/hwmon/hwmon1, and jc42 should be the last one. change hwmon kernel modules installation order on S8810-32Q/S8900-54XC/S8900-64XC/S9100-32X --- .../x86_64-ingrasys_s8810_32q-r0/fancontrol | 17 ++++++++--------- .../x86_64-ingrasys_s8900_54xc-r0/fancontrol | 17 ++++++++--------- .../x86_64-ingrasys_s8900_64xc-r0/fancontrol | 16 ++++++++-------- .../x86_64-ingrasys_s9100-r0/fancontrol | 17 ++++++++--------- .../broadcom/sonic-platform-modules-ingrasys | 2 +- 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/fancontrol b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/fancontrol index 05a71e8d999c..8c378371a9a2 100644 --- a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/fancontrol +++ b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/fancontrol @@ -1,12 +1,11 @@ # Configuration file generated by pwmconfig, changes will be lost INTERVAL=10 -DEVPATH=hwmon2=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f -DEVNAME=hwmon2=w83795adg -FCTEMPS=hwmon2/device/pwm2=hwmon2/device/temp2_input hwmon2/device/pwm1=hwmon2/device/temp2_input -#FCFANS=hwmon2/device/pwm2=hwmon2/device/fan8_input+hwmon2/device/fan7_input+hwmon2/device/fan6_input+hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input+hwmon2/device/fan3_input+hwmon2/device/fan2_input+hwmon2/device/fan1_input -FCFANS=hwmon2/device/pwm2=hwmon2/device/fan8_input hwmon2/device/pwm2=hwmon2/device/fan7_input hwmon2/device/pwm2=hwmon2/device/fan6_input hwmon2/device/pwm2=hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input hwmon2/device/pwm1=hwmon2/device/fan3_input hwmon2/device/pwm1=hwmon2/device/fan2_input hwmon2/device/pwm1=hwmon2/device/fan1_input -MINTEMP=hwmon2/device/pwm2=20 hwmon2/device/pwm1=20 -MAXTEMP=hwmon2/device/pwm2=60 hwmon2/device/pwm1=60 -MINSTART=hwmon2/device/pwm2=75 hwmon2/device/pwm1=75 -MINSTOP=hwmon2/device/pwm2=22 hwmon2/device/pwm1=22 +DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f +DEVNAME=hwmon1=w83795adg +FCTEMPS=hwmon1/device/pwm2=hwmon1/device/temp2_input hwmon1/device/pwm1=hwmon1/device/temp2_input +FCFANS=hwmon1/device/pwm2=hwmon1/device/fan8_input hwmon1/device/pwm2=hwmon1/device/fan7_input hwmon1/device/pwm2=hwmon1/device/fan6_input hwmon1/device/pwm2=hwmon1/device/fan5_input hwmon1/device/pwm1=hwmon1/device/fan4_input hwmon1/device/pwm1=hwmon1/device/fan3_input hwmon1/device/pwm1=hwmon1/device/fan2_input hwmon1/device/pwm1=hwmon1/device/fan1_input +MINTEMP=hwmon1/device/pwm2=20 hwmon1/device/pwm1=20 +MAXTEMP=hwmon1/device/pwm2=60 hwmon1/device/pwm1=60 +MINSTART=hwmon1/device/pwm2=75 hwmon1/device/pwm1=75 +MINSTOP=hwmon1/device/pwm2=22 hwmon1/device/pwm1=22 diff --git a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/fancontrol b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/fancontrol index 827b0539546f..e1f88f6b79c5 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/fancontrol +++ b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/fancontrol @@ -1,11 +1,10 @@ # Configuration file generated by pwmconfig, changes will be lost INTERVAL=10 -DEVPATH=hwmon2=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f -DEVNAME=hwmon2=w83795adg -FCTEMPS=hwmon2/device/pwm2=hwmon2/device/temp2_input hwmon2/device/pwm1=hwmon2/device/temp2_input -#FCFANS=hwmon2/device/pwm2=hwmon2/device/fan8_input+hwmon2/device/fan7_input+hwmon2/device/fan6_input+hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input+hwmon2/device/fan3_input+hwmon2/device/fan2_input+hwmon2/device/fan1_input -FCFANS=hwmon2/device/pwm2=hwmon2/device/fan8_input hwmon2/device/pwm2=hwmon2/device/fan7_input hwmon2/device/pwm2=hwmon2/device/fan6_input hwmon2/device/pwm2=hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input hwmon2/device/pwm1=hwmon2/device/fan3_input hwmon2/device/pwm1=hwmon2/device/fan2_input hwmon2/device/pwm1=hwmon2/device/fan1_input -MINTEMP=hwmon2/device/pwm2=20 hwmon2/device/pwm1=20 -MAXTEMP=hwmon2/device/pwm2=60 hwmon2/device/pwm1=60 -MINSTART=hwmon2/device/pwm2=75 hwmon2/device/pwm1=75 -MINSTOP=hwmon2/device/pwm2=22 hwmon2/device/pwm1=22 +DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f +DEVNAME=hwmon1=w83795adg +FCTEMPS=hwmon1/device/pwm2=hwmon1/device/temp2_input hwmon1/device/pwm1=hwmon1/device/temp2_input +FCFANS=hwmon1/device/pwm2=hwmon1/device/fan8_input hwmon1/device/pwm2=hwmon1/device/fan7_input hwmon1/device/pwm2=hwmon1/device/fan6_input hwmon1/device/pwm2=hwmon1/device/fan5_input hwmon1/device/pwm1=hwmon1/device/fan4_input hwmon1/device/pwm1=hwmon1/device/fan3_input hwmon1/device/pwm1=hwmon1/device/fan2_input hwmon1/device/pwm1=hwmon1/device/fan1_input +MINTEMP=hwmon1/device/pwm2=20 hwmon1/device/pwm1=20 +MAXTEMP=hwmon1/device/pwm2=60 hwmon1/device/pwm1=60 +MINSTART=hwmon1/device/pwm2=75 hwmon1/device/pwm1=75 +MINSTOP=hwmon1/device/pwm2=22 hwmon1/device/pwm1=22 diff --git a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/fancontrol b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/fancontrol index cb07a7a07f4a..4819fe113172 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/fancontrol +++ b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/fancontrol @@ -1,10 +1,10 @@ # Configuration file generated by pwmconfig, changes will be lost INTERVAL=10 -DEVPATH=hwmon2=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f -DEVNAME=hwmon2=w83795adg -FCTEMPS=hwmon2/device/pwm1=hwmon2/device/temp2_input hwmon2/device/pwm2=hwmon2/device/temp2_input -FCFANS=hwmon2/device/pwm2=hwmon2/device/fan10_input hwmon2/device/pwm2=hwmon2/device/fan9_input hwmon2/device/pwm2=hwmon2/device/fan8_input hwmon2/device/pwm2=hwmon2/device/fan7_input hwmon2/device/pwm2=hwmon2/device/fan6_input hwmon2/device/pwm2=hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input hwmon2/device/pwm1=hwmon2/device/fan3_input hwmon2/device/pwm1=hwmon2/device/fan2_input hwmon2/device/pwm1=hwmon2/device/fan1_input -MINTEMP=hwmon2/device/pwm1=20 hwmon2/device/pwm2=20 -MAXTEMP=hwmon2/device/pwm1=60 hwmon2/device/pwm2=60 -MINSTART=hwmon2/device/pwm1=150 hwmon2/device/pwm2=150 -MINSTOP=hwmon2/device/pwm1=0 hwmon2/device/pwm2=0 +DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f +DEVNAME=hwmon1=w83795adg +FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp2_input hwmon1/device/pwm2=hwmon1/device/temp2_input +FCFANS=hwmon1/device/pwm2=hwmon1/device/fan10_input hwmon1/device/pwm2=hwmon1/device/fan9_input hwmon1/device/pwm2=hwmon1/device/fan8_input hwmon1/device/pwm2=hwmon1/device/fan7_input hwmon1/device/pwm2=hwmon1/device/fan6_input hwmon1/device/pwm2=hwmon1/device/fan5_input hwmon1/device/pwm1=hwmon1/device/fan4_input hwmon1/device/pwm1=hwmon1/device/fan3_input hwmon1/device/pwm1=hwmon1/device/fan2_input hwmon1/device/pwm1=hwmon1/device/fan1_input +MINTEMP=hwmon1/device/pwm1=20 hwmon1/device/pwm2=20 +MAXTEMP=hwmon1/device/pwm1=60 hwmon1/device/pwm2=60 +MINSTART=hwmon1/device/pwm1=150 hwmon1/device/pwm2=150 +MINSTOP=hwmon1/device/pwm1=0 hwmon1/device/pwm2=0 diff --git a/device/ingrasys/x86_64-ingrasys_s9100-r0/fancontrol b/device/ingrasys/x86_64-ingrasys_s9100-r0/fancontrol index 827b0539546f..e1f88f6b79c5 100644 --- a/device/ingrasys/x86_64-ingrasys_s9100-r0/fancontrol +++ b/device/ingrasys/x86_64-ingrasys_s9100-r0/fancontrol @@ -1,11 +1,10 @@ # Configuration file generated by pwmconfig, changes will be lost INTERVAL=10 -DEVPATH=hwmon2=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f -DEVNAME=hwmon2=w83795adg -FCTEMPS=hwmon2/device/pwm2=hwmon2/device/temp2_input hwmon2/device/pwm1=hwmon2/device/temp2_input -#FCFANS=hwmon2/device/pwm2=hwmon2/device/fan8_input+hwmon2/device/fan7_input+hwmon2/device/fan6_input+hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input+hwmon2/device/fan3_input+hwmon2/device/fan2_input+hwmon2/device/fan1_input -FCFANS=hwmon2/device/pwm2=hwmon2/device/fan8_input hwmon2/device/pwm2=hwmon2/device/fan7_input hwmon2/device/pwm2=hwmon2/device/fan6_input hwmon2/device/pwm2=hwmon2/device/fan5_input hwmon2/device/pwm1=hwmon2/device/fan4_input hwmon2/device/pwm1=hwmon2/device/fan3_input hwmon2/device/pwm1=hwmon2/device/fan2_input hwmon2/device/pwm1=hwmon2/device/fan1_input -MINTEMP=hwmon2/device/pwm2=20 hwmon2/device/pwm1=20 -MAXTEMP=hwmon2/device/pwm2=60 hwmon2/device/pwm1=60 -MINSTART=hwmon2/device/pwm2=75 hwmon2/device/pwm1=75 -MINSTOP=hwmon2/device/pwm2=22 hwmon2/device/pwm1=22 +DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/0-002f +DEVNAME=hwmon1=w83795adg +FCTEMPS=hwmon1/device/pwm2=hwmon1/device/temp2_input hwmon1/device/pwm1=hwmon1/device/temp2_input +FCFANS=hwmon1/device/pwm2=hwmon1/device/fan8_input hwmon1/device/pwm2=hwmon1/device/fan7_input hwmon1/device/pwm2=hwmon1/device/fan6_input hwmon1/device/pwm2=hwmon1/device/fan5_input hwmon1/device/pwm1=hwmon1/device/fan4_input hwmon1/device/pwm1=hwmon1/device/fan3_input hwmon1/device/pwm1=hwmon1/device/fan2_input hwmon1/device/pwm1=hwmon1/device/fan1_input +MINTEMP=hwmon1/device/pwm2=20 hwmon1/device/pwm1=20 +MAXTEMP=hwmon1/device/pwm2=60 hwmon1/device/pwm1=60 +MINSTART=hwmon1/device/pwm2=75 hwmon1/device/pwm1=75 +MINSTOP=hwmon1/device/pwm2=22 hwmon1/device/pwm1=22 diff --git a/platform/broadcom/sonic-platform-modules-ingrasys b/platform/broadcom/sonic-platform-modules-ingrasys index 2725c0f1d1db..458829af29cc 160000 --- a/platform/broadcom/sonic-platform-modules-ingrasys +++ b/platform/broadcom/sonic-platform-modules-ingrasys @@ -1 +1 @@ -Subproject commit 2725c0f1d1db4a3301c00fac8d7e3bc028a37bce +Subproject commit 458829af29ccbaf71ddc70db292e6a468e0e564c From 948f3ad3ecf4575d3e6d41c772a97e5a545f252f Mon Sep 17 00:00:00 2001 From: Volodymyr Samotiy Date: Mon, 25 Sep 2017 23:22:02 +0300 Subject: [PATCH 60/77] [mellanox]: Update Mellanox SAI version (#979) Signed-off-by: Volodymyr Samotiy --- platform/mellanox/mlnx-sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index d9ee588a0dfe..bba10132160d 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI MLNX_SAI_VERSION = sonic1.9.1fixes-master -MLNX_SAI_REVISION = 4ebc01e95b754c56da7f8b5fb45b82fbe661d05a +MLNX_SAI_REVISION = dc0e84b3762f847369524a917e271ceb2878b4d3 export MLNX_SAI_VERSION MLNX_SAI_REVISION From 8143cb34f23abba3396bc9c8499f697a9a8a05bf Mon Sep 17 00:00:00 2001 From: wadelnn Date: Tue, 26 Sep 2017 08:54:17 +0800 Subject: [PATCH 61/77] [Ingrasys]: Add Ingrasys S8900-64XC sfputil function and update submodule (#984) * Add S8900-64XC SFP QSFP CPLD kernel module. * Fixed QSFP function call in i2c_utils.sh. * Add QSFP monitor service for SFP and QSFP SI. Signed-off-by: Wade He --- .../plugins/sfputil.py | 283 +++++++++++++----- .../broadcom/sonic-platform-modules-ingrasys | 2 +- 2 files changed, 217 insertions(+), 68 deletions(-) diff --git a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/plugins/sfputil.py b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/plugins/sfputil.py index d6573d20d72f..0b1ae8d3bc8e 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/plugins/sfputil.py +++ b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/plugins/sfputil.py @@ -1,24 +1,30 @@ -#!/usr/bin/env python - -import subprocess +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# try: - from sonic_sfp.sfputilbase import sfputilbase -except ImportError, e: - raise ImportError (str(e) + "- required module not found") + import time + import subprocess + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + i2c_set = 'i2cset' +i2c_get = 'i2cget' cpld_addr = '0x33' mux_reg = '0x4A' -class sfputil(sfputilbase): - """Platform specific sfputil class""" +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" - port_start = 0 - port_end = 63 - ports_in_block = 64 + PORT_START = 0 + PORT_END = 63 + QSFP_PORT_START = 48 + PORTS_IN_BLOCK = 64 - port_to_eeprom_mapping = {} + _port_to_eeprom_mapping = {} port_to_i2c_mapping = { 0: [2,1], 1: [2,2], @@ -44,64 +50,207 @@ class sfputil(sfputilbase): 21: [2,22], 22: [2,23], 23: [2,24], - 24: [3,1], - 25: [3,2], - 26: [3,3], - 27: [3,4], - 28: [3,5], - 29: [3,6], - 30: [3,7], - 31: [3,8], - 32: [3,9], - 33: [3,10], - 34: [3,11], - 35: [3,12], - 36: [3,13], - 37: [3,14], - 38: [3,15], - 39: [3,16], - 40: [3,17], - 41: [3,18], - 42: [3,19], - 43: [3,20], - 44: [3,21], - 45: [3,22], - 46: [3,23], - 47: [3,24], - 48: [4,1], - 49: [4,2], - 50: [4,3], - 51: [4,4], - 52: [4,5], - 53: [4,6], - 54: [4,7], - 55: [4,8], - 56: [4,9], - 57: [4,10], - 58: [4,11], - 59: [4,12], - 60: [4,13], - 61: [4,14], - 62: [4,15], - 63: [4,16] + 24: [3,25], + 25: [3,26], + 26: [3,27], + 27: [3,28], + 28: [3,29], + 29: [3,30], + 30: [3,31], + 31: [3,32], + 32: [3,33], + 33: [3,34], + 34: [3,35], + 35: [3,36], + 36: [3,37], + 37: [3,38], + 38: [3,39], + 39: [3,40], + 40: [3,41], + 41: [3,42], + 42: [3,43], + 43: [3,44], + 44: [3,45], + 45: [3,46], + 46: [3,47], + 47: [3,48], + 48: [4,49], + 49: [4,50], + 50: [4,51], + 51: [4,52], + 52: [4,53], + 53: [4,54], + 54: [4,55], + 55: [4,56], + 56: [4,57], + 57: [4,58], + 58: [4,59], + 59: [4,60], + 60: [4,61], + 61: [4,62], + 62: [4,63], + 63: [4,64] } + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END - _qsfp_ports = range(0, ports_in_block + 1) + @property + def qsfp_ports(self): + return range(0, self.PORTS_IN_BLOCK + 1) - def __init__(self, port_num): - # Override port_to_eeprom_mapping for class initialization - i2c_bus = self.port_to_i2c_mapping[port_num][0] - sfp_idx = self.port_to_i2c_mapping[port_num][1] - proc = subprocess.Popen([i2c_set, '-y', str(i2c_bus), cpld_addr, mux_reg, str(sfp_idx)], - stdout=subprocess.PIPE, - shell=False, - stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping - eeprom_path = '/sys/class/i2c-adapter/i2c-{0[0]}/{0[0]}-0050/eeprom' - for x in range(self.port_start, self.port_end + 1): - port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + @property + def qsfp_port_start(self): + return self.QSFP_PORT_START + + def __init__(self): + + sfp_eeprom_path = '/sys/bus/i2c/devices/{0[0]}-0050/sfp{0[1]}' + qsfp_eeprom_path = '/sys/bus/i2c/devices/{0[0]}-0050/qsfp{0[1]}' + for x in range(self.port_start, self.qsfp_port_start): + port_eeprom_path = sfp_eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + for x in range(self.qsfp_port_start, self.port_end + 1): + port_eeprom_path = qsfp_eeprom_path.format(self.port_to_i2c_mapping[x]) self.port_to_eeprom_mapping[x] = port_eeprom_path - sfputilbase.__init__(self, port_num) + + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/devices/platform/ingrasys-s8900-64xc-cpld.0/qsfp_modprs") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = reg_file.readline().rstrip() + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Mask off the bit corresponding to our port + mask = (1 << port_num) + + # content is a string, either "0" or "1" + if reg_value & mask == 0: + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/devices/platform/ingrasys-s8900-64xc-cpld.0/qsfp_lpmode") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = reg_file.readline().rstrip() + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Mask off the bit corresponding to our port + mask = (1 << (port_num - self.qsfp_port_start) ) + + # LPMode is active high + if reg_value & mask == 0: + return False + + return True + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/devices/platform/ingrasys-s8900-64xc-cpld.0/qsfp_lpmode", "r+") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = reg_file.readline().rstrip() + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Mask off the bit corresponding to our port + mask = (1 << (port_num - self.qsfp_port_start) ) + + # LPMode is active high; set or clear the bit accordingly + if lpmode is True: + reg_value = reg_value | mask + else: + reg_value = reg_value & ~mask + + # Convert our register value back to a hex string and write back + content = hex(reg_value) + + reg_file.seek(0) + reg_file.write(content) + reg_file.close() + + return True + + def reset(self, port_num): + QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/devices/platform/ingrasys-s8900-64xc-cpld.0/qsfp_reset" + + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + return False + + try: + reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "r+") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = reg_file.readline().rstrip() + + # File content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Mask off the bit corresponding to our port + mask = (1 << (port_num - self.qsfp_port_start)) + + # ResetL is active low + reg_value = reg_value & ~mask + + # Convert our register value back to a hex string and write back + reg_file.seek(0) + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 1 second to allow it to settle + time.sleep(1) + + # Flip the bit back high and write back to the register to take port out of reset + try: + reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "w") + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + reg_value = reg_value | mask + reg_file.seek(0) + reg_file.write(hex(reg_value)) + reg_file.close() + + return True diff --git a/platform/broadcom/sonic-platform-modules-ingrasys b/platform/broadcom/sonic-platform-modules-ingrasys index 458829af29cc..e66b8839da21 160000 --- a/platform/broadcom/sonic-platform-modules-ingrasys +++ b/platform/broadcom/sonic-platform-modules-ingrasys @@ -1 +1 @@ -Subproject commit 458829af29ccbaf71ddc70db292e6a468e0e564c +Subproject commit e66b8839da2180fd586aae040701faf180d59477 From a4ceff728414726f91f6267d154d78c80b592e48 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Mon, 25 Sep 2017 17:54:46 -0700 Subject: [PATCH 62/77] [Broadcom]: Update SAI version to 3.0.3.2-4 (#983) - Update Seastone config.bcm files - bugfix: Fix set attribute for ipv6 neighbor --- platform/broadcom/sai.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index ca1c76a32ff8..1bee2d9aa5de 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,9 +1,9 @@ -BRCM_SAI = libsaibcm_3.0.3.2-2_amd64.deb -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-2_amd64.deb?sv=2015-04-05&sr=b&sig=A9GjUgI9%2B7kRQHsCFqH07iRQLhdkwSH5tvSXepb3b%2BA%3D&se=2031-05-30T22%3A47%3A47Z&sp=r" +BRCM_SAI = libsaibcm_3.0.3.2-4_amd64.deb +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-4_amd64.deb?sv=2015-04-05&sr=b&sig=8LE5JB9YlYHVWFf0QF5vFF7fCUbpo14OXokBi%2BKb9GI%3D&se=2031-06-04T20%3A15%3A13Z&sp=r" -BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-2_amd64.deb +BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-4_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-2_amd64.deb?sv=2015-04-05&sr=b&sig=lDIwnDNHIA0WKc5ggTA4x3pVmBIM%2Bdib0hR7H1qyTe0%3D&se=2031-05-30T22%3A48%3A07Z&sp=r" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-4_amd64.deb?sv=2015-04-05&sr=b&sig=UGqSnxGtIxFBdO%2FDcFbZdPFgBPN695JQ6hLP5mBOt7g%3D&se=2031-06-04T20%3A15%3A26Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) From cce2a365280150019a2a313567bdd21e9f98f666 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Mon, 25 Sep 2017 20:01:42 -0700 Subject: [PATCH 63/77] [snmp]: Update sonic-snmpagent submodule (#986) [rfc4363]: Add key check logic for SAI bridge port objects (#38) --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 45e4e7826bf3..8dfcbd2be6ba 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 45e4e7826bf34850d8cc12861259c5f388e1102e +Subproject commit 8dfcbd2be6ba5e2e08c68f748a5f22739fe0f560 From 0db870475468f768493485d89ce7e033b90f3bd8 Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Tue, 26 Sep 2017 21:22:00 +0300 Subject: [PATCH 64/77] [Mellanox]: Remove FW upgrade procedure in docker (#989) FW upgrade is done outside the container. This piece of code was left accidentally during the merge. --- platform/mellanox/docker-syncd-mlnx/start.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/platform/mellanox/docker-syncd-mlnx/start.sh b/platform/mellanox/docker-syncd-mlnx/start.sh index 0ad00c6fc252..623316050475 100755 --- a/platform/mellanox/docker-syncd-mlnx/start.sh +++ b/platform/mellanox/docker-syncd-mlnx/start.sh @@ -4,8 +4,4 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd -# mlnx-fw-upgrade.sh will exit if firmware was actually upgraded -# or if some error occurs -. mlnx-fw-upgrade.sh - supervisorctl start syncd From 9b249ceb59c745306d4e4365d87e1b608ba2040b Mon Sep 17 00:00:00 2001 From: Andriy Moroz Date: Wed, 27 Sep 2017 10:04:34 +0300 Subject: [PATCH 65/77] Add time stamp suffix to the dirty images version string (#958) * Add timestamp suffix to the dirty images version string This will allow to build different debug images without having to update BUILD_NUMBER variable before the build * Changed timestamp format to YYYYMMDD.HHMMSS --- functions.sh | 2 +- slave.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index c73aeb45d649..01f645ca72c7 100644 --- a/functions.sh +++ b/functions.sh @@ -55,7 +55,7 @@ sonic_get_version() { local latest_tag=$(git describe --tags --abbrev=0) local branch_name=$(git rev-parse --abbrev-ref HEAD) if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then - local dirty="-dirty" + local dirty="-dirty-$DIRTY_SUFFIX" fi BUILD_NUMBER=${BUILD_NUMBER:-0} ## Check if we are on tagged commit diff --git a/slave.mk b/slave.mk index 4e76661588fb..c26e4932f05a 100644 --- a/slave.mk +++ b/slave.mk @@ -423,6 +423,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform chmod +x sonic_debian_extension.sh, ) + DIRTY_SUFFIX="$(shell date +%Y%m%d\.%H%M%S)" + export DIRTY_SUFFIX ./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG) TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG) From 59c03083d39f496c6e55dfb33edb2d3533d5f7df Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 29 Sep 2017 03:04:27 +0800 Subject: [PATCH 66/77] [Mellanox]: Update outdated MSN2410 minigraph (#995) update the minigraph to the latest. the previous one causes MSN2410 failing to start up properly. --- .../x86_64-mlnx_msn2410-r0/minigraph.xml | 676 +++++++++++++++++- 1 file changed, 675 insertions(+), 1 deletion(-) diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/minigraph.xml b/device/mellanox/x86_64-mlnx_msn2410-r0/minigraph.xml index ed21b8d6eeb9..ea765fab814d 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/minigraph.xml +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/minigraph.xml @@ -2,11 +2,461 @@ + + ARISTA01T0 + 10.0.0.33 + switch2 + 10.0.0.32 + 1 + 180 + 60 + + + switch2 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 180 + 60 + + + ARISTA02T0 + 10.0.0.35 + switch2 + 10.0.0.34 + 1 + 180 + 60 + + + switch2 + 10.0.0.2 + ARISTA02T2 + 10.0.0.3 + 1 + 180 + 60 + + + ARISTA03T0 + 10.0.0.37 + switch2 + 10.0.0.36 + 1 + 180 + 60 + + + switch2 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 180 + 60 + + + ARISTA04T0 + 10.0.0.39 + switch2 + 10.0.0.38 + 1 + 180 + 60 + + + switch2 + 10.0.0.6 + ARISTA04T2 + 10.0.0.7 + 1 + 180 + 60 + + + ARISTA05T0 + 10.0.0.41 + switch2 + 10.0.0.40 + 1 + 180 + 60 + + + switch2 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 180 + 60 + + + ARISTA06T0 + 10.0.0.43 + switch2 + 10.0.0.42 + 1 + 180 + 60 + + + switch2 + 10.0.0.10 + ARISTA06T2 + 10.0.0.11 + 1 + 180 + 60 + + + ARISTA07T0 + 10.0.0.45 + switch2 + 10.0.0.44 + 1 + 180 + 60 + + + switch2 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 180 + 60 + + + ARISTA08T0 + 10.0.0.47 + switch2 + 10.0.0.46 + 1 + 180 + 60 + + + switch2 + 10.0.0.14 + ARISTA08T2 + 10.0.0.15 + 1 + 180 + 60 + + + ARISTA09T0 + 10.0.0.49 + switch2 + 10.0.0.48 + 1 + 180 + 60 + + + switch2 + 10.0.0.16 + ARISTA09T2 + 10.0.0.17 + 1 + 180 + 60 + + + ARISTA10T0 + 10.0.0.51 + switch2 + 10.0.0.50 + 1 + 180 + 60 + + + switch2 + 10.0.0.18 + ARISTA10T2 + 10.0.0.19 + 1 + 180 + 60 + + + ARISTA11T0 + 10.0.0.53 + switch2 + 10.0.0.52 + 1 + 180 + 60 + + + switch2 + 10.0.0.20 + ARISTA11T2 + 10.0.0.21 + 1 + 180 + 60 + + + ARISTA12T0 + 10.0.0.55 + switch2 + 10.0.0.54 + 1 + 180 + 60 + + + switch2 + 10.0.0.22 + ARISTA12T2 + 10.0.0.23 + 1 + 180 + 60 + + + ARISTA13T0 + 10.0.0.57 + switch2 + 10.0.0.56 + 1 + 180 + 60 + + + switch2 + 10.0.0.24 + ARISTA13T2 + 10.0.0.25 + 1 + 180 + 60 + + + ARISTA14T0 + 10.0.0.59 + switch2 + 10.0.0.58 + 1 + 180 + 60 + + + switch2 + 10.0.0.26 + ARISTA14T2 + 10.0.0.27 + 1 + 180 + 60 + + + ARISTA15T0 + 10.0.0.61 + switch2 + 10.0.0.60 + 1 + 180 + 60 + + + switch2 + 10.0.0.28 + ARISTA15T2 + 10.0.0.29 + 1 + 180 + 60 + + + ARISTA16T0 + 10.0.0.63 + switch2 + 10.0.0.62 + 1 + 180 + 60 + + + switch2 + 10.0.0.30 + ARISTA16T2 + 10.0.0.31 + 1 + 180 + 60 + 65100 switch2 + + +
10.0.0.33
+ + +
+ +
10.0.0.1
+ + +
+ +
10.0.0.35
+ + +
+ +
10.0.0.3
+ + +
+ +
10.0.0.37
+ + +
+ +
10.0.0.5
+ + +
+ +
10.0.0.39
+ + +
+ +
10.0.0.7
+ + +
+ +
10.0.0.41
+ + +
+ +
10.0.0.9
+ + +
+ +
10.0.0.43
+ + +
+ +
10.0.0.11
+ + +
+ +
10.0.0.45
+ + +
+ +
10.0.0.13
+ + +
+ +
10.0.0.47
+ + +
+ +
10.0.0.15
+ + +
+ +
10.0.0.49
+ + +
+ +
10.0.0.17
+ + +
+ +
10.0.0.51
+ + +
+ +
10.0.0.19
+ + +
+ +
10.0.0.53
+ + +
+ +
10.0.0.21
+ + +
+ +
10.0.0.55
+ + +
+ +
10.0.0.23
+ + +
+ +
10.0.0.57
+ + +
+ +
10.0.0.25
+ + +
+ +
10.0.0.59
+ + +
+ +
10.0.0.27
+ + +
+ +
10.0.0.61
+ + +
+ +
10.0.0.29
+ + +
+ +
10.0.0.63
+ + +
+ +
10.0.0.31
+ + +
+
@@ -482,13 +932,237 @@ + + DeviceInterfaceLink + switch2 + Ethernet0 + ARISTA01T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet4 + ARISTA02T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet8 + ARISTA03T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet12 + ARISTA04T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet16 + ARISTA05T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet20 + ARISTA06T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet24 + ARISTA07T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet28 + ARISTA08T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet32 + ARISTA09T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet36 + ARISTA10T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet40 + ARISTA11T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet44 + ARISTA12T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet48 + ARISTA13T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet52 + ARISTA14T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet56 + ARISTA15T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet60 + ARISTA16T2 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet64 + ARISTA01T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet68 + ARISTA02T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet72 + ARISTA03T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet76 + ARISTA04T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet80 + ARISTA05T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet84 + ARISTA06T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet88 + ARISTA07T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet92 + ARISTA08T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet96 + ARISTA09T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet100 + ARISTA10T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet104 + ARISTA11T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet108 + ARISTA12T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet112 + ARISTA13T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet116 + ARISTA14T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet120 + ARISTA15T0 + Ethernet1 + + + DeviceInterfaceLink + switch2 + Ethernet124 + ARISTA16T0 + Ethernet1 + switch2 ACS-MSN2410 - ` + From 6483919852ade151b6c02c8c932b5cbce2260fb8 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 28 Sep 2017 20:29:31 -0700 Subject: [PATCH 67/77] [Broadcom]: Update SAI version to 3.0.3.2-5 (#997) - Add additional DropCancel and CopyToCpuCancel action rules for every redirect --- platform/broadcom/sai.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 1bee2d9aa5de..ea804a69c0eb 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,9 +1,9 @@ -BRCM_SAI = libsaibcm_3.0.3.2-4_amd64.deb -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-4_amd64.deb?sv=2015-04-05&sr=b&sig=8LE5JB9YlYHVWFf0QF5vFF7fCUbpo14OXokBi%2BKb9GI%3D&se=2031-06-04T20%3A15%3A13Z&sp=r" +BRCM_SAI = libsaibcm_3.0.3.2-5_amd64.deb +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-5_amd64.deb?sv=2015-04-05&sr=b&sig=MQE6FrxHs%2BIUPjRaSpWagcSjY6bbHLCUYasusxILkEs%3D&se=2031-06-07T21%3A50%3A36Z&sp=r" -BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-4_amd64.deb +BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-5_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-4_amd64.deb?sv=2015-04-05&sr=b&sig=UGqSnxGtIxFBdO%2FDcFbZdPFgBPN695JQ6hLP5mBOt7g%3D&se=2031-06-04T20%3A15%3A26Z&sp=r" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-5_amd64.deb?sv=2015-04-05&sr=b&sig=o8bjWlxxYAM%2F95aSshRFJE57JwKVjRaH4jDU2lDEoMg%3D&se=2031-06-07T21%3A50%3A19Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) From f7a38e1f65fdd44980ab552bbfb1f443dc15f5ae Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 28 Sep 2017 21:01:41 -0700 Subject: [PATCH 68/77] [snmp]: Update py-swsssdk/snmpagent submodules (#996) sonic-py-swsssdk - Commond utility functions for bridge/port mapping snmp - Update the code to use common library API for bridge/port mapping --- src/sonic-py-swsssdk | 2 +- src/sonic-snmpagent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 7f8e7c5ad974..96b4928e790b 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 7f8e7c5ad9747af1d8ce5317eb1ece65ed4c0c7a +Subproject commit 96b4928e790bbce7c959f0b5cbb0510e5954afb1 diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 8dfcbd2be6ba..6996123be4f0 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 8dfcbd2be6ba5e2e08c68f748a5f22739fe0f560 +Subproject commit 6996123be4f0a1d44aab7e23ac6ff15e7bb82b1b From 9efcc9c3338e7609d5ac374c7cc33cacdf4d6b7a Mon Sep 17 00:00:00 2001 From: Andriy Moroz Date: Sat, 30 Sep 2017 00:44:55 +0300 Subject: [PATCH 69/77] [swss]: Update swss/common submodules (#988) * Update swss submodule reference * Update swss-common submodule reference This pull request introduces changes including 1. Use unified buffer configurations fro all Mellanox 27xx platforms 2. Refactor TableConsumable and optimize popping empty logics 3. Add SwitchOrch to deal with switch attributes changes 4. Refactor doAclTableTask and doAclRuleTask 5. Add PFC watchdog tables and runRedisScript function in common library Signed-off-by: Andriy Moroz --- dockers/docker-orchagent/swssconfig.sh | 7 +++---- src/sonic-config-engine/minigraph.py | 1 + src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index f075ca4f22ac..7b22fe7d190d 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -45,10 +45,9 @@ elif [ "$HWSKU" == "Force10-S6000-Q32" ]; then SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " elif [ "$HWSKU" == "Arista-7050-QX32" ]; then SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json " -elif [ "$HWSKU" == "ACS-MSN2700" ]; then - SWSSCONFIG_ARGS+="msn2700.32ports.buffers.json msn2700.32ports.qos.json " -elif [ "$HWSKU" == "ACS-MSN2740" ]; then - SWSSCONFIG_ARGS+="msn2740.32ports.buffers.json msn2740.32ports.qos.json " +elif [[ "$HWSKU" == "ACS-MSN27"* ]]; then + sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/msn27xx.32ports.buffers.json.j2 > /etc/swss/config.d/msn27xx.32ports.buffers.json + SWSSCONFIG_ARGS+="msn27xx.32ports.buffers.json msn2700.32ports.qos.json " fi for file in $SWSSCONFIG_ARGS; do diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index b5e97b485b44..95a45b8530de 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -101,6 +101,7 @@ def parse_png(png, hname): for device in child.findall(str(QName(ns, "Device"))): (lo_prefix, mgmt_prefix, name, hwsku, d_type) = parse_device(device) device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku } + name = name.replace('"', '') if neighbors.has_key(name): neighbors[name].update(device_data) else: diff --git a/src/sonic-swss b/src/sonic-swss index 4c56d23b9ff4..770a8f33c1bf 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc +Subproject commit 770a8f33c1bff299be683bfc7f8e07a2d65f9ef3 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index d4adb725ae6d..53bb53179d91 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit d4adb725ae6d7cbfcff939b1e3b6a4a544bd4de3 +Subproject commit 53bb53179d916a45eafa75e1e958f1432d2a716e From bbf1d6624bcec3ba9de96cbee835430230e446d6 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 30 Sep 2017 10:55:03 -0700 Subject: [PATCH 70/77] [docker-platform-monitor]: Remove stale fancontrol.pid file (if exists) before starting fancontrol (#1002) --- dockers/docker-platform-monitor/start.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dockers/docker-platform-monitor/start.sh b/dockers/docker-platform-monitor/start.sh index fb87083f5cc6..b4023c16367a 100755 --- a/dockers/docker-platform-monitor/start.sh +++ b/dockers/docker-platform-monitor/start.sh @@ -18,6 +18,9 @@ fi # If this platform has a fancontrol config file, copy it to it's proper place # and start fancontrol if [ -e /usr/share/sonic/platform/fancontrol ]; then + # Remove stale pid file if it exists + rm -f /var/run/fancontrol.pid + /bin/cp -f /usr/share/sonic/platform/fancontrol /etc/ supervisorctl start fancontrol fi From 002aabe8ba5e59e6ab2a9fc7f0db48371150ec74 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 30 Sep 2017 11:02:18 -0700 Subject: [PATCH 71/77] Change all port_config.ini column headers from 'port' to 'index' (#1001) --- .../x86_64-arista_7050_qx32/Arista-7050-Q16S64/port_config.ini | 2 +- .../x86_64-arista_7050_qx32/Arista-7050-QX32/port_config.ini | 2 +- .../x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini | 2 +- .../x86_64-arista_7060_cx32s/Arista-7060-CX32S/port_config.ini | 2 +- .../x86_64-arista_7260cx3_64/Arista-7260CX3-C64/port_config.ini | 2 +- .../Arista-7260CX3-D108C8/port_config.ini | 2 +- .../INGRASYS-S8810-32Q/port_config.ini | 2 +- .../INGRASYS-S8900-54XC/port_config.ini | 2 +- .../INGRASYS-S8900-64XC/port_config.ini | 2 +- .../x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/port_config.ini b/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/port_config.ini index dea477b26152..1cc6c91b1308 100644 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/port_config.ini +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 125,126,127,128 Ethernet1/1 1 Ethernet4 121,122,123,124 Ethernet2/1 2 Ethernet8 13,14,15,16 Ethernet3/1 3 diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/port_config.ini b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/port_config.ini index 32fa6885fa93..b57f14497e39 100644 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/port_config.ini +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 125,126,127,128 Ethernet1/1 1 Ethernet4 121,122,123,124 Ethernet2/1 2 Ethernet8 13,14,15,16 Ethernet3/1 3 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini index cb36404ac44f..fda62e998c1a 100644 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 9,10,11,12 Ethernet5/1 5 Ethernet4 13,14,15,16 Ethernet6/1 6 Ethernet8 17,18,19,20 Ethernet7/1 7 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060-CX32S/port_config.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060-CX32S/port_config.ini index c1dbcfabd9e3..bfe4a721141d 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060-CX32S/port_config.ini +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060-CX32S/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 33,34,35,36 Ethernet1/1 1 Ethernet4 37,38,39,40 Ethernet2/1 2 Ethernet8 41,42,43,44 Ethernet3/1 3 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/port_config.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/port_config.ini index 4f073e46dce3..1119dfd231c6 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/port_config.ini +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 77,78,79,80 Ethernet1/1 1 Ethernet4 65,66,67,68 Ethernet2/1 2 Ethernet8 85,86,87,88 Ethernet3/1 3 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini index b06d1c7575d4..35a2175cf21d 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 77,78 Ethernet1/1 1 Ethernet2 79,80 Ethernet1/3 2 Ethernet4 65,66 Ethernet2/1 3 diff --git a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini index a313c9cda21f..bf87e1402ab1 100644 --- a/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s8810_32q-r0/INGRASYS-S8810-32Q/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 37,38,39,40 Ethernet1/1 0 Ethernet4 33,34,35,36 Ethernet2/1 1 Ethernet8 45,46,47,48 Ethernet3/1 2 diff --git a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini index c1243db622f6..3350b68172cb 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s8900_54xc-r0/INGRASYS-S8900-54XC/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 1 Ethernet1 0 Ethernet1 2 Ethernet2 1 Ethernet2 3 Ethernet3 2 diff --git a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini index 20c2138dfeb3..b950538edba7 100644 --- a/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s8900_64xc-r0/INGRASYS-S8900-64XC/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 17 Ethernet1 0 Ethernet1 18 Ethernet2 1 Ethernet2 19 Ethernet3 2 diff --git a/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini b/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini index 6c62497b8927..ab0202011576 100644 --- a/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini +++ b/device/ingrasys/x86_64-ingrasys_s9100-r0/INGRASYS-S9100-C32/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias port +# name lanes alias index Ethernet0 5,6,7,8 Ethernet1/1 0 Ethernet4 1,2,3,4 Ethernet2/1 1 Ethernet8 13,14,15,16 Ethernet3/1 2 From 486dfef732481269fd72f20e51b6404e30dd2b44 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Sat, 30 Sep 2017 11:03:32 -0700 Subject: [PATCH 72/77] [swss]: Update the ipinip.j2 template to specify the IPv4 loopback address (#998) Use ipv4_loopback_addresses variable to store all IPv4 loopback addresses. The source IP for encapsulation is chosen from one of the addresses. The destination IPs for decapsulation is the list of the addresses. Signed-off-by: Shu0T1an ChenG --- dockers/docker-orchagent/ipinip.json.j2 | 12 +++++++++--- .../tests/sample_output/ipinip.json | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index 2f411b088e6d..2554755c701d 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -1,9 +1,16 @@ +{# only IPv4 decapsulation is supported #} +{% set ipv4_loopback_addresses = [] %} +{% for (name, prefix) in LOOPBACK_INTERFACE %} + {%- if prefix | ipv4 %} + {%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %} + {%- endif %} +{% endfor %} [ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "src_ip":"{{ LOOPBACK_INTERFACE.keys()[0][1] | ip }}", - "dst_ip":"{{ LOOPBACK_INTERFACE.keys()[0][1] | ip }}", + "src_ip":"{{ ipv4_loopback_addresses | first | ip }}", + "dst_ip":"{% for prefix in ipv4_loopback_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}", {% if onie_switch_asic == "mlnx" %} "dscp_mode":"uniform", "ecn_mode":"standard", @@ -16,4 +23,3 @@ "OP": "SET" } ] - diff --git a/src/sonic-config-engine/tests/sample_output/ipinip.json b/src/sonic-config-engine/tests/sample_output/ipinip.json index 00862a379281..5a7ac1b6063b 100644 --- a/src/sonic-config-engine/tests/sample_output/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/ipinip.json @@ -11,4 +11,3 @@ "OP": "SET" } ] - From b81f2f2fa39647d981f5fb02b5c3bd5584081e37 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Mon, 2 Oct 2017 13:56:16 -0700 Subject: [PATCH 73/77] [snmpagent]: Update sonic-snmpagent submodule (#1004) * [mibs]: Fix bug module has no attribute 'get_index_from_str' Signed-off-by: Shu0T1an ChenG --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 6996123be4f0..bc4becf97ea6 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 6996123be4f0a1d44aab7e23ac6ff15e7bb82b1b +Subproject commit bc4becf97ea69c15315414e8c7cba44067af2461 From 7c326e3f1edb0804220f0eee19e49ab51bb3fd65 Mon Sep 17 00:00:00 2001 From: Rodny Molina Date: Tue, 3 Oct 2017 09:26:07 -0700 Subject: [PATCH 74/77] [utilities]: Update sonic-utilities submodule (#1006) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 0338eee64574..b27d4f9e976f 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 0338eee645741937603c5686bb86b22cb5ab5322 +Subproject commit b27d4f9e976f944f50d81e2354ba826194971774 From 72e947621c413b6069b719f6bbad05c8abbdf1df Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Tue, 3 Oct 2017 16:23:19 -0700 Subject: [PATCH 75/77] [config-engine]: Fix bug multiple ports connecting to same neighbor (#1005) The current DEVICE_NEIGHBOR format doesn't support multiple different ports connecting with same neighbor. Thus the lldpd.conf file is not generated correctly, causing missing information for LAG members. This fix reverts the data structure in the previous version of minigraph parser - using local port as the key and remote port/device as the value of the map. Sample format is: DEVICE_NEIGHBOR['Ethernet124'] = { 'name': 'ARISTA04T1', 'port': 'Ethernet1/1' } The corresponding unit test in test_cfggen is updated. Add one more unit test for lldpd.conf.j2 verification. Signed-off-by: Shu0T1an ChenG --- dockers/docker-lldp-sv2/lldpd.conf.j2 | 4 ++-- src/sonic-config-engine/minigraph.py | 10 +++------- src/sonic-config-engine/tests/sample_output/lldpd.conf | 5 +++++ src/sonic-config-engine/tests/test_cfggen.py | 4 ++-- src/sonic-config-engine/tests/test_j2files.py | 8 +++++++- 5 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 src/sonic-config-engine/tests/sample_output/lldpd.conf diff --git a/dockers/docker-lldp-sv2/lldpd.conf.j2 b/dockers/docker-lldp-sv2/lldpd.conf.j2 index ffbf7e6993e9..eb7202df7c67 100644 --- a/dockers/docker-lldp-sv2/lldpd.conf.j2 +++ b/dockers/docker-lldp-sv2/lldpd.conf.j2 @@ -1,3 +1,3 @@ -{% for neighbor in DEVICE_NEIGHBOR %} -configure ports {{ DEVICE_NEIGHBOR[neighbor]['local_port'] }} lldp portidsubtype local {{ PORT[DEVICE_NEIGHBOR[neighbor]['local_port']]['alias'] }} description {{ neighbor }}:{{ DEVICE_NEIGHBOR[neighbor]['port'] }} +{% for local_port in DEVICE_NEIGHBOR %} +configure ports {{ local_port }} lldp portidsubtype local {{ PORT[local_port]['alias'] }} description {{ DEVICE_NEIGHBOR[local_port]['name'] }}:{{ DEVICE_NEIGHBOR[local_port]['port'] }} {% endfor %} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 95a45b8530de..997008af5cee 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -91,21 +91,17 @@ def parse_png(png, hname): if enddevice == hname: if port_alias_map.has_key(endport): endport = port_alias_map[endport] - neighbors[startdevice] = {'local_port': endport, 'port': startport} + neighbors[endport] = {'name': startdevice, 'port': startport} else: if port_alias_map.has_key(startport): startport = port_alias_map[startport] - neighbors[enddevice] = {'local_port': startport, 'port': endport} + neighbors[startport] = {'name': enddevice, 'port': endport} if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "Device"))): (lo_prefix, mgmt_prefix, name, hwsku, d_type) = parse_device(device) device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku } - name = name.replace('"', '') - if neighbors.has_key(name): - neighbors[name].update(device_data) - else: - devices[name] = device_data + devices[name] = device_data if child.tag == str(QName(ns, "DeviceInterfaceLinks")): for if_link in child.findall(str(QName(ns, 'DeviceLinkBase'))): diff --git a/src/sonic-config-engine/tests/sample_output/lldpd.conf b/src/sonic-config-engine/tests/sample_output/lldpd.conf new file mode 100644 index 000000000000..0328385cf307 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/lldpd.conf @@ -0,0 +1,5 @@ +configure ports Ethernet116 lldp portidsubtype local fortyGigE0/116 description ARISTA02T1:Ethernet1/1 +configure ports Ethernet124 lldp portidsubtype local fortyGigE0/124 description ARISTA04T1:Ethernet1/1 +configure ports Ethernet112 lldp portidsubtype local fortyGigE0/112 description ARISTA01T1:Ethernet1/1 +configure ports Ethernet120 lldp portidsubtype local fortyGigE0/120 description ARISTA03T1:Ethernet1/1 + diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 4303f5a2492d..d78b19d88ba7 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -106,9 +106,9 @@ def test_minigraph_portchannel_interfaces(self): self.assertEqual(output.strip(), "[('PortChannel01', 'FC00::71/126'), ('PortChannel01', '10.0.0.56/31')]") def test_minigraph_neighbors(self): - argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "DEVICE_NEIGHBOR[\'ARISTA01T1\']"' + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "DEVICE_NEIGHBOR[\'Ethernet124\']"' output = self.run_script(argument) - self.assertEqual(output.strip(), "{'mgmt_addr': None, 'hwsku': 'Arista', 'lo_addr': None, 'local_port': 'Ethernet112', 'type': 'LeafRouter', 'port': 'Ethernet1/1'}") + self.assertEqual(output.strip(), "{'name': 'ARISTA04T1', 'port': 'Ethernet1/1'}") def test_minigraph_bgp(self): argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v "BGP_NEIGHBOR[\'10.0.0.59\']"' diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 9b71fc72b932..4bdc1b41f5b4 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -26,10 +26,16 @@ def test_interfaces(self): def test_alias_map(self): alias_map_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-snmp-sv2', 'alias_map.j2') - argument = '-m "' + self.t0_minigraph + '" -p "' + self.t0_port_config + '" -t "' + alias_map_template + '"' + argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + alias_map_template output = self.run_script(argument) data = json.loads(output) self.assertEqual(data["Ethernet4"], "fortyGigE0/4") + + def test_lldp(self): + lldpd_conf_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-lldp-sv2', 'lldpd.conf.j2') + argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + lldpd_conf_template + ' > ' + self.output_file + self.run_script(argument) + self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', 'lldpd.conf'), self.output_file)) def test_teamd(self): From 646e8364713cecdb50e95c237b7473d2f7a81544 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Tue, 3 Oct 2017 23:07:05 -0700 Subject: [PATCH 76/77] [swss]: Update swss-common/sairedis/swss submodules (#1008) Signed-off-by: Qi Luo --- src/sonic-sairedis | 2 +- src/sonic-swss | 2 +- src/sonic-swss-common | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 79bd891ca533..e4d24276cb6f 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 79bd891ca5337222701cd51ee5b266d2e485c492 +Subproject commit e4d24276cb6fc7122f756c637f30ddea27487c70 diff --git a/src/sonic-swss b/src/sonic-swss index 770a8f33c1bf..bcdea1323e70 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 770a8f33c1bff299be683bfc7f8e07a2d65f9ef3 +Subproject commit bcdea1323e70c73fa0a85c6df55eaed886bded81 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 53bb53179d91..f6ff19bee131 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 53bb53179d916a45eafa75e1e958f1432d2a716e +Subproject commit f6ff19bee131048f2274a21ea1064a8493a7fd8b From 554114cfaa4b55a85e3a74b169bfcf1a394accdd Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 4 Oct 2017 01:02:30 -0700 Subject: [PATCH 77/77] Make swssconfig status FATAL when it fails (#1009) * Make supervisor controlled one-shot program autorestart 0 time, so the status will become FATAL instead of EXITED if failure happens Signed-off-by: Qi Luo * Make swssconfig.sh strictly exit on any failure Signed-off-by: Qi Luo * Tune startretries, tested in supervisor 3.3.2-1 Signed-off-by: Qi Luo --- dockers/docker-orchagent/supervisord.conf | 3 ++- dockers/docker-orchagent/swssconfig.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dockers/docker-orchagent/supervisord.conf b/dockers/docker-orchagent/supervisord.conf index a04238472c4c..09850b13d4a1 100644 --- a/dockers/docker-orchagent/supervisord.conf +++ b/dockers/docker-orchagent/supervisord.conf @@ -55,7 +55,8 @@ stderr_logfile=syslog command=/usr/bin/swssconfig.sh priority=7 autostart=false -autorestart=false +autorestart=unexpected +startretries=0 stdout_logfile=syslog stderr_logfile=syslog diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 7b22fe7d190d..55a22c5353c8 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + function config_acl { if [ -f "/etc/sonic/acl.json" ]; then mkdir -p /etc/swss/config.d/acl