From c81c368b100ac8d52b5dd5f10c5b36233bc817dd Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 15:36:42 +0800 Subject: [PATCH 001/107] [submodule] Update submodule sonic-platform-pde to the latest HEAD automatically (#15552) --- src/sonic-platform-pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-pde b/src/sonic-platform-pde index 133566a91e0c..77090359ca21 160000 --- a/src/sonic-platform-pde +++ b/src/sonic-platform-pde @@ -1 +1 @@ -Subproject commit 133566a91e0c3aeac017dd34bdbe70c5ba1cc0e6 +Subproject commit 77090359ca21a4d5df9186edcf568713a2f6bcf4 From 45210c3b6a7e03b3ef0d4f1cf3848185cd7714e4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:17:29 +0800 Subject: [PATCH 002/107] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#15551) --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 4e4f3cbb6cd5..81048cd1fb63 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 4e4f3cbb6cd5e2ed0877904a31afe1e6d824fae5 +Subproject commit 81048cd1fb63da9fdca567aa863c7d1d43156ed3 From c9279dcc9743ad2fcb1c4645bdb3c9b2d0b18c54 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:18:23 +0800 Subject: [PATCH 003/107] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#15550) --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index d05ebd3081b4..4d270f07e040 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit d05ebd3081b43821221b0f408f68dbb4396be370 +Subproject commit 4d270f07e040e35b7fc90be6e38bd5feb6e163ed From e0918d20e94adfe432a597114ca9f6a0bbf255a4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:23:18 +0800 Subject: [PATCH 004/107] [submodule] Update submodule sonic-py-swsssdk to the latest HEAD automatically (#15553) --- src/sonic-py-swsssdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 92991f088af2..1109e496011d 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 92991f088af2616c713b27ba6ae1e1994b87fe97 +Subproject commit 1109e496011d4b3bfc6150b71d6a29816ecc2c90 From e5d640183d14a7e0f4233634a2c2e5f10ae35fed Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:32:45 +0800 Subject: [PATCH 005/107] [submodule] Update submodule sonic-mgmt-framework to the latest HEAD automatically (#15549) #### Why I did it src/sonic-mgmt-framework ``` * 4a2ff41 - (HEAD -> master, origin/master, origin/HEAD) [actions] Support Semgrep by Github Actions (#116) (5 hours ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-framework b/src/sonic-mgmt-framework index 1ad89d496570..4a2ff410f138 160000 --- a/src/sonic-mgmt-framework +++ b/src/sonic-mgmt-framework @@ -1 +1 @@ -Subproject commit 1ad89d49657073c2cc022551a3c19a301c81b530 +Subproject commit 4a2ff410f138c5b3c63b775c2f07e55bd3b4537b From b211227dceeeea73cf7ffe24566e1e4e8c84957a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:32:51 +0800 Subject: [PATCH 006/107] [submodule] Update submodule sonic-dbsyncd to the latest HEAD automatically (#15547) #### Why I did it src/sonic-dbsyncd ``` * e4ac906 - (HEAD -> master, origin/master, origin/HEAD) [actions] Support Semgrep by Github Actions (#59) (7 hours ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-dbsyncd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-dbsyncd b/src/sonic-dbsyncd index fa8b709dc0df..e4ac9068be56 160000 --- a/src/sonic-dbsyncd +++ b/src/sonic-dbsyncd @@ -1 +1 @@ -Subproject commit fa8b709dc0df771341dad0ebc07c0e7f8fd1177c +Subproject commit e4ac9068be56595c53b4f3d320d72bb7d10bd368 From ac0c18b3fdb08d52facedd294c99407e2e280516 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:32:57 +0800 Subject: [PATCH 007/107] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#15546) #### Why I did it src/linkmgrd ``` * 4bda49b - (HEAD -> master, origin/master, origin/HEAD) [actions] Support Semgrep by Github Actions (#210) (7 hours ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 18640651da3a..4bda49bd71ac 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 18640651da3a2328ac771009777dbc9c3d9c8a26 +Subproject commit 4bda49bd71acccb644293da662a9ac937ddd6e7a From 076dae8860cd7158a91c0d79e2d0e4f2bd0ad75f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:33:03 +0800 Subject: [PATCH 008/107] [submodule] Update submodule dhcprelay to the latest HEAD automatically (#15545) #### Why I did it src/dhcprelay ``` * c36b8e3 - (HEAD -> master, origin/master, origin/HEAD) [actions] Support Semgrep by Github Actions (#39) (7 hours ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/dhcprelay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcprelay b/src/dhcprelay index 511ef96e3b87..c36b8e3d2113 160000 --- a/src/dhcprelay +++ b/src/dhcprelay @@ -1 +1 @@ -Subproject commit 511ef96e3b87c386213e0bd9e82d6a572a77b443 +Subproject commit c36b8e3d2113976f319fb02db94971e9b27e6416 From 12a039c5f8aeeeebb06f269b93be7330411a93e7 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:39:25 +0800 Subject: [PATCH 009/107] [submodule] Update submodule sonic-snmpagent to the latest HEAD automatically (#15555) --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index 4622b8df01e6..4948ea34b0f7 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit 4622b8df01e6cfa818568b5a78a1a56ab555097d +Subproject commit 4948ea34b0f7e9ac82b2ef308d3e6253b22107f9 From a003861b1b66494e98a496eddfcd38ef84020cc0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 20 Jun 2023 17:20:23 +0800 Subject: [PATCH 010/107] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#15554) --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 00a953c6eafb..321ce7467b1a 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 00a953c6eafb8852d771c0f7a4f91db9f0965530 +Subproject commit 321ce7467b1a1d45ec9de6ac81aac1acf0284f7d From d9dfb36920a4c212a5597c424aa306eb122efa4b Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Tue, 20 Jun 2023 15:33:00 +0300 Subject: [PATCH 011/107] [buildsystem] Fix hiredis package version: 0.14.1-1 (#15461) - Why I did it To fix hiredis compilation - How I did it Changed package version: 0.14.0-3~bpo9+1 -> 0.14.1-1 - How to verify it make configure PLATFORM=mellanox make target/sonic-mellanox.bin Signed-off-by: Nazarii Hnydyn --- rules/hiredis.mk | 7 ++++--- src/hiredis/Makefile | 17 +++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/rules/hiredis.mk b/rules/hiredis.mk index 71a18a1d6aac..a97e0bf1bb83 100644 --- a/rules/hiredis.mk +++ b/rules/hiredis.mk @@ -1,7 +1,7 @@ # libhiredis package -HIREDIS_VERSION = 0.14.0 -HIREDIS_VERSION_FULL = $(HIREDIS_VERSION)-3~bpo9+1 +HIREDIS_VERSION = 0.14.1 +HIREDIS_VERSION_FULL = ${HIREDIS_VERSION}-1 export HIREDIS_VERSION HIREDIS_VERSION_FULL @@ -12,6 +12,7 @@ SONIC_MAKE_DEBS += $(LIBHIREDIS) LIBHIREDIS_DEV = libhiredis-dev_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LIBHIREDIS),$(LIBHIREDIS_DEV))) -LIBHIREDIS_DBG = libhiredis-dbg_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb LIBHIREDIS_DBG = libhiredis0.14-dbgsym_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LIBHIREDIS),$(LIBHIREDIS_DBG))) + +export LIBHIREDIS LIBHIREDIS_DEV LIBHIREDIS_DBG diff --git a/src/hiredis/Makefile b/src/hiredis/Makefile index ab257e5e0845..7e94e2c091ca 100644 --- a/src/hiredis/Makefile +++ b/src/hiredis/Makefile @@ -2,18 +2,18 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MAIN_TARGET = libhiredis0.14_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb -DERIVED_TARGETS = libhiredis0.14-dbgsym_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb libhiredis-dev_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb +MAIN_TARGET = $(LIBHIREDIS) +DERIVED_TARGETS = $(LIBHIREDIS_DBG) $(LIBHIREDIS_DEV) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - rm -rf hiredis-$(HIREDIS_VERSION) + # Remove any stale files + rm -rf ./hiredis-$(HIREDIS_VERSION) - wget -O hiredis_$(HIREDIS_VERSION).orig.tar.gz http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION).orig.tar.gz - wget -O hiredis_$(HIREDIS_VERSION_FULL).debian.tar.xz http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION_FULL).debian.tar.xz - wget -O hiredis_$(HIREDIS_VERSION_FULL).dsc http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION_FULL).dsc + # Get hiredis release, debian files + dget -u http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION_FULL).dsc - dpkg-source -x hiredis_$(HIREDIS_VERSION_FULL).dsc - pushd hiredis-$(HIREDIS_VERSION) + # Build source and Debian packages + pushd ./hiredis-$(HIREDIS_VERSION) ifeq ($(CROSS_BUILD_ENVIRON), y) dpkg-buildpackage -rfakeroot -d -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) else @@ -21,6 +21,7 @@ else endif popd + # Move the newly-built .deb packages to the destination directory mv $* $(DERIVED_TARGETS) $(DEST)/ $(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) From a67bffab8efb4e47d061fba24f6d11c1ecf51ef0 Mon Sep 17 00:00:00 2001 From: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:20:00 +0800 Subject: [PATCH 012/107] enable info log for graceful restart events (#15535) Why I did it Graceful restart is a key event for bgpd, related log print is debug level. To change it to info level to get more visibilities when this kind of event is triggered. Work item tracking Microsoft ADO (13875291): How I did it To create patch file to change from debug level to info level. How to verify it To run PR test and capture the print. --- ...og-level-for-graceful-restart-events.patch | 122 ++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 123 insertions(+) create mode 100644 src/sonic-frr/patch/0029-bgpd-Change-log-level-for-graceful-restart-events.patch diff --git a/src/sonic-frr/patch/0029-bgpd-Change-log-level-for-graceful-restart-events.patch b/src/sonic-frr/patch/0029-bgpd-Change-log-level-for-graceful-restart-events.patch new file mode 100644 index 000000000000..a3474ae64f71 --- /dev/null +++ b/src/sonic-frr/patch/0029-bgpd-Change-log-level-for-graceful-restart-events.patch @@ -0,0 +1,122 @@ +From c423bce4db804c1d07d65ce3d06a9e62c4eceb2b Mon Sep 17 00:00:00 2001 +From: stormliang +Date: Mon, 19 Jun 2023 13:57:01 +0000 +Subject: [PATCH] change log level for graceful restart events + +--- + bgpd/bgp_fsm.c | 44 ++++++++++++++++++++------------------------ + bgpd/bgpd.c | 12 +++++------- + 2 files changed, 25 insertions(+), 31 deletions(-) + +diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c +index 672fa4512..e392cd6e1 100644 +--- a/bgpd/bgp_fsm.c ++++ b/bgpd/bgp_fsm.c +@@ -786,9 +786,9 @@ static int bgp_graceful_restart_timer_expire(struct thread *thread) + + peer = THREAD_ARG(thread); + +- if (bgp_debug_neighbor_events(peer)) { +- zlog_debug("%s graceful restart timer expired", peer->host); +- zlog_debug("%s graceful restart stalepath timer stopped", ++ if (peer) { ++ zlog_info("%s graceful restart timer expired", peer->host); ++ zlog_info("%s graceful restart stalepath timer stopped", + peer->host); + } + +@@ -852,8 +852,8 @@ static int bgp_graceful_stale_timer_expire(struct thread *thread) + + peer = THREAD_ARG(thread); + +- if (bgp_debug_neighbor_events(peer)) +- zlog_debug("%s graceful restart stalepath timer expired", ++ if (peer) ++ zlog_info("%s graceful restart stalepath timer expired", + peer->host); + + /* NSF delete stale route */ +@@ -1427,20 +1427,18 @@ int bgp_stop(struct peer *peer) + /* graceful restart */ + if (peer->t_gr_stale) { + BGP_TIMER_OFF(peer->t_gr_stale); +- if (bgp_debug_neighbor_events(peer)) +- zlog_debug( +- "%s graceful restart stalepath timer stopped", +- peer->host); ++ zlog_info( ++ "%s graceful restart stalepath timer stopped", ++ peer->host); + } + if (CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT)) { +- if (bgp_debug_neighbor_events(peer)) { +- zlog_debug( +- "%s graceful restart timer started for %d sec", +- peer->host, peer->v_gr_restart); +- zlog_debug( +- "%s graceful restart stalepath timer started for %d sec", +- peer->host, peer->bgp->stalepath_time); +- } ++ zlog_info( ++ "%s graceful restart timer started for %d sec", ++ peer->host, peer->v_gr_restart); ++ zlog_info( ++ "%s graceful restart stalepath timer started for %d sec", ++ peer->host, peer->bgp->stalepath_time); ++ + BGP_TIMER_ON(peer->t_gr_restart, + bgp_graceful_restart_timer_expire, + peer->v_gr_restart); +@@ -2205,18 +2203,16 @@ static int bgp_establish(struct peer *peer) + UNSET_FLAG(peer->sflags, PEER_STATUS_NSF_MODE); + if (peer->t_gr_stale) { + BGP_TIMER_OFF(peer->t_gr_stale); +- if (bgp_debug_neighbor_events(peer)) +- zlog_debug( +- "%s graceful restart stalepath timer stopped", +- peer->host); ++ zlog_info( ++ "%s graceful restart stalepath timer stopped", ++ peer->host); + } + } + + if (peer->t_gr_restart) { + BGP_TIMER_OFF(peer->t_gr_restart); +- if (bgp_debug_neighbor_events(peer)) +- zlog_debug("%s graceful restart timer stopped", +- peer->host); ++ zlog_info("%s graceful restart timer stopped", ++ peer->host); + } + + /* Reset uptime, turn on keepalives, send current table. */ +diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c +index 7e528b219..2fc471555 100644 +--- a/bgpd/bgpd.c ++++ b/bgpd/bgpd.c +@@ -2346,16 +2346,14 @@ void peer_nsf_stop(struct peer *peer) + + if (peer->t_gr_restart) { + BGP_TIMER_OFF(peer->t_gr_restart); +- if (bgp_debug_neighbor_events(peer)) +- zlog_debug("%s graceful restart timer stopped", +- peer->host); ++ zlog_info("%s graceful restart timer stopped", ++ peer->host); + } + if (peer->t_gr_stale) { + BGP_TIMER_OFF(peer->t_gr_stale); +- if (bgp_debug_neighbor_events(peer)) +- zlog_debug( +- "%s graceful restart stalepath timer stopped", +- peer->host); ++ zlog_info( ++ "%s graceful restart stalepath timer stopped", ++ peer->host); + } + bgp_clear_route_all(peer); + } +-- +2.25.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index da96dc27be61..db97b2ea823f 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -27,4 +27,5 @@ cross-compile-changes.patch 0026-bgpd-Ensure-suppress-fib-pending-works-with-network-.patch 0027-bgpd-Ensure-FRR-has-enough-data-to-read-in-peek_for_as4_capability-and-bgp_open_option_parse.patch 0028-bgpd-Ensure-that-bgp-open-message-stream-has-enough-data-to-read.patch +0029-bgpd-Change-log-level-for-graceful-restart-events.patch From c65bdc195fb00effaebb924f94b0302f1a85f599 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:50:20 +0800 Subject: [PATCH 013/107] [submodule] Update submodule wpasupplicant/sonic-wpa-supplicant to the latest HEAD automatically (#15556) --- src/wpasupplicant/sonic-wpa-supplicant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wpasupplicant/sonic-wpa-supplicant b/src/wpasupplicant/sonic-wpa-supplicant index a24412c25b8a..ac564730fdcf 160000 --- a/src/wpasupplicant/sonic-wpa-supplicant +++ b/src/wpasupplicant/sonic-wpa-supplicant @@ -1 +1 @@ -Subproject commit a24412c25b8af63ab0030e6135c21a51a4a4c316 +Subproject commit ac564730fdcfe7140d07d3d3d8ce4a3b26749af2 From 3a755196b88da73d09c1e6492101adbb8cfacc21 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 21 Jun 2023 16:32:30 +0800 Subject: [PATCH 014/107] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#15548) #### Why I did it src/sonic-host-services ``` * 508d642 - (HEAD -> master, origin/master, origin/HEAD) [actions] Support Semgrep by Github Actions (#67) (31 hours ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 3117236e7655..508d642f5866 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 3117236e765515488ce30198170773591c719720 +Subproject commit 508d642f58665dd1925fe2a1eb6e9d7b368c7dda From e0f287b19a62d89e862543380f66f5d31802ee07 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Wed, 21 Jun 2023 10:55:37 -0700 Subject: [PATCH 015/107] Update gnxi ptr (#15562) #### Why I did it Need new changes that were added to gnxi inside ptf docker ##### Work item tracking - Microsoft ADO **(number only)**: 17747466 #### How I did it Update commit number #### How to verify it Pipeline --- dockers/docker-ptf/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 513dcd76e479..69df5d51cb5f 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -209,7 +209,7 @@ RUN mkdir -p /var/log/supervisor # Install Python-based GNMI client RUN git clone https://github.com/lguohan/gnxi.git \ && cd gnxi \ - && git checkout f2b11e4 \ + && git checkout b85e4ab \ && cd gnmi_cli_py \ && pip install -r requirements.txt From a81505f8b1da4600d88c6333772330c80e458c02 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:27:42 +0800 Subject: [PATCH 016/107] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#15580) --- 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 2320ddcaf7df..c3a77cceb9eb 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 2320ddcaf7df4c448dc6ebb9963d153023f21651 +Subproject commit c3a77cceb9ebd8354d87e1a0e5e761d4a3840e50 From e5268d9c9157bb701fb05682a64e6f34bc2d2f7c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:40:35 +0800 Subject: [PATCH 017/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15579) --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 28ffc3a1fea0..a391ed0acc4e 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 28ffc3a1fea06ffd432f0609e402d602fb33df17 +Subproject commit a391ed0acc4ed5b7a7d3a435f9a8429cc97af3db From 067ef67cda08a928a0aab120d22272b479e96582 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 22 Jun 2023 16:32:33 +0800 Subject: [PATCH 018/107] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#15565) #### Why I did it src/sonic-sairedis ``` * 14a863a - (HEAD -> master, origin/master, origin/HEAD) [warmboot] Add workaround for `INIT_VIEW` failure (#1252) (5 hours ago) [Jing Zhang] * abb02a5 - [actions] Support Semgrep by Github Actions (#1254) (2 days ago) [Mai Bui] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 321ce7467b1a..14a863a6d8f2 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 321ce7467b1a1d45ec9de6ac81aac1acf0284f7d +Subproject commit 14a863a6d8f2855a7cebf1b7e62bc46dbed76ff6 From 13897723c2f8494402bf1c6430b477df26f9e753 Mon Sep 17 00:00:00 2001 From: Shashanka Balakuntala <135858627+shbalaku-microsoft@users.noreply.github.com> Date: Thu, 22 Jun 2023 18:21:33 +0530 Subject: [PATCH 019/107] Modify azure cli to install through apt-get and pyaml to specific version supported by py2 (#15472) Why I did it Current docker-sonic-mgmt build is broken. So below are two fixes which can help in mitigating the same. PYAML - Download a specific version in python2 as after https://pypi.org/project/pyaml/23.5.5/ there was support only for python3. This update happened on May 5th. And consequently all daily builds after this changes https://dev.azure.com/mssonic/build/_build/results?buildId=266733&view=results (starting build to break) kept failing Azure-CLI - this can be downloaded by apt-get repository. So modify as an improvement. Work item tracking Microsoft ADO (number only): [Build] fix docker-sonic-mgmt build #15567 How I did it By manually checking the release notes of pyaml and install azure-cli in newly installed docker container using apt-get How to verify it You can run below commands to validate: make configure PLATFORM=generic make target/docker-sonic-mgmt.gz Second line would fail without the commit. --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index f3b95c0cb226..bcb13b570ccf 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -5,6 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y apt-transport-https \ apt-utils \ + azure-cli \ build-essential \ ca-certificates \ cmake \ @@ -75,6 +76,7 @@ RUN pip install allure-pytest==2.8.22 \ pexpect \ prettytable \ psutil \ + pyaml==21.10.1 \ pyasn1==0.1.9 \ pycryptodome==3.9.8 \ pyfiglet \ @@ -130,9 +132,6 @@ RUN apt-get update \ && apt-get update \ && apt-get install -y docker-ce-cli -# Install Azure CLI -RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash - ## Copy and install sonic-mgmt docker dependencies COPY \ {% for deb in docker_sonic_mgmt_debs.split(' ') -%} From 78c262ea9f164e83d8ac9ea7b167ec19ddcbe71e Mon Sep 17 00:00:00 2001 From: vdahiya12 <67608553+vdahiya12@users.noreply.github.com> Date: Thu, 22 Jun 2023 09:04:05 -0700 Subject: [PATCH 020/107] [Arista][x86_64-arista_7050_qx32] Add Components to platform.json (#15252) * [Arista][x86_64-arista_7050_qx32] Add Components to platform.json Signed-off-by: vaibhav dahiya * fix comment Signed-off-by: vaibhav dahiya * fix comment Signed-off-by: vaibhav dahiya * reformat Signed-off-by: vaibhav dahiya --------- Signed-off-by: vaibhav dahiya --- .../x86_64-arista_7050_qx32/platform.json | 12 +++++++++++- .../x86_64-arista_7050_qx32s/platform.json | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/device/arista/x86_64-arista_7050_qx32/platform.json b/device/arista/x86_64-arista_7050_qx32/platform.json index 8772ce8b23db..ccce2079a29d 100644 --- a/device/arista/x86_64-arista_7050_qx32/platform.json +++ b/device/arista/x86_64-arista_7050_qx32/platform.json @@ -1,7 +1,17 @@ { "chassis": { "name": "DCS-7050QX-32", - "components": [], + "components": [ + { + "name": "Scd(addr=0000:04:00.0)" + }, + { + "name": "Ucd90120A(addr=6-004e)" + }, + { + "name": "Ucd90160(addr=10-004e)" + } + ], "fans": [ { "name": "fan1" diff --git a/device/arista/x86_64-arista_7050_qx32s/platform.json b/device/arista/x86_64-arista_7050_qx32s/platform.json index 70fbf749b22b..4309fe656947 100644 --- a/device/arista/x86_64-arista_7050_qx32s/platform.json +++ b/device/arista/x86_64-arista_7050_qx32s/platform.json @@ -1,7 +1,23 @@ { "chassis": { "name": "DCS-7050QX-32S", - "components": [], + "components": [ + { + "name": "Aboot()" + }, + { + "name": "Scd(addr=0000:02:00.0)" + }, + { + "name": "Ucd90120A(addr=4-004e)" + }, + { + "name": "Ucd90120A(addr=8-004e)" + }, + { + "name": "CrowSysCpld(addr=2-0023)" + } + ], "fans": [], "fan_drawers": [ { From 475fe27c0bbd9aa2f7ddc1274cb446cfebe7d789 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Thu, 22 Jun 2023 18:12:30 +0200 Subject: [PATCH 021/107] [dns] Add support for static DNS configuration. (#14549) - Why I did it Add support for static DNS configuration. According to sonic-net/SONiC#1262 HLD. - How I did it Add a new resolv-config.service that is responsible for transferring configuration from Config DB into /etc/resolv.conf file that is consumed by various subsystems in Linux to resolve domain names into IP addresses. - How to verify it Run the image compilation. Each component related to the static DNS feature is covered with the unit tests. Run sonic-mgmt tests. Static DNS feature will be covered with the system tests. Install the image and run manual tests. --- build_debian.sh | 7 ++- .../build_templates/sonic_debian_extension.j2 | 9 +++ .../interfaces/interfaces-config.sh | 2 + .../resolv-config/resolv-config.service | 15 +++++ .../resolv-config/resolv-config.sh | 61 +++++++++++++++++++ files/image_config/resolv-config/resolv.conf | 0 .../resolv-config/resolv.conf.head | 2 + .../image_config/resolv-config/resolv.conf.j2 | 3 + .../resolv-config/update-containers | 7 +++ src/sonic-config-engine/minigraph.py | 9 ++- .../tests/data/dns/resolv.conf | 3 + .../tests/data/dns/static_dns.json | 6 ++ .../tests/multi_npu_data/sample-minigraph.xml | 5 ++ .../tests/simple-sample-graph-case.xml | 6 ++ .../tests/simple-sample-graph-metadata.xml | 6 ++ src/sonic-config-engine/tests/test_cfggen.py | 5 ++ src/sonic-config-engine/tests/test_j2files.py | 8 +++ .../tests/test_minigraph_case.py | 5 ++ .../tests/test_multinpu_cfggen.py | 11 ++++ 19 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 files/image_config/resolv-config/resolv-config.service create mode 100755 files/image_config/resolv-config/resolv-config.sh delete mode 100644 files/image_config/resolv-config/resolv.conf create mode 100644 files/image_config/resolv-config/resolv.conf.head create mode 100644 files/image_config/resolv-config/resolv.conf.j2 create mode 100755 files/image_config/resolv-config/update-containers create mode 100644 src/sonic-config-engine/tests/data/dns/resolv.conf create mode 100644 src/sonic-config-engine/tests/data/dns/static_dns.json diff --git a/build_debian.sh b/build_debian.sh index 9462e4a54fba..6c1e9c381a3b 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -400,6 +400,7 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in jq \ auditd \ linux-perf \ + resolvconf \ lsof \ sysstat @@ -762,7 +763,11 @@ sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS ## Note: -x to skip directories on different file systems, such as /proc sudo du -hsx $FILESYSTEM_ROOT sudo mkdir -p $FILESYSTEM_ROOT/var/lib/docker -sudo cp files/image_config/resolv-config/resolv.conf $FILESYSTEM_ROOT/etc/resolv.conf + +## Clear DNS configuration inherited from the build server +sudo rm -f $FILESYSTEM_ROOT/etc/resolvconf/resolv.conf.d/original +sudo cp files/image_config/resolv-config/resolv.conf.head $FILESYSTEM_ROOT/etc/resolvconf/resolv.conf.d/head + sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -comp zstd -b 1M -e boot -e var/lib/docker -e $PLATFORM_DIR # Ensure admin gid is 1000 diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 04a404688ff3..fee493990867 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -430,6 +430,15 @@ j2 files/dhcp/dhclient.conf.j2 | sudo tee $FILESYSTEM_ROOT/etc/dhcp/dhclient.con sudo cp files/dhcp/ifupdown2_policy.json $FILESYSTEM_ROOT/etc/network/ifupdown2/policy.d sudo cp files/dhcp/90-dhcp6-systcl.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +# Copy DNS configuration files and templates +sudo cp $IMAGE_CONFIGS/resolv-config/resolv-config.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM +sudo cp $IMAGE_CONFIGS/resolv-config/resolv-config.sh $FILESYSTEM_ROOT/usr/bin/ +sudo cp $IMAGE_CONFIGS/resolv-config/resolv.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +echo "resolv-config.service" | sudo tee -a $GENERATED_SERVICE_FILE +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable resolvconf.service +sudo mkdir -p $FILESYSTEM_ROOT/etc/resolvconf/update-libc.d/ +sudo cp $IMAGE_CONFIGS/resolv-config/update-containers $FILESYSTEM_ROOT/etc/resolvconf/update-libc.d/ + # Copy initial interfaces configuration file, will be overwritten on first boot sudo cp $IMAGE_CONFIGS/interfaces/init_interfaces $FILESYSTEM_ROOT/etc/network/interfaces sudo mkdir -p $FILESYSTEM_ROOT/etc/network/interfaces.d diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index f6aa4147a4e4..cb2faea91f31 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -60,6 +60,8 @@ for intf_pid in $(ls -1 /var/run/dhclient*.Ethernet*.pid 2> /dev/null); do [[ -f ${intf_pid} ]] && kill `cat ${intf_pid}` && rm -f ${intf_pid} done +/usr/bin/resolv-config.sh cleanup + # Read sysctl conf files again sysctl -p /etc/sysctl.d/90-dhcp6-systcl.conf diff --git a/files/image_config/resolv-config/resolv-config.service b/files/image_config/resolv-config/resolv-config.service new file mode 100644 index 000000000000..18a261dcf5d0 --- /dev/null +++ b/files/image_config/resolv-config/resolv-config.service @@ -0,0 +1,15 @@ +[Unit] +Description=Update DNS configuration +Requires=updategraph.service +After=updategraph.service +BindsTo=sonic.target +After=sonic.target +StartLimitIntervalSec=0 + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/resolv-config.sh start + +[Install] +WantedBy=sonic.target diff --git a/files/image_config/resolv-config/resolv-config.sh b/files/image_config/resolv-config/resolv-config.sh new file mode 100755 index 000000000000..cffda6acb54b --- /dev/null +++ b/files/image_config/resolv-config/resolv-config.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +WD=/var/run/resolvconf/ +CONFIG_DIR=${WD}/interface/ +STATIC_CONFIG_FILE=mgmt.static +DYNAMIC_CONFIG_FILE_TEMPLATE=*.dhclient + +update_symlink() +{ + ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf +} + +start() +{ + update_symlink + + redis-dump -d 4 -k "DNS_NAMESERVER*" -y > /tmp/dns.json + if [[ $? -eq 0 && "$(cat /tmp/dns.json)" != "{}" ]]; then + # Apply static DNS configuration and disable updates + /sbin/resolvconf --disable-updates + pushd ${CONFIG_DIR} + # Backup dynamic configuration to restore it when the static configuration is removed + mv ${DYNAMIC_CONFIG_FILE_TEMPLATE} ${WD} || true + + sonic-cfggen -d -t /usr/share/sonic/templates/resolv.conf.j2,${STATIC_CONFIG_FILE} + + /sbin/resolvconf --enable-updates + /sbin/resolvconf -u + /sbin/resolvconf --disable-updates + popd + else + # Dynamic DNS configuration. Enable updates. It is expected to receive configuraution for DHCP server + /sbin/resolvconf --disable-updates + pushd ${CONFIG_DIR} + rm -f ${STATIC_CONFIG_FILE} + # Restore dynamic configuration if it exists + mv ${WD}/${DYNAMIC_CONFIG_FILE_TEMPLATE} ${CONFIG_DIR} || true + + /sbin/resolvconf --enable-updates + /sbin/resolvconf -u + fi +} + +clean-dynamic-conf() +{ + rm -f ${WD}/${DYNAMIC_CONFIG_FILE_TEMPLATE} + rm -f ${WD}/postponed-update +} + +case $1 in + start) + start + ;; + cleanup) + clean-dynamic-conf + ;; + *) + echo "Usage: $0 {start|clean-dynamic-conf}" + exit 2 + ;; +esac diff --git a/files/image_config/resolv-config/resolv.conf b/files/image_config/resolv-config/resolv.conf deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/files/image_config/resolv-config/resolv.conf.head b/files/image_config/resolv-config/resolv.conf.head new file mode 100644 index 000000000000..db81bded75e9 --- /dev/null +++ b/files/image_config/resolv-config/resolv.conf.head @@ -0,0 +1,2 @@ +# Dynamic resolv.conf(5) file generated by resolvconf(8) +# The content of this file may be overwritten during a config reload. diff --git a/files/image_config/resolv-config/resolv.conf.j2 b/files/image_config/resolv-config/resolv.conf.j2 new file mode 100644 index 000000000000..4887d2e01d45 --- /dev/null +++ b/files/image_config/resolv-config/resolv.conf.j2 @@ -0,0 +1,3 @@ +{% for ip in DNS_NAMESERVER|sort %} +nameserver {{ ip }} +{% endfor -%} diff --git a/files/image_config/resolv-config/update-containers b/files/image_config/resolv-config/update-containers new file mode 100755 index 000000000000..47d8328a80fe --- /dev/null +++ b/files/image_config/resolv-config/update-containers @@ -0,0 +1,7 @@ +#!/bin/bash + +for container in $(docker ps -a --format=" {{ .ID }}"); do + docker cp -L /etc/resolv.conf ${container}:/_resolv.conf + docker exec -t ${container} bash -c "cat /_resolv.conf > /etc/resolv.conf" + docker exec -t ${container} bash -c "rm /_resolv.conf" +done diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 81479d83669b..558c7e24e929 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -993,6 +993,7 @@ def parse_meta(meta, hname): dhcp_servers = [] dhcpv6_servers = [] ntp_servers = [] + dns_nameservers = [] tacacs_servers = [] mgmt_routes = [] erspan_dst = [] @@ -1023,6 +1024,8 @@ def parse_meta(meta, hname): dhcp_servers = value_group elif name == "NtpResources": ntp_servers = value_group + elif name == "DnsNameserverResources": + dns_nameservers = value_group elif name == "SyslogResources": syslog_servers = value_group elif name == "TacacsServer": @@ -1061,7 +1064,7 @@ def parse_meta(meta, hname): qos_profile = value elif name == "RackMgmtMap": rack_mgmt_map = value - return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map + return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, dns_nameservers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map def parse_linkmeta(meta, hname): @@ -1488,6 +1491,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw dhcp_servers = [] dhcpv6_servers = [] ntp_servers = [] + dns_nameservers = [] tacacs_servers = [] mgmt_routes = [] erspan_dst = [] @@ -1543,7 +1547,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw elif child.tag == str(QName(ns, "UngDec")): (u_neighbors, u_devices, _, _, _, _, _, _) = parse_png(child, hostname, None) elif child.tag == str(QName(ns, "MetadataDeclaration")): - (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map) = parse_meta(child, hostname) + (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, dns_nameservers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map) = parse_meta(child, hostname) elif child.tag == str(QName(ns, "LinkMetadataDeclaration")): linkmetas = parse_linkmeta(child, hostname) elif child.tag == str(QName(ns, "DeviceInfos")): @@ -1995,6 +1999,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) results['DHCP_RELAY'] = dhcp_relay_table results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) + results['DNS_NAMESERVER'] = dict((item, {}) for item in dns_nameservers) results['TACPLUS_SERVER'] = dict((item, {'priority': '1', 'tcp_port': '49'}) for item in tacacs_servers) if len(acl_table_types) > 0: results['ACL_TABLE_TYPE'] = acl_table_types diff --git a/src/sonic-config-engine/tests/data/dns/resolv.conf b/src/sonic-config-engine/tests/data/dns/resolv.conf new file mode 100644 index 000000000000..b90cade8f92d --- /dev/null +++ b/src/sonic-config-engine/tests/data/dns/resolv.conf @@ -0,0 +1,3 @@ +nameserver 1.1.1.1 +nameserver 2001:4860:4860::8888 + diff --git a/src/sonic-config-engine/tests/data/dns/static_dns.json b/src/sonic-config-engine/tests/data/dns/static_dns.json new file mode 100644 index 000000000000..0d2cf1804317 --- /dev/null +++ b/src/sonic-config-engine/tests/data/dns/static_dns.json @@ -0,0 +1,6 @@ +{ + "DNS_NAMESERVER": { + "1.1.1.1": {}, + "2001:4860:4860::8888": {} + } +} diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml index be3938f24bc4..0adcec5c8420 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml +++ b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml @@ -1425,6 +1425,11 @@ 17.39.1.129;17.39.1.130 + + DnsNameserverResources + + 1.1.1.1;8.8.8.8 + SnmpResources diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index 69b27c33e7b4..7e8f1579cdf4 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -500,6 +500,12 @@ 10.0.10.1;10.0.10.2 + + DnsNameserverResources + + 1.1.1.1;8.8.8.8 + + SnmpResources diff --git a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml index fbc33b49862a..c841ff8d1a9f 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -236,6 +236,12 @@ 10.0.10.1;10.0.10.2 + + DnsNameserverResources + + 20.2.2.2;30.3.3.3 + + SnmpResources diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 1428250aada4..50e3c2758a1e 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -696,6 +696,11 @@ def test_metadata_ntp(self): output = self.run_script(argument) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'10.0.10.1': {}, '10.0.10.2': {}}")) + def test_metadata_dns_nameserver(self): + argument = ['-m', self.sample_graph_metadata, '-p', self.port_config, '-v', "DNS_NAMESERVER"] + output = self.run_script(argument) + self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'20.2.2.2': {}, '30.3.3.3': {}}")) + def test_minigraph_vnet(self, **kwargs): graph_file = kwargs.get('graph_file', self.sample_graph_simple) argument = ['-m', graph_file, '-p', self.port_config, '-v', "VNET"] diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index ae49c445f583..50e5df4a4660 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -695,6 +695,14 @@ def test_backend_acl_template_render(self): self.run_script(argument, output_file=self.output_file) assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + def test_dns_template_render(self): + conf_template = os.path.join(self.test_dir, '..', '..', '..', 'files', 'image_config', 'resolv-config', 'resolv.conf.j2') + static_dns_conf = os.path.join(self.test_dir, "data", "dns", "static_dns.json") + expected = os.path.join(self.test_dir, "data", "dns", "resolv.conf") + + argument = ['-j', static_dns_conf, '-t', conf_template] + self.run_script(argument, output_file=self.output_file) + assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) def test_buffers_edgezone_aggregator_render_template(self): self._test_buffers_render_template('arista', 'x86_64-arista_7060_cx32s', 'Arista-7060CX-32S-D48C8', 'sample-arista-7060-t0-minigraph.xml', 'buffers.json.j2', 'buffer-arista7060-t0.json') diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index d33d2c14e825..035cff6edb25 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -277,6 +277,11 @@ def test_metadata_ntp(self): output = self.run_script(argument) self.assertEqual(output.strip(), "{'10.0.10.1': {}, '10.0.10.2': {}}") + def test_metadata_dns_nameserver(self): + argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "DNS_NAMESERVER"] + output = self.run_script(argument) + self.assertEqual(output.strip(), "{'1.1.1.1': {}, '8.8.8.8': {}}") + def test_minigraph_vnet(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "VNET"] output = self.run_script(argument) diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index bc4227f85d52..7026dfa84a61 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -150,6 +150,17 @@ def test_metadata_ntp(self): print("Log:asic{} sku {}".format(asic,output)) self.assertDictEqual(output, {}) + def test_metadata_dns_nameserver(self): + argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "DNS_NAMESERVER"] + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {'1.1.1.1': {}, '8.8.8.8': {}}) + #DNS_NAMESERVER data is present only in the host config + argument = ['-m', self.sample_graph, '--var-json', "DNS_NAMESERVER"] + for asic in range(NUM_ASIC): + output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) + print("Log:asic{} sku {}".format(asic,output)) + self.assertDictEqual(output, {}) + def test_mgmt_port(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "MGMT_PORT"] output = json.loads(self.run_script(argument)) From fca3458ae77384202408f123466ce30fd30f8f53 Mon Sep 17 00:00:00 2001 From: Mai Bui Date: Thu, 22 Jun 2023 16:16:11 -0400 Subject: [PATCH 022/107] [systemd-sonic-generator] replace sscanf with strtol (#15357) #### Why I did it Avoid 'sscanf()' for number conversions. Its use can lead to undefined behavior, slow processing, and integer overflows. Instead prefer the 'strto*()' family of functions. #### How I did it replace sscanf with strtol #### How to verify it Manual test --- src/systemd-sonic-generator/systemd-sonic-generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systemd-sonic-generator/systemd-sonic-generator.c b/src/systemd-sonic-generator/systemd-sonic-generator.c index 74f08fe39612..1d1a53dbcef9 100644 --- a/src/systemd-sonic-generator/systemd-sonic-generator.c +++ b/src/systemd-sonic-generator/systemd-sonic-generator.c @@ -569,7 +569,7 @@ int get_num_of_asic() { str_num_asic = strtok_r(NULL, "=", &saveptr); strip_trailing_newline(str_num_asic); if (str_num_asic != NULL){ - sscanf(str_num_asic, "%d",&num_asic); + num_asic = strtol(str_num_asic, NULL, 10); } break; } From 110a3fd3acb5ec5a9da7b7fce6ffd0d27ed782ac Mon Sep 17 00:00:00 2001 From: Mai Bui Date: Thu, 22 Jun 2023 16:16:56 -0400 Subject: [PATCH 023/107] docker prefer COPY to ADD in dockerfile (#15394) #### Why I did it Docker best practices prefer COPY to ADD https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy ##### Work item tracking - Microsoft ADO **(number only)**: 17418730 #### How I did it Use the COPY command as opposed to ADD unless working with a tar file. --- platform/p4/docker-sonic-p4/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/p4/docker-sonic-p4/Dockerfile.j2 b/platform/p4/docker-sonic-p4/Dockerfile.j2 index 80503b910e84..11e34ff1f88a 100644 --- a/platform/p4/docker-sonic-p4/Dockerfile.j2 +++ b/platform/p4/docker-sonic-p4/Dockerfile.j2 @@ -81,7 +81,7 @@ RUN sed -ri 's/^(save .*$)/# \1/g; s/^client-output-buffer-limit pubsub [0-9]+mb [0-9]+mb [0-9]+/client-output-buffer-limit pubsub 0 0 0/ \ ' /etc/redis/redis.conf -ADD port_config.ini /port_config.ini +COPY ["port_config.ini", "/port_config.ini"] COPY ["start.sh", "orchagent.sh", "config_bm.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/configdb-load.sh", "/usr/bin/"] From 16bb026c9c2691e333252682561771f3a47a5dde Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Fri, 23 Jun 2023 03:56:38 -0400 Subject: [PATCH 024/107] [chassis][lldp] Fix the lldp error log in host instance which doesn't contain front panel ports (#14814) * [chassis][lldp] Fix the lldp error log in host instance which doesn't contain front pannel ports --------- Signed-off-by: mlok --- dockers/docker-lldp/lldpmgrd | 5 ++++- src/sonic-py-common/sonic_py_common/device_info.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index 6d8540bf2613..2dad02f8794c 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -23,6 +23,8 @@ try: from sonic_py_common import daemon_base from swsscommon import swsscommon from sonic_py_common.interface import inband_prefix, recirc_prefix + from sonic_py_common import device_info + except ImportError as err: raise ImportError("%s - required module not found" % str(err)) @@ -357,7 +359,8 @@ def run_cmd(self, cmd): def check_timeout(self, start_time): if time.time() - start_time > PORT_INIT_TIMEOUT: - self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT)) + if device_info.is_frontend_port_present_in_host(): + self.log_error("Port init timeout reached ({} seconds), resuming lldpd...".format(PORT_INIT_TIMEOUT)) return True return False diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index d35dfbeeb9fa..2a7713433148 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -826,3 +826,13 @@ def is_fast_reboot_enabled(): state_db.close(state_db.STATE_DB) return fb_enable_state + + +def is_frontend_port_present_in_host(): + if is_supervisor(): + return False + if is_multi_npu(): + namespace_id = os.getenv("NAMESPACE_ID") + if not namespace_id: + return False + return True From 6ba5b84d980983312f779ad65cfc8c90b9674707 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Fri, 23 Jun 2023 13:30:34 -0700 Subject: [PATCH 025/107] [yang] add Yang model for `MUX_LINKMGR|LINK_PROBER` (#15384) Add yang model for MUX_LINKMGR|LINK_PROBER table. sign-off: zhangjing@microsoft.com --- src/sonic-yang-models/doc/Configuration.md | 20 +++++ src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 13 +++ .../yang_model_tests/tests/mux-linkmgr.json | 8 ++ .../tests_config/mux-linkmgr.json | 26 ++++++ .../yang-models/sonic-mux-linkmgr.yang | 88 +++++++++++++++++++ 6 files changed, 156 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json create mode 100644 src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 29e1272044a5..3590adea6b98 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -47,6 +47,7 @@ Table of Contents * [Management VRF](#management-vrf) * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) * [MUX_CABLE](#mux_cable) + * [MUX_LINKMGR](#mux_linkmgr) * [NEIGH](#neigh) * [NTP Global Configuration](#ntp-global-configuration) * [NTP and SYSLOG servers](#ntp-and-syslog-servers) @@ -1403,6 +1404,25 @@ The **MUX_CABLE** table is used for dualtor interface configuration. The `cable_ } ``` +### MUX_LINKMGR +The **MUX_LINKMGR** table is used for dualtor device configuration. +``` +{ + "MUX_LINKMGR": { + "LINK_PROBER": { + "interval_v4": "100", + "interval_v6": "1000", + "positive_signal_count": "1", + "negative_signal_count": "3", + "suspend_timer": "500", + "use_well_known_mac": "enabled", + "src_mac": "ToRMac", + "interval_pck_loss_count_update": "3" + } + } +} +``` + ### NEIGH The **NEIGH** table is used to keep track of resolved and static neighbors. diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index eab62ddcab6c..d6aeb3e0d88e 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -133,6 +133,7 @@ def run(self): './yang-models/sonic-mirror-session.yang', './yang-models/sonic-mpls-tc-map.yang', './yang-models/sonic-mux-cable.yang', + './yang-models/sonic-mux-linkmgr.yang', './yang-models/sonic-neigh.yang', './yang-models/sonic-ntp.yang', './yang-models/sonic-nat.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 9d4c291cb081..37a8e024e4d4 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2120,6 +2120,19 @@ } }, + "MUX_LINKMGR": { + "LINK_PROBER": { + "interval_v4": "100", + "interval_v6": "1000", + "positive_signal_count": "1", + "negative_signal_count": "3", + "suspend_timer": "500", + "use_well_known_mac": "enabled", + "src_mac": "ToRMac", + "interval_pck_loss_count_update": "3" + } + }, + "NEIGH": { "Vlan100|100.1.1.3": { "family": "IPv4" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json b/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json new file mode 100644 index 000000000000..3f399eec76cc --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json @@ -0,0 +1,8 @@ +{ + "MUX_LINKMGR_LINK_PROBER_INTERVAL_CHANGE": { + "desc": "Consume ICMP heartbeat interval and timeout config changes. " + }, + "MUX_LINKMGR_LINK_PROBER_CHANGE_MAC_ADDR": { + "desc": "Use well-known mac and vlan mac as dst/src in linkmgrd link prober. " + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json new file mode 100644 index 000000000000..2210c169365c --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json @@ -0,0 +1,26 @@ +{ + "MUX_LINKMGR_LINK_PROBER_INTERVAL_CHANGE": { + "sonic-mux-linkmgr:sonic-mux-linkmgr": { + "sonic-mux-linkmgr:MUX_LINKMGR": { + "sonic-mux-linkmgr:LINK_PROBER": + { + "interval_v4": "1000", + "interval_v6": "10000", + "positive_signal_count": 3, + "negative_signal_count": 9 + } + } + } + }, + "MUX_LINKMGR_LINK_PROBER_CHANGE_MAC_ADDR": { + "sonic-mux-linkmgr:sonic-mux-linkmgr": { + "sonic-mux-linkmgr:MUX_LINKMGR": { + "sonic-mux-linkmgr:LINK_PROBER": + { + "use_well_known_mac": "enabled", + "src_mac": "VlanMac" + } + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang b/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang new file mode 100644 index 000000000000..93e605ea8e51 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang @@ -0,0 +1,88 @@ +module sonic-mux-linkmgr { + namespace "http://github.com/sonic-net/sonic-mux-linkmgr"; + prefix mux_linkmgr; + yang-version 1.1; + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONiC DualToR Linkmgrd configuration data"; + + revision 2023-06-07 { + description + "Initial revision"; + } + + container sonic-mux-linkmgr { + + container MUX_LINKMGR { + + container LINK_PROBER { + + leaf interval_v4 { + type uint32; + default 100; + units milliseconds; + + description "IPv4 ICMP heartbeat interval. "; + } + + leaf interval_v6 { + type uint32; + default 1000; + units milliseconds; + + description "IPv6 ICMP heartbeat interval. "; + } + + leaf positive_signal_count { + type uint32; + default 1; + + description "Linkmgrd positive signal count. "; + } + + leaf negative_signal_count { + type uint32; + default 3; + + description "Linkmgrd negative signal count. "; + } + + leaf suspend_timer { + type uint32; + + description "ICMP heartbeat suspending timer, currently not in use. "; + } + + leaf use_well_known_mac { + type enumeration { + enum enabled; + enum disabled; + } + + description "ICMP heartbeat use well known mac as dst mac or not. "; + } + + leaf src_mac { + type enumeration { + enum ToRMac; + enum VlanMac; + } + + description "ICMP heartbeat use what mac as src mac. "; + } + + leaf interval_pck_loss_count_update { + type uint32; + + description "The frequency of streaming ICMP heartbeat loss data to telemetry. "; + } + } + } + } +} \ No newline at end of file From c1462f59e3d9e583119fdca2384bd739f5a5d75d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 25 Jun 2023 15:27:11 +0800 Subject: [PATCH 026/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15592) --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index a391ed0acc4e..7fe76e001d43 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit a391ed0acc4ed5b7a7d3a435f9a8429cc97af3db +Subproject commit 7fe76e001d4367c508c26816c95ba9d182ea333f From 05aa404e127cbcafa919e233a4a196a24141d8f5 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 25 Jun 2023 16:02:27 +0800 Subject: [PATCH 027/107] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#15611) --- 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 c3a77cceb9eb..d6453bcb372b 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit c3a77cceb9ebd8354d87e1a0e5e761d4a3840e50 +Subproject commit d6453bcb372b2fc93995ef6ccf5a40f0638506a8 From 2f4cd3ac72b27d2db4f3811860cb24b40b3459fe Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 25 Jun 2023 16:35:57 +0800 Subject: [PATCH 028/107] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#15591) #### Why I did it src/sonic-host-services ``` * eab4a9e - (HEAD -> master, origin/master, origin/HEAD) [hostcfgd][dns] Subscribe to DNS_NAMESERVER table to react to static DNS configuration changes. (#49) (2 days ago) [Oleksandr Ivantsiv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 508d642f5866..eab4a9ee30be 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 508d642f58665dd1925fe2a1eb6e9d7b368c7dda +Subproject commit eab4a9ee30be81da70d38f1320c37caef261e7e3 From 6bb0483af3ac0f33d3e731aa6788d890242d2b0a Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Sun, 25 Jun 2023 16:51:58 +0800 Subject: [PATCH 029/107] [sonic-mgmt] install newest az-cli to mitigate old version az-cli issue (#15621) Force merge to work around the az-cli installation issue. --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index bcb13b570ccf..5534d3112a41 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -5,13 +5,14 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y apt-transport-https \ apt-utils \ - azure-cli \ build-essential \ ca-certificates \ cmake \ curl \ default-jre \ git \ + gnupg \ + gnupg-agent \ iproute2 \ iputils-ping \ isc-dhcp-client \ @@ -122,16 +123,18 @@ RUN pip install allure-pytest==2.8.22 \ && pip install scapy==2.4.5 --upgrade --ignore-installed # Install docker-ce-cli -RUN apt-get update \ - && apt-get install -y \ - apt-transport-https \ - ca-certificates \ - gnupg-agent \ - && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ && apt-get update \ && apt-get install -y docker-ce-cli +# Install Azure CLI, following https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-2-step-by-step-installation-instructions +RUN mkdir -p /etc/apt/keyrings \ + && curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null \ + && chmod go+r /etc/apt/keyrings/microsoft.gpg \ + && echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | tee /etc/apt/sources.list.d/azure-cli.list \ + && apt-get update && apt-get install -y azure-cli + ## Copy and install sonic-mgmt docker dependencies COPY \ {% for deb in docker_sonic_mgmt_debs.split(' ') -%} From f978b2bb5342b4fabb26ae0ab893975a9e9cf93d Mon Sep 17 00:00:00 2001 From: nmoray Date: Mon, 26 Jun 2023 05:06:09 +0530 Subject: [PATCH 030/107] Timezone sync issue between the host and containers (#14000) #### Why I did it To fix the timezone sync issue between the containers and the host. If a certain timezone has been configured on the host (SONIC) then the expectation is to reflect the same across all the containers. This will fix [Issue:13046](https://github.com/sonic-net/sonic-buildimage/issues/13046). For instance, a PST timezone has been set on the host and if the user checks the link flap logs (inside the FRR), it shows the UTC timestamp. Ideally, it should be PST. --- dockers/docker-database/docker-database-init.sh | 4 ++++ dockers/docker-dhcp-relay/start.sh | 4 ++++ dockers/docker-eventd/start.sh | 3 +++ dockers/docker-fpm-frr/docker_init.sh | 4 ++++ dockers/docker-iccpd/start.sh | 4 ++++ dockers/docker-lldp/start.sh | 4 ++++ dockers/docker-macsec/start.sh | 4 ++++ dockers/docker-macsec/supervisord.conf | 11 +++++++++++ dockers/docker-mux/docker-init.sh | 4 ++++ dockers/docker-nat/start.sh | 4 ++++ dockers/docker-orchagent/docker-init.j2 | 4 ++++ dockers/docker-platform-monitor/docker_init.j2 | 4 ++++ dockers/docker-router-advertiser/docker-init.sh | 4 ++++ dockers/docker-sflow/Dockerfile.j2 | 1 + dockers/docker-sflow/start.sh | 5 +++++ dockers/docker-sflow/supervisord.conf | 11 +++++++++++ dockers/docker-snmp/start.sh | 4 ++++ dockers/docker-sonic-mgmt-framework/start.sh | 4 ++++ dockers/docker-sonic-p4rt/start.sh | 4 ++++ dockers/docker-sonic-telemetry/start.sh | 4 ++++ dockers/docker-teamd/start.sh | 4 ++++ rules/docker-database.mk | 1 + rules/docker-dhcp-relay.mk | 1 + rules/docker-eventd.mk | 1 + rules/docker-fpm-frr.mk | 1 + rules/docker-iccpd.mk | 1 + rules/docker-lldp.mk | 1 + rules/docker-macsec.mk | 1 + rules/docker-mux.mk | 1 + rules/docker-nat.mk | 1 + rules/docker-orchagent.mk | 1 + rules/docker-p4rt.mk | 1 + rules/docker-platform-monitor.mk | 1 + rules/docker-router-advertiser.mk | 1 + rules/docker-sflow.mk | 1 + rules/docker-snmp.mk | 1 + rules/docker-sonic-mgmt-framework.mk | 1 + rules/docker-teamd.mk | 1 + rules/docker-telemetry.mk | 1 + 39 files changed, 113 insertions(+) create mode 100644 dockers/docker-sflow/start.sh diff --git a/dockers/docker-database/docker-database-init.sh b/dockers/docker-database/docker-database-init.sh index e2c3fcb727d2..cee131b402d4 100755 --- a/dockers/docker-database/docker-database-init.sh +++ b/dockers/docker-database/docker-database-init.sh @@ -95,4 +95,8 @@ do fi done +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-dhcp-relay/start.sh b/dockers/docker-dhcp-relay/start.sh index 87a9e5711f2f..ce0dce10ed3c 100755 --- a/dockers/docker-dhcp-relay/start.sh +++ b/dockers/docker-dhcp-relay/start.sh @@ -10,6 +10,10 @@ then ${CTR_SCRIPT} -f dhcp_relay -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + # If our supervisor config has entries in the "dhcp-relay" group... if [ $(supervisorctl status | grep -c "^dhcp-relay:") -gt 0 ]; then # Wait for all interfaces to come up and be assigned IPv4 addresses before diff --git a/dockers/docker-eventd/start.sh b/dockers/docker-eventd/start.sh index 60cd6a00aecb..2c357a857436 100755 --- a/dockers/docker-eventd/start.sh +++ b/dockers/docker-eventd/start.sh @@ -4,3 +4,6 @@ if [ "${RUNTIME_OWNER}" == "" ]; then RUNTIME_OWNER="kube" fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index d8058e9b5d8d..5e25739b219e 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -106,4 +106,8 @@ chmod 0755 /usr/sbin/bgp-unisolate mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-iccpd/start.sh b/dockers/docker-iccpd/start.sh index bba5e490c466..cb36ce69cfff 100644 --- a/dockers/docker-iccpd/start.sh +++ b/dockers/docker-iccpd/start.sh @@ -10,3 +10,7 @@ sonic-cfggen -d -t /usr/share/sonic/templates/iccpd.j2 > $ICCPD_CONF_PATH/iccpd. mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-lldp/start.sh b/dockers/docker-lldp/start.sh index 5a489884aea9..51057ae4ec79 100755 --- a/dockers/docker-lldp/start.sh +++ b/dockers/docker-lldp/start.sh @@ -22,3 +22,7 @@ mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status rm -f /var/run/lldpd.socket + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-macsec/start.sh b/dockers/docker-macsec/start.sh index 20d602bdd370..bfb684eecadd 100644 --- a/dockers/docker-macsec/start.sh +++ b/dockers/docker-macsec/start.sh @@ -1,2 +1,6 @@ #!/usr/bin/env bash +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + diff --git a/dockers/docker-macsec/supervisord.conf b/dockers/docker-macsec/supervisord.conf index fb88f17049b2..3ab4f372f101 100644 --- a/dockers/docker-macsec/supervisord.conf +++ b/dockers/docker-macsec/supervisord.conf @@ -28,6 +28,17 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +[program:start] +command=/usr/bin/start.sh +priority=2 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running + [program:macsecmgrd] command=/usr/bin/macsecmgrd priority=2 diff --git a/dockers/docker-mux/docker-init.sh b/dockers/docker-mux/docker-init.sh index bea1686132a1..1679ec5d9f8f 100755 --- a/dockers/docker-mux/docker-init.sh +++ b/dockers/docker-mux/docker-init.sh @@ -3,6 +3,10 @@ # Generate supervisord config file mkdir -p /etc/supervisor/conf.d/ +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + # The docker container should start this script as PID 1, so now that supervisord is # properly configured, we exec supervisord so that it runs as PID 1 for the # duration of the container's lifetime diff --git a/dockers/docker-nat/start.sh b/dockers/docker-nat/start.sh index 68603d007a51..74912ce01485 100755 --- a/dockers/docker-nat/start.sh +++ b/dockers/docker-nat/start.sh @@ -3,3 +3,7 @@ rm -f /var/run/nat/* mkdir -p /var/warmboot/nat + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-orchagent/docker-init.j2 b/dockers/docker-orchagent/docker-init.j2 index bea9befc0b6f..1e8574de153b 100755 --- a/dockers/docker-orchagent/docker-init.j2 +++ b/dockers/docker-orchagent/docker-init.j2 @@ -70,4 +70,8 @@ if [ -f "$IS_SUPERVISOR" ]; then fi fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-platform-monitor/docker_init.j2 b/dockers/docker-platform-monitor/docker_init.j2 index c93d1790bd00..d8667296efae 100755 --- a/dockers/docker-platform-monitor/docker_init.j2 +++ b/dockers/docker-platform-monitor/docker_init.j2 @@ -110,4 +110,8 @@ else sonic-cfggen -d -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-router-advertiser/docker-init.sh b/dockers/docker-router-advertiser/docker-init.sh index 6e1bb5545f82..02c5a8c72be1 100755 --- a/dockers/docker-router-advertiser/docker-init.sh +++ b/dockers/docker-router-advertiser/docker-init.sh @@ -14,4 +14,8 @@ sonic-cfggen $CFGGEN_PARAMS chmod +x /usr/bin/wait_for_link.sh +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-sflow/Dockerfile.j2 b/dockers/docker-sflow/Dockerfile.j2 index 7399be80eed2..e8aee5fe6bed 100644 --- a/dockers/docker-sflow/Dockerfile.j2 +++ b/dockers/docker-sflow/Dockerfile.j2 @@ -26,6 +26,7 @@ RUN apt-get clean -y && \ RUN sed -ri '/^DAEMON_ARGS=""/c DAEMON_ARGS="-c /var/log/hsflowd.crash"' /etc/init.d/hsflowd +COPY ["start.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] diff --git a/dockers/docker-sflow/start.sh b/dockers/docker-sflow/start.sh new file mode 100644 index 000000000000..8996769c4c5e --- /dev/null +++ b/dockers/docker-sflow/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sflow/supervisord.conf b/dockers/docker-sflow/supervisord.conf index 2c8b006df917..d6cd5092e53d 100644 --- a/dockers/docker-sflow/supervisord.conf +++ b/dockers/docker-sflow/supervisord.conf @@ -28,6 +28,17 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +[program:start] +command=/usr/bin/start.sh +priority=2 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running + [program:sflowmgrd] command=/usr/bin/sflowmgrd priority=2 diff --git a/dockers/docker-snmp/start.sh b/dockers/docker-snmp/start.sh index aefd0bfc3db6..6de6f740b0ad 100755 --- a/dockers/docker-snmp/start.sh +++ b/dockers/docker-snmp/start.sh @@ -27,3 +27,7 @@ sonic-cfggen $SONIC_CFGGEN_ARGS mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sonic-mgmt-framework/start.sh b/dockers/docker-sonic-mgmt-framework/start.sh index d6722a27fc77..2fefbb349cb5 100755 --- a/dockers/docker-sonic-mgmt-framework/start.sh +++ b/dockers/docker-sonic-mgmt-framework/start.sh @@ -2,3 +2,7 @@ mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sonic-p4rt/start.sh b/dockers/docker-sonic-p4rt/start.sh index d6722a27fc77..2fefbb349cb5 100755 --- a/dockers/docker-sonic-p4rt/start.sh +++ b/dockers/docker-sonic-p4rt/start.sh @@ -2,3 +2,7 @@ mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sonic-telemetry/start.sh b/dockers/docker-sonic-telemetry/start.sh index 08f7292f55ba..8d36f740fa38 100755 --- a/dockers/docker-sonic-telemetry/start.sh +++ b/dockers/docker-sonic-telemetry/start.sh @@ -12,3 +12,7 @@ fi mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index d67bc4e925c8..0b45239355ee 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -3,3 +3,7 @@ rm -f /var/run/teamd/* mkdir -p /var/warmboot/teamd + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/rules/docker-database.mk b/rules/docker-database.mk index b66583b9bd2c..a10609933c35 100644 --- a/rules/docker-database.mk +++ b/rules/docker-database.mk @@ -27,6 +27,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_DATABASE_DBG) $(DOCKER_DATABASE)_CONTAINER_NAME = database $(DOCKER_DATABASE)_RUN_OPT += --privileged -t $(DOCKER_DATABASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_DATABASE)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_DATABASE)_BASE_IMAGE_FILES += redis-cli:/usr/bin/redis-cli $(DOCKER_DATABASE)_FILES += $(SYSCTL_NET_CONFIG) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index c26995ad143b..f5d58f2de45b 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -47,6 +47,7 @@ endif $(DOCKER_DHCP_RELAY)_CONTAINER_NAME = dhcp_relay $(DOCKER_DHCP_RELAY)_CONTAINER_PRIVILEGED = true $(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /etc/sonic:/etc/sonic:ro +$(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /etc/timezone:/etc/timezone:ro $(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_DHCP_RELAY)_CONTAINER_TMPFS += /tmp/ $(DOCKER_DHCP_RELAY)_CONTAINER_TMPFS += /var/tmp/ diff --git a/rules/docker-eventd.mk b/rules/docker-eventd.mk index 304f295e2a4b..367b0abecccd 100644 --- a/rules/docker-eventd.mk +++ b/rules/docker-eventd.mk @@ -33,6 +33,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_EVENTD_DBG) $(DOCKER_EVENTD)_CONTAINER_NAME = eventd $(DOCKER_EVENTD)_RUN_OPT += --privileged -t $(DOCKER_EVENTD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_EVENTD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro SONIC_BULLSEYE_DOCKERS += $(DOCKER_EVENTD) SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_EVENTD_DBG) diff --git a/rules/docker-fpm-frr.mk b/rules/docker-fpm-frr.mk index 79d5a927d20f..b672d85bac27 100644 --- a/rules/docker-fpm-frr.mk +++ b/rules/docker-fpm-frr.mk @@ -30,6 +30,7 @@ SONIC_DOCKER_DBG_IMAGES += $(DOCKER_FPM_FRR_DBG) $(DOCKER_FPM_FRR)_CONTAINER_NAME = bgp $(DOCKER_FPM_FRR)_RUN_OPT += --privileged -t $(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_FPM_FRR)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-iccpd.mk b/rules/docker-iccpd.mk index eb58ee755cdc..e9f280499847 100644 --- a/rules/docker-iccpd.mk +++ b/rules/docker-iccpd.mk @@ -23,6 +23,7 @@ endif $(DOCKER_ICCPD)_CONTAINER_NAME = iccpd $(DOCKER_ICCPD)_RUN_OPT += --privileged -t $(DOCKER_ICCPD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ICCPD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ICCPD)_BASE_IMAGE_FILES += mclagdctl:/usr/bin/mclagdctl diff --git a/rules/docker-lldp.mk b/rules/docker-lldp.mk index b2e7b350f3bb..9f6a4d2e711d 100644 --- a/rules/docker-lldp.mk +++ b/rules/docker-lldp.mk @@ -30,6 +30,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_LLDP_DBG) $(DOCKER_LLDP)_CONTAINER_NAME = lldp $(DOCKER_LLDP)_RUN_OPT += --privileged -t $(DOCKER_LLDP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_LLDP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_LLDP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_LLDP)_BASE_IMAGE_FILES += lldpctl:/usr/bin/lldpctl diff --git a/rules/docker-macsec.mk b/rules/docker-macsec.mk index d4cce3ecfcb7..49f80133b9bd 100644 --- a/rules/docker-macsec.mk +++ b/rules/docker-macsec.mk @@ -40,6 +40,7 @@ $(DOCKER_MACSEC)_VERSION = 1.0.0 $(DOCKER_MACSEC)_PACKAGE_NAME = macsec $(DOCKER_MACSEC)_RUN_OPT += --privileged -t $(DOCKER_MACSEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MACSEC)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MACSEC)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_MACSEC)_SERVICE_REQUIRES = updategraph diff --git a/rules/docker-mux.mk b/rules/docker-mux.mk index cbdc1c06510d..2f9f93a9b890 100644 --- a/rules/docker-mux.mk +++ b/rules/docker-mux.mk @@ -32,4 +32,5 @@ endif $(DOCKER_MUX)_CONTAINER_NAME = mux $(DOCKER_MUX)_RUN_OPT += --privileged -t $(DOCKER_MUX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MUX)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MUX)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-nat.mk b/rules/docker-nat.mk index 3d2f2b011968..f4022547ffef 100644 --- a/rules/docker-nat.mk +++ b/rules/docker-nat.mk @@ -31,6 +31,7 @@ endif $(DOCKER_NAT)_CONTAINER_NAME = nat $(DOCKER_NAT)_RUN_OPT += --privileged -t $(DOCKER_NAT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_NAT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_NAT)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_NAT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-orchagent.mk b/rules/docker-orchagent.mk index eae484ccc5f7..1e877aef4bdc 100644 --- a/rules/docker-orchagent.mk +++ b/rules/docker-orchagent.mk @@ -37,6 +37,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_DBG) $(DOCKER_ORCHAGENT)_CONTAINER_NAME = swss $(DOCKER_ORCHAGENT)_RUN_OPT += --privileged -t $(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro $(DOCKER_ORCHAGENT)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro $(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/rules/docker-p4rt.mk b/rules/docker-p4rt.mk index 172346742ce1..865bf9fee861 100644 --- a/rules/docker-p4rt.mk +++ b/rules/docker-p4rt.mk @@ -31,6 +31,7 @@ endif $(DOCKER_P4RT)_CONTAINER_NAME = p4rt $(DOCKER_P4RT)_RUN_OPT += --privileged -t $(DOCKER_P4RT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_P4RT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_P4RT)_GIT_COMMIT = $(shell cd "$($(SONIC_P4RT)_SRC_PATH)" && git log -n 1 --format=format:"%H %s" || echo "Unable to fetch git log for p4rt") $(DOCKER_P4RT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index a87a30247337..daa19336fb6f 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -50,6 +50,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_PLATFORM_MONITOR_DBG) $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --privileged -t $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /var/run/platform_cache:/var/run/platform_cache:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/device/pddf:/usr/share/sonic/device/pddf:ro diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index 255ca00c01c7..e3f561be93dc 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -31,5 +31,6 @@ endif $(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --privileged -t $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_ROUTER_ADVERTISER)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-sflow.mk b/rules/docker-sflow.mk index 285264dcb0b1..c5ca661f72c1 100644 --- a/rules/docker-sflow.mk +++ b/rules/docker-sflow.mk @@ -31,6 +31,7 @@ endif $(DOCKER_SFLOW)_CONTAINER_NAME = sflow $(DOCKER_SFLOW)_RUN_OPT += --privileged -t $(DOCKER_SFLOW)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SFLOW)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_SFLOW)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_SFLOW)_BASE_IMAGE_FILES += psample:/usr/bin/psample diff --git a/rules/docker-snmp.mk b/rules/docker-snmp.mk index 037d58936170..085eadf7eab3 100644 --- a/rules/docker-snmp.mk +++ b/rules/docker-snmp.mk @@ -30,6 +30,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_DBG) $(DOCKER_SNMP)_CONTAINER_NAME = snmp $(DOCKER_SNMP)_RUN_OPT += --privileged -t $(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SNMP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_SNMP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index b0986e12d14e..7985f8e9be9d 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -31,6 +31,7 @@ endif $(DOCKER_MGMT_FRAMEWORK)_CONTAINER_NAME = mgmt-framework $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --privileged -t $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc:/host_etc:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/" diff --git a/rules/docker-teamd.mk b/rules/docker-teamd.mk index 8d92cd2533f4..ae5cc838450d 100644 --- a/rules/docker-teamd.mk +++ b/rules/docker-teamd.mk @@ -35,6 +35,7 @@ endif $(DOCKER_TEAMD)_CONTAINER_NAME = teamd $(DOCKER_TEAMD)_RUN_OPT += --privileged -t $(DOCKER_TEAMD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_TEAMD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_TEAMD)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_TEAMD)_BASE_IMAGE_FILES += teamdctl:/usr/bin/teamdctl diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 30e11d925195..5b66ff588b64 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -30,6 +30,7 @@ endif $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry $(DOCKER_TELEMETRY)_RUN_OPT += --privileged -t $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_TELEMETRY)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro ifneq ($(INCLUDE_SYSTEM_GNMI), y) $(DOCKER_TELEMETRY)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw From b07957bdad6766b17497a132d908b5bba9c0685d Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Mon, 26 Jun 2023 07:58:14 +0800 Subject: [PATCH 031/107] Fix issue: systemctl daemon-reload would sporadically cause udev handler fail (#15253) #### Why I did it A workaround to back port the fix for a systemd issue. The systemd issue: https://github.com/systemd/systemd/issues/24668 The systemd PR to fix the issue: https://github.com/systemd/systemd/pull/24673/files The formal solution should upgrade systemd to a version that contains the fix. But, systemd is a very basic service, upgrading systemd requires heavy test. #### How I did it Copy the correct systemd-udevd.service file in build time #### Tested branch (Please provide the tested image version) - [x] 202211 - [ ] ``` SONiC Software Version: SONiC.fix-udev.3-b65c7bdec_Internal SONiC OS Version: 11 Distribution: Debian 11.7 Kernel: 5.10.0-18-2-amd64 Build commit: b65c7bdec Build date: Mon Jun 19 10:54:50 UTC 2023 Built by: sw-r2d2-bot@r-build-sonic-ci02-241 Platform: x86_64-mlnx_msn4700-r0 HwSKU: ACS-MSN4700 ASIC: mellanox ASIC Count: 1 Serial Number: MT2022X08597 Model Number: MSN4700-WS2FO Hardware Revision: A1 Uptime: 08:10:11 up 1 min, 1 user, load average: 1.81, 0.67, 0.24 Date: Sun 25 Jun 2023 08:10:11 Docker images: REPOSITORY TAG IMAGE ID SIZE docker-fpm-frr fix-udev.3-b65c7bdec_Internal a7b911e7cb6f 346MB docker-fpm-frr latest a7b911e7cb6f 346MB docker-platform-monitor fix-udev.3-b65c7bdec_Internal 94c5178cf80b 731MB docker-platform-monitor latest 94c5178cf80b 731MB docker-orchagent fix-udev.3-b65c7bdec_Internal 46b393e0ace8 328MB docker-orchagent latest 46b393e0ace8 328MB docker-syncd-mlnx fix-udev.3-b65c7bdec_Internal 1f5c6c23e33a 734MB docker-syncd-mlnx latest 1f5c6c23e33a 734MB docker-sflow fix-udev.3-b65c7bdec_Internal 7e45992c8c59 317MB docker-sflow latest 7e45992c8c59 317MB docker-teamd fix-udev.3-b65c7bdec_Internal e4d905592cda 316MB docker-teamd latest e4d905592cda 316MB docker-nat fix-udev.3-b65c7bdec_Internal 7fe799367580 319MB docker-nat latest 7fe799367580 319MB docker-macsec latest d702a5554171 318MB docker-snmp fix-udev.3-b65c7bdec_Internal 3bce8fcf71cd 338MB docker-snmp latest 3bce8fcf71cd 338MB docker-sonic-telemetry fix-udev.3-b65c7bdec_Internal f13949cbc817 597MB docker-sonic-telemetry latest f13949cbc817 597MB docker-dhcp-relay latest 153d9072805d 306MB docker-router-advertiser fix-udev.3-b65c7bdec_Internal aed642b9a6bc 299MB docker-router-advertiser latest aed642b9a6bc 299MB docker-sonic-p4rt fix-udev.3-b65c7bdec_Internal a3cae5ca65a7 870MB docker-sonic-p4rt latest a3cae5ca65a7 870MB docker-mux fix-udev.3-b65c7bdec_Internal b81f0401b9a8 347MB docker-mux latest b81f0401b9a8 347MB docker-eventd fix-udev.3-b65c7bdec_Internal c5917d0e801f 298MB docker-eventd latest c5917d0e801f 298MB docker-lldp fix-udev.3-b65c7bdec_Internal fd5dc14a7976 341MB docker-lldp latest fd5dc14a7976 341MB docker-database fix-udev.3-b65c7bdec_Internal 438c2715a1dd 299MB docker-database latest 438c2715a1dd 299MB docker-sonic-mgmt-framework fix-udev.3-b65c7bdec_Internal 5c50b115fbcd 414MB docker-sonic-mgmt-framework latest ``` --- build_debian.sh | 22 +++++++++++------ ...y-fail-if-daemon-reload-command-runs.patch | 24 +++++++++++++++++++ 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 files/image_config/systemd/systemd-udevd/fix-udev-rule-may-fail-if-daemon-reload-command-runs.patch diff --git a/build_debian.sh b/build_debian.sh index 6c1e9c381a3b..e4df940db732 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -111,7 +111,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount [ -d $TRUSTED_GPG_DIR ] && [ ! -z "$(ls $TRUSTED_GPG_DIR)" ] && sudo cp $TRUSTED_GPG_DIR/* ${FILESYSTEM_ROOT}/etc/apt/trusted.gpg.d/ ## Pointing apt to public apt mirrors and getting latest packages, needed for latest security updates -scripts/build_mirror_config.sh files/apt $CONFIGURED_ARCH $IMAGE_DISTRO +scripts/build_mirror_config.sh files/apt $CONFIGURED_ARCH $IMAGE_DISTRO sudo cp files/apt/sources.list.$CONFIGURED_ARCH $FILESYSTEM_ROOT/etc/apt/sources.list sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-languages},no-check-valid-until,apt-multiple-retries} $FILESYSTEM_ROOT/etc/apt/apt.conf.d/ @@ -294,7 +294,7 @@ then ## Install Kubernetes master echo '[INFO] Install kubernetes master' install_kubernetes ${MASTER_KUBERNETES_VERSION} - + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \ https://packages.microsoft.com/keys/microsoft.asc | \ sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add - @@ -309,7 +309,7 @@ then sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove gnupg sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -o /tmp/cri-dockerd.deb -fsSL \ https://github.com/Mirantis/cri-dockerd/releases/download/v${MASTER_CRI_DOCKERD}/cri-dockerd_${MASTER_CRI_DOCKERD}.3-0.debian-${IMAGE_DISTRO}_amd64.deb - sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/cri-dockerd.deb + sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install -f /tmp/cri-dockerd.deb sudo LANG=C chroot $FILESYSTEM_ROOT rm -f /tmp/cri-dockerd.deb else echo '[INFO] Skipping Install kubernetes master' @@ -448,6 +448,14 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in systemd-sysv \ ntp +# Workaround for issue: The udev rule may fail to be executed because the +# daemon-reload command is executed in parallel +# Github issue: https://github.com/systemd/systemd/issues/24668 +# Github PR: https://github.com/systemd/systemd/pull/24673 +# This workaround should be removed after a upstream already contains the fixes +sudo patch $FILESYSTEM_ROOT/lib/systemd/system/systemd-udevd.service \ + files/image_config/systemd/systemd-udevd/fix-udev-rule-may-fail-if-daemon-reload-command-runs.patch + if [[ $TARGET_BOOTLOADER == grub ]]; then if [[ $CONFIGURED_ARCH == amd64 ]]; then GRUB_PKG=grub-pc-bin @@ -635,10 +643,10 @@ then fi # ################# -# secure boot +# secure boot # ################# if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" && $SONIC_ENABLE_SECUREBOOT_SIGNATURE != 'y' ]]; then - # note: SONIC_ENABLE_SECUREBOOT_SIGNATURE is a feature that signing just kernel, + # note: SONIC_ENABLE_SECUREBOOT_SIGNATURE is a feature that signing just kernel, # SECURE_UPGRADE_MODE is signing all the boot component including kernel. # its required to do not enable both features together to avoid conflicts. echo "Secure Boot support build stage: Starting .." @@ -647,14 +655,14 @@ if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" && $SONIC_ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ shim-unsigned \ grub-efi - + if [ ! -f $SECURE_UPGRADE_SIGNING_CERT ]; then echo "Error: SONiC SECURE_UPGRADE_SIGNING_CERT=$SECURE_UPGRADE_SIGNING_CERT key missing" exit 1 fi if [[ $SECURE_UPGRADE_MODE == 'dev' ]]; then - # development signing & verification + # development signing & verification if [ ! -f $SECURE_UPGRADE_DEV_SIGNING_KEY ]; then echo "Error: SONiC SECURE_UPGRADE_DEV_SIGNING_KEY=$SECURE_UPGRADE_DEV_SIGNING_KEY key missing" diff --git a/files/image_config/systemd/systemd-udevd/fix-udev-rule-may-fail-if-daemon-reload-command-runs.patch b/files/image_config/systemd/systemd-udevd/fix-udev-rule-may-fail-if-daemon-reload-command-runs.patch new file mode 100644 index 000000000000..960efcbde6fe --- /dev/null +++ b/files/image_config/systemd/systemd-udevd/fix-udev-rule-may-fail-if-daemon-reload-command-runs.patch @@ -0,0 +1,24 @@ +# ------------------------------------------------------------------- +# Patch for /lib/systemd/system/systemd-udevd.service +# Fix issue: The udev rule may fail to be executed because the +# daemon-reload command is executed in parallel +# Github issue: https://github.com/systemd/systemd/issues/24668 +# Github PR: https://github.com/systemd/systemd/pull/24673 +# ------------------------------------------------------------------- +@@ -16,8 +16,6 @@ + ConditionPathIsReadWrite=/sys + + [Service] +-DeviceAllow=block-* rwm +-DeviceAllow=char-* rwm + Type=notify + # Note that udev will reset the value internally for its workers + OOMScoreAdjust=-1000 +@@ -29,7 +27,6 @@ + KillMode=mixed + TasksMax=infinity + PrivateMounts=yes +-ProtectClock=yes + ProtectHostname=yes + MemoryDenyWriteExecute=yes + RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 \ No newline at end of file From ccf1cd57cae9689fe697e10094b06fdaea814338 Mon Sep 17 00:00:00 2001 From: ycoheNvidia <99744138+ycoheNvidia@users.noreply.github.com> Date: Mon, 26 Jun 2023 12:04:40 +0300 Subject: [PATCH 032/107] Add support for secure upgrade (#11862) - What I did Added support for secure upgrade. - How I did it During sonic_installer install, added secure upgrade image verification. HLD can be found in the following PR: sonic-net/SONiC#1024 - Why I did it Feature is used to allow image was not modified since built from vendor. During installation, image can be verified with a signature attached to it. - How I did it Feature includes image signing during build (in sonic buildimage repo) and verification during image install (in sonic-utilities). - How to verify it In order for image verification - image must be signed - need to provide signing key and certificate (paths in SECURE_UPGRADE_DEV_SIGNING_KEY and SECURE_UPGRADE_DEV_SIGNING_CERT in rules/config) during build , and during image install, need to enable secure boot flag in bios, and signing_certificate should be available in bios. - Feature dependencies In order for this feature to work smoothly, need to have secure boot feature implemented as well. The Secure boot feature will be merged in the near future. --- build_image.sh | 2 +- installer/sharch_body.sh | 8 +++++-- onie-mk-demo.sh | 48 ++++++++++++++++++++++++++++++++++++++- scripts/sign_image_dev.sh | 11 +++++++++ 4 files changed, 65 insertions(+), 4 deletions(-) create mode 100755 scripts/sign_image_dev.sh diff --git a/build_image.sh b/build_image.sh index 4b1dfc9582ee..62d03296020e 100755 --- a/build_image.sh +++ b/build_image.sh @@ -86,7 +86,7 @@ generate_onie_installer_image() ## Note: Don't leave blank between lines. It is single line command. ./onie-mk-demo.sh $CONFIGURED_ARCH $TARGET_MACHINE $TARGET_PLATFORM-$TARGET_MACHINE-$ONIEIMAGE_VERSION \ installer platform/$TARGET_MACHINE/platform.conf $output_file OS $IMAGE_VERSION $ONIE_IMAGE_PART_SIZE \ - $ONIE_INSTALLER_PAYLOAD + $ONIE_INSTALLER_PAYLOAD $SECURE_UPGRADE_SIGNING_CERT $SECURE_UPGRADE_DEV_SIGNING_KEY } # Generate asic-specific device list diff --git a/installer/sharch_body.sh b/installer/sharch_body.sh index e6289371cd58..9683b4692dca 100644 --- a/installer/sharch_body.sh +++ b/installer/sharch_body.sh @@ -11,7 +11,9 @@ ## echo -n "Verifying image checksum ..." -sha1=$(sed -e '1,/^exit_marker$/d' "$0" | sha1sum | awk '{ print $1 }') +payload_image_size=%%PAYLOAD_IMAGE_SIZE%% + +sha1=$(sed -e '1,/^exit_marker$/d' "$0" | head -c $payload_image_size | sha1sum | awk '{ print $1 }') payload_sha1=%%IMAGE_SHA1%% @@ -45,7 +47,9 @@ if [ "$(id -u)" = "0" ] ; then fi cd $tmp_dir echo -n "Preparing image archive ..." -sed -e '1,/^exit_marker$/d' $archive_path | tar xf - || exit 1 + +sed -e '1,/^exit_marker$/d' $archive_path | head -c $payload_image_size | tar xf - || exit 1 + echo " OK." cd $cur_wd if [ -n "$extract" ] ; then diff --git a/onie-mk-demo.sh b/onie-mk-demo.sh index 0905673d42cb..b466441ca31b 100755 --- a/onie-mk-demo.sh +++ b/onie-mk-demo.sh @@ -14,6 +14,9 @@ output_file=$6 demo_type=$7 image_version=$8 onie_image_part_size=$9 +onie_installer_payload=${10} +cert_file=${11} +key_file=${12} shift 9 @@ -100,7 +103,7 @@ sed -i -e "s/%%DEMO_TYPE%%/$demo_type/g" \ -e "s@%%OUTPUT_RAW_IMAGE%%@$output_raw_image@" \ $tmp_installdir/install.sh || clean_up 1 echo -n "." -cp -r $* $tmp_installdir || clean_up 1 +cp -r $onie_installer_payload $tmp_installdir || clean_up 1 echo -n "." [ -r "$platform_conf" ] && { cp $platform_conf $tmp_installdir || clean_up 1 @@ -130,7 +133,50 @@ cp $installer_dir/sharch_body.sh $output_file || { # Replace variables in the sharch template sed -i -e "s/%%IMAGE_SHA1%%/$sha1/" $output_file echo -n "." +tar_size="$(wc -c < "${sharch}")" +sed -i -e "s|%%PAYLOAD_IMAGE_SIZE%%|${tar_size}|" ${output_file} cat $sharch >> $output_file +echo "secure upgrade flags: SECURE_UPGRADE_MODE = $SECURE_UPGRADE_MODE, \ +SECURE_UPGRADE_DEV_SIGNING_KEY = $SECURE_UPGRADE_DEV_SIGNING_KEY, SECURE_UPGRADE_SIGNING_CERT = $SECURE_UPGRADE_SIGNING_CERT" + +if [ "$SECURE_UPGRADE_MODE" = "dev" -o "$SECURE_UPGRADE_MODE" = "prod" ]; then + CMS_SIG="${tmp_dir}/signature.sig" + DIR="$(dirname "$0")" + scripts_dir="${DIR}/scripts" + echo "$0 $SECURE_UPGRADE_MODE signing - creating CMS signature for ${output_file}. Output file ${CMS_SIG}" + + if [ "$SECURE_UPGRADE_MODE" = "dev" ]; then + echo "$0 dev keyfile location: ${key_file}." + [ -f ${scripts_dir}/sign_image_dev.sh ] || { + echo "dev sign script ${scripts_dir}/sign_image_dev.sh not found" + rm -rf ${output_file} + } + (${scripts_dir}/sign_image_dev.sh ${cert_file} ${key_file} ${output_file} ${CMS_SIG}) || { + echo "CMS sign error $?" + rm -rf ${CMS_SIG} ${output_file} + } + else # "$SECURE_UPGRADE_MODE" has to be equal to "prod" + [ -f ${scripts_dir}/sign_image_${machine}.sh ] || { + echo "prod sign script ${scripts_dir}/sign_image_${machine}.sh not found" + rm -rf ${output_file} + } + (${scripts_dir}/sign_image_${machine}.sh ${output_file} ${CMS_SIG} ${SECURE_UPGRADE_MODE}) || { + echo "CMS sign error $?" + rm -rf ${CMS_SIG} ${output_file} + } + fi + + [ -f "$CMS_SIG" ] || { + echo "Error: CMS signature not created - exiting without signing" + clean_up 1 + } + # append signature to binary + cat ${CMS_SIG} >> ${output_file} + sudo rm -rf ${CMS_SIG} +elif [ "$SECURE_UPGRADE_MODE" -ne "no_sign" ]; then + echo "SECURE_UPGRADE_MODE not defined or defined as $SECURE_UPGRADE_MODE - build without signing" +fi + rm -rf $tmp_dir echo " Done." diff --git a/scripts/sign_image_dev.sh b/scripts/sign_image_dev.sh new file mode 100755 index 000000000000..668672f49378 --- /dev/null +++ b/scripts/sign_image_dev.sh @@ -0,0 +1,11 @@ +cert_file=$1 +key_file=$2 +image_to_sign=$3 +cms_sig_out=$4 +openssl cms -sign -nosmimecap -signer ${cert_file} -inkey ${key_file} -binary -in $image_to_sign -outform pem -out ${cms_sig_out} || { + echo "$?: CMS sign error" + sudo rm -rf ${cms_sig_out} + exit 1 +} +echo "CMS sign OK" +exit 0 From aa11acddddf33c6842c15e3edee6bf9bea86724b Mon Sep 17 00:00:00 2001 From: mssonicbld Date: Mon, 26 Jun 2023 05:52:00 +0000 Subject: [PATCH 033/107] [ci/build]: Upgrade SONiC package versions --- .../versions-deb-bullseye | 5 +- .../versions-deb-bullseye-arm64 | 2 - .../versions-deb-bullseye-armhf | 1 - .../build-sonic-slave-bullseye/versions-py3 | 10 +-- .../versions-py3-all-arm64 | 5 -- .../versions-deb-buster-arm64 | 4 +- .../versions-deb-buster-armhf | 4 +- files/build/versions/default/versions-docker | 24 +++--- files/build/versions/default/versions-git | 20 ++--- files/build/versions/default/versions-mirror | 20 ++--- files/build/versions/default/versions-web | 80 +++++++++---------- .../docker-base-buster/versions-deb-buster | 8 +- .../versions-deb-bullseye | 2 +- .../versions-deb-buster | 2 +- .../docker-config-engine-buster/versions-py3 | 2 +- .../docker-database/versions-deb-bullseye | 2 +- .../docker-dhcp-relay/versions-deb-bullseye | 2 +- .../docker-eventd/versions-deb-bullseye | 2 +- .../docker-fpm-frr/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../docker-gbsyncd-vs/versions-deb-bullseye | 2 +- .../dockers/docker-lldp/versions-deb-bullseye | 2 +- .../docker-macsec/versions-deb-bullseye | 2 +- .../dockers/docker-mux/versions-deb-bullseye | 2 +- .../dockers/docker-nat/versions-deb-bullseye | 2 +- .../docker-orchagent/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 6 +- .../dockers/docker-ptf-sai/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 18 ++--- .../versions/dockers/docker-ptf/versions-py2 | 2 +- .../versions-deb-bullseye | 2 +- .../docker-sflow/versions-deb-bullseye | 2 +- .../dockers/docker-snmp/versions-deb-bullseye | 2 +- .../versions-deb-buster | 6 +- .../docker-sonic-mgmt-framework/versions-py3 | 4 +- .../versions-deb-bullseye | 2 +- .../dockers/docker-sonic-vs/versions-py3 | 10 +-- .../versions-deb-bullseye | 2 +- .../docker-syncd-brcm/versions-deb-bullseye | 2 +- .../docker-syncd-centec/versions-deb-bullseye | 2 +- .../docker-syncd-mlnx/versions-deb-bullseye | 2 +- .../docker-syncd-vs/versions-deb-bullseye | 2 +- .../docker-teamd/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 23 +++--- .../dockers/sonic-slave-bullseye/versions-py3 | 4 +- .../sonic-slave-buster/versions-deb-buster | 50 ++++++------ .../dockers/sonic-slave-buster/versions-py3 | 6 +- .../versions/host-image/versions-deb-bullseye | 3 +- files/build/versions/host-image/versions-py3 | 10 +-- 50 files changed, 185 insertions(+), 192 deletions(-) delete mode 100644 files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye index 886bca9f8d23..5142c35ba426 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye @@ -3,8 +3,8 @@ applibs-dev==1.mlnx.4.5.5142 bfnplatform==1.0.0 isc-dhcp-relay==4.4.1-2.3+deb11u2 kernel-mft-dkms==4.22.1-15 -libhiredis-dev==0.14.0-3~bpo9+1 -libhiredis0.14==0.14.0-3~bpo9+1 +libhiredis-dev==0.14.1-1 +libhiredis0.14==0.14.1-1 libnl-3-dev==3.5.0-1 libnl-cli-3-200==3.5.0-1 libnl-cli-3-dev==3.5.0-1 @@ -19,6 +19,7 @@ libsairedis==1.0.0 libsairedis-dev==1.0.0 libsaithrift-dev==0.9.4 libsaivs==1.0.0 +libsaivs-dev==1.0.0 libswsscommon==1.0.0 libswsscommon-dev==1.0.0 libtac-dev==1.4.1-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 index 90f712515be3..3bad5a5352bd 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -1,3 +1 @@ -libnl-3-200==3.5.0-1 -libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-arm64==5.10.140-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf index b6df7939876f..ea31993a2e6b 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,4 +1,3 @@ libnl-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-armmp==5.10.140-1 -mrvllibsai==1.11.0-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 index e22b015f7c34..c7bad22e6156 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -6,12 +6,12 @@ colorful==0.5.5 docker==6.1.3 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.12.1 +filelock==3.12.2 ijson==2.6.1 ipaddress==1.0.23 jsondiff==2.0.0 -jsonpatch==1.32 -jsonpointer==2.3 +jsonpatch==1.33 +jsonpointer==2.4 jsonschema==2.6.0 natsort==6.2.1 netaddr==0.8.0 @@ -21,7 +21,7 @@ pddf-platform==1.0 prefixed==0.7.0 prettyprinter==0.18.0 psutil==5.9.5 -pycairo==1.23.0 +pycairo==1.24.0 pycparser==2.21 pynacl==1.5.0 pyroute2==0.5.19 @@ -32,6 +32,6 @@ tabulate==0.8.2 thrift==0.14.1 toposort==1.6 wcwidth==0.2.6 -websocket-client==1.5.3 +websocket-client==1.6.1 www-authenticate==0.9.2 xmltodict==0.12.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 deleted file mode 100644 index 46df813bf748..000000000000 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 +++ /dev/null @@ -1,5 +0,0 @@ -bcrypt==3.2.2 -bitarray==1.5.3 -click==7.0 -requests==2.31.0 -zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 index 2f592dd8dbbc..7d6eef0555e9 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 @@ -1,5 +1,5 @@ -libhiredis-dev==0.14.0-3~bpo9+1 -libhiredis0.14==0.14.0-3~bpo9+1 +libhiredis-dev==0.14.1-1 +libhiredis0.14==0.14.1-1 libnl-3-200==3.5.0-1 libnl-3-dev==3.5.0-1 libnl-route-3-200==3.5.0-1 diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf index 2f592dd8dbbc..7d6eef0555e9 100644 --- a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf @@ -1,5 +1,5 @@ -libhiredis-dev==0.14.0-3~bpo9+1 -libhiredis0.14==0.14.0-3~bpo9+1 +libhiredis-dev==0.14.1-1 +libhiredis0.14==0.14.1-1 libnl-3-200==3.5.0-1 libnl-3-dev==3.5.0-1 libnl-route-3-200==3.5.0-1 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 8d2c6413a76c..9ed0e3d08b1b 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:1bf0e24813ee8306c3fba1fe074793eb91c15ee580b61fff7f3f41662bc0031d -amd64:amd64/debian:buster==sha256:a067a9e8b39d5f19659b3bc9fd4348f6319afabd0d6ba1fe3b43df108926ea92 -amd64:debian:bullseye==sha256:432f545c6ba13b79e2681f4cc4858788b0ab099fc1cca799cc0fae4687c69070 -amd64:debian:buster==sha256:322859539526a04978dee1a2575b515295f6706f17d280f877a634299a7c1414 -arm64:arm64v8/debian:bullseye==sha256:0d1881fd981442bd6721e0e4ff40eb0ba705475c3a8469482ccee9029af56ebf -arm64:arm64v8/debian:buster==sha256:62a3eb2f5ace2f8415171855a84375616cb3cdb60b799d1811c3fda923b8dfbc -arm64:debian:bullseye==sha256:432f545c6ba13b79e2681f4cc4858788b0ab099fc1cca799cc0fae4687c69070 -arm64:debian:buster==sha256:322859539526a04978dee1a2575b515295f6706f17d280f877a634299a7c1414 -armhf:arm32v7/debian:bullseye==sha256:16aa677e45937a8c9f2e5a932ff1a611bc85b6416e47ab66532e05af2c08e066 -armhf:arm32v7/debian:buster==sha256:5340ee96c308b59f4590ec929adeeaf61ffe5a0758adcba09d0595a6619c3462 -armhf:debian:bullseye==sha256:432f545c6ba13b79e2681f4cc4858788b0ab099fc1cca799cc0fae4687c69070 -armhf:debian:buster==sha256:322859539526a04978dee1a2575b515295f6706f17d280f877a634299a7c1414 +amd64:amd64/debian:bullseye==sha256:1e8185ca8683c04e6c23cc7bb21b564d54faeb7e20852a6068c85cbdd7bac531 +amd64:amd64/debian:buster==sha256:108052254277ea53cd807d2782ed3cbe4b9242256af5c7519c6e5692ae2b5d97 +amd64:debian:bullseye==sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d +amd64:debian:buster==sha256:28842e4895d36e67c49015c0b41089fa3248e865c76994b19f706ab91e800b95 +arm64:arm64v8/debian:bullseye==sha256:0f56dd5a1687619972eeb539b273b4f3ec04431db69d4b569c2ce6ef48478538 +arm64:arm64v8/debian:buster==sha256:25bb297f257d6422b3aa44891469abc07e63096ea721da57002f0297ddcc599c +arm64:debian:bullseye==sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d +arm64:debian:buster==sha256:28842e4895d36e67c49015c0b41089fa3248e865c76994b19f706ab91e800b95 +armhf:arm32v7/debian:bullseye==sha256:93effc32fdca33aebfcef7225219dde573daebd3e1ddd09ab21e635887271096 +armhf:arm32v7/debian:buster==sha256:626ee3ce3a78f7a900fc5a99bfdbb44297f1c943a4fe261de4ec3fb4a23266bd +armhf:debian:bullseye==sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d +armhf:debian:buster==sha256:28842e4895d36e67c49015c0b41089fa3248e865c76994b19f706ab91e800b95 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 9b9b9452af5c..bf87b6ba4461 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,24 +1,24 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==6eaeb04ac1fb53c19cdb18f666a4c054da037f08 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==90fed308660fd53ac4247b7242f280b01731b1c7 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==ea94c8b9f513f8a6ddc6ce1540fa41eaf4c8922a https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==3239be535d16b10881513c0e97500cbd110426ab -https://github.com/FreeRADIUS/freeradius-server.git==3cedb9b2588b334d37d1eae957eb811b5de45412 +https://github.com/flashrom/flashrom.git==1ee04cd5ac8bb636182d9d7c259110638b83c8b1 +https://github.com/FreeRADIUS/freeradius-server.git==14ddc663bc17ccdc6a7c860cfb188c58fb5536d1 https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 -https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 -https://github.com/lguohan/gnxi.git==f2b11e45b16ab13485ae14933f30c18ee6336499 -https://github.com/Marvell-switching/mrvl-prestera.git==9dbae444204a2c27b33be698ce497d55926b8893 +https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6 +https://github.com/lguohan/gnxi.git==b85e4ab565df4472fdcfcded2a53e6bf57aa493f +https://github.com/Marvell-switching/mrvl-prestera.git==179c08b0544db0b3a95a843e31266e00a68fb4b0 https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 -https://github.com/p4lang/ptf.git==b33f54b9a97f834be1c8522217d445b6b1cad2df +https://github.com/p4lang/ptf.git==d2e2d8ad005a451ad11f9d21af50079a0552921a https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==b9b61bc037aed4d3d0fac6b0b4d88bc78b7b485d +https://github.com/sflow/host-sflow==4dc68a95fa57758119d76e42965b32493ffd7094 https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/ethtool/==532e36ef02837c78df47f8d561aa04b5cfed438f +https://salsa.debian.org/kernel-team/ethtool/==581ffbde5b349852a56fa581f7b512a755c33e26 https://salsa.debian.org/kernel-team/initramfs-tools.git==193dfbb7929e518976f89f6c8dd9201982e56f80 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==4cb9ac54235e8f90a590a976e1404480fb521930 +https://salsa.debian.org/ssh-team/openssh.git==74d15e80b8730335a9b13469ca6cafe4c1c8e485 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 903c0dffb4c0..81b26f1d331e 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230611T000219Z -debian-security==20230611T000221Z +debian==20230625T000121Z +debian-security==20230625T000122Z download.docker.com_linux_debian_dists_bullseye==2023-06-09T17:17:20Z download.docker.com_linux_debian_dists_buster==2023-05-26T07:49:38Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230611T000221Z_dists_bullseye-security==2023-06-10T19:38:13Z -packages.trafficmanager.net_snapshot_debian-security_20230611T000221Z_dists_buster_updates==2023-06-10T19:38:13Z -packages.trafficmanager.net_snapshot_debian_20230611T000219Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230611T000219Z_dists_bullseye-backports==2023-06-10T11:24:09Z -packages.trafficmanager.net_snapshot_debian_20230611T000219Z_dists_bullseye-updates==2023-06-10T11:24:09Z -packages.trafficmanager.net_snapshot_debian_20230611T000219Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230611T000219Z_dists_buster-backports==2023-06-10T11:24:09Z -packages.trafficmanager.net_snapshot_debian_20230611T000219Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230625T000122Z_dists_bullseye-security==2023-06-22T22:43:03Z +packages.trafficmanager.net_snapshot_debian-security_20230625T000122Z_dists_buster_updates==2023-06-22T22:43:03Z +packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_bullseye-backports==2023-06-24T20:43:09Z +packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_bullseye-updates==2023-06-24T20:43:09Z +packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_buster-backports==2023-06-24T20:43:09Z +packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 3081ec12689e..0ead0b68cbae 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -15,9 +15,9 @@ http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0.orig.tar.gz http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p15+dfsg-1.debian.tar.xz==896c9b6679f379d8967b012a0cc792c2 http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p15+dfsg.orig.tar.xz==c1c557036197188a22ec285fa53149d8 http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb==d87d7b22de51937b1e706e4751b86251 -http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0-3~bpo9+1.debian.tar.xz==ef340aedc6fd42c549cd503bffb498b2 -http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0-3~bpo9+1.dsc==be4ce11ef67268e59e4b6be587327c40 -http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0.orig.tar.gz==6d565680a4af0d2e261abbc3e3431b2b +http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.1-1.debian.tar.xz==d0ef92c6f301ac5023f7953cf7816ff0 +http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.1-1.dsc==ef9e33d036c6dbb74a4ed12fefe2de8a +http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.1.orig.tar.gz==3e1c541f9df28becb82a611e63e3e939 http://www.mellanox.com/downloads/MFT/mft-4.22.1-15-x86_64-deb.tgz==fb58cd1a7dafef062a7c3ec8a398b5fd https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz==c64434548438df2cb1e53fb27c600e85 https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 @@ -69,7 +69,7 @@ https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz==6f56ef28c93cee644e8c4aa https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/5.1-2/bash_5.1-2.debian.tar.xz==9d0cbd5f463f461c840c95f62a64d61b https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/5.1-2/bash_5.1-2.dsc==be44c5a9fc12fb567a486f54b842dd9e https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/5.1-2/bash_5.1.orig.tar.xz==6ddb13b6111f601db08fc7c72afa0263 -https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py==628956b660575965429cec84b1778816 +https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py==963c345c75fe5c5bdedc05ed98a5fd1f https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.5/swagger-codegen-cli-2.4.5.jar==219f1453ff22482d9e080effbfa7fa81 https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_5.10.140-1.debian.tar.xz==9813a002af43da3a5be05f3d31e85328 https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_5.10.140-1.dsc==84ab224b073f97978802d9f998248fcc @@ -106,42 +106,42 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_arm64.deb==1d06900f03424fa5ce34a782605983fe -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libk5crypto3_1.18.3-6+deb11u1+fips_amd64.deb==5e8de29d5f6844f71f15cbf0c3993f1c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==411d2092cd614dd187bdc0ec0bb9598f -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==521dd7170cb9519fac3aa492ff3dd1ea -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libssl-dev_1.1.1n-0+deb11u4+fips_amd64.deb==a1833ecb83cddb66ce30bf4b28e48856 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libssl-doc_1.1.1n-0+deb11u4+fips_all.deb==52925c4fd9932ffe78798dd55bdb077e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/libssl1.1_1.1.1n-0+deb11u4+fips_amd64.deb==65000162eac58235fbf1acab52047ca9 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/openssh-client_8.4p1-5+deb11u1+fips_amd64.deb==bee0e4f52cf8dedd6dac78be18b02400 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/openssh-server_8.4p1-5+deb11u1+fips_amd64.deb==8ac4a8397c8e62d554718f1c8c6f5896 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/openssh-sftp-server_8.4p1-5+deb11u1+fips_amd64.deb==94740a01d5d025df8d99d3e5b7a0b0e9 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/openssl_1.1.1n-0+deb11u4+fips_amd64.deb==2f3040c1dc6230c5dd09994eeaace905 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==27559fec65ac317419222fd19bcf5150 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/amd64/symcrypt-openssl_0.7_amd64.deb==6d909de22cf4f44879b27a4fc2697cac -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libk5crypto3_1.18.3-6+deb11u1+fips_arm64.deb==0bb2a2d23f73e882d91b2e256aad08f6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==870a96b0d9d7fe753d495ad6574e4c03 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==eb8bb0d3806adbc987ec300e221a3baf -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libssl-dev_1.1.1n-0+deb11u4+fips_arm64.deb==56aed9e3cef3692a36129598bd9871d6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libssl-doc_1.1.1n-0+deb11u4+fips_all.deb==52925c4fd9932ffe78798dd55bdb077e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/libssl1.1_1.1.1n-0+deb11u4+fips_arm64.deb==5c760faf80f6f4efc71e255b2e0774fc -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/openssh-client_8.4p1-5+deb11u1+fips_arm64.deb==ce762b1730871a72bc423c97444342ad -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/openssh-server_8.4p1-5+deb11u1+fips_arm64.deb==c943526cf7317d4c0d05005db47b6992 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/openssh-sftp-server_8.4p1-5+deb11u1+fips_arm64.deb==4e360e97ed3f0eaead7a8ef79fa4f3d7 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/openssl_1.1.1n-0+deb11u4+fips_arm64.deb==68e32a58e12f960ce163decc0f756906 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==add04c26a72788957951d8581b5c8e2a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.7/arm64/symcrypt-openssl_0.7_arm64.deb==f25f73823a0f22805b8e0be43bef190f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libk5crypto3_1.18.3-6+deb11u1+fips_amd64.deb==5e8de29d5f6844f71f15cbf0c3993f1c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==71b75222c8bcd5ede55693a9223a3246 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==565cce5ca6e6a31a53b7a9e2faa4b7d9 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libssl-dev_1.1.1n-0+deb11u4+fips_amd64.deb==a1833ecb83cddb66ce30bf4b28e48856 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libssl-doc_1.1.1n-0+deb11u4+fips_all.deb==52925c4fd9932ffe78798dd55bdb077e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/libssl1.1_1.1.1n-0+deb11u4+fips_amd64.deb==65000162eac58235fbf1acab52047ca9 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssh-client_8.4p1-5+deb11u1+fips_amd64.deb==bee0e4f52cf8dedd6dac78be18b02400 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssh-server_8.4p1-5+deb11u1+fips_amd64.deb==8ac4a8397c8e62d554718f1c8c6f5896 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssh-sftp-server_8.4p1-5+deb11u1+fips_amd64.deb==94740a01d5d025df8d99d3e5b7a0b0e9 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/openssl_1.1.1n-0+deb11u4+fips_amd64.deb==2f3040c1dc6230c5dd09994eeaace905 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==66511f65e2873cda108e6bb3911abbf5 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/amd64/symcrypt-openssl_0.8_amd64.deb==0b838c07c4625a593cd914e414b656ea +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libk5crypto3_1.18.3-6+deb11u1+fips_arm64.deb==0bb2a2d23f73e882d91b2e256aad08f6 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==870a96b0d9d7fe753d495ad6574e4c03 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==df2b4d1672a297f855d0e85b382629cc +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libssl-dev_1.1.1n-0+deb11u4+fips_arm64.deb==56aed9e3cef3692a36129598bd9871d6 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libssl-doc_1.1.1n-0+deb11u4+fips_all.deb==52925c4fd9932ffe78798dd55bdb077e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/libssl1.1_1.1.1n-0+deb11u4+fips_arm64.deb==5c760faf80f6f4efc71e255b2e0774fc +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssh-client_8.4p1-5+deb11u1+fips_arm64.deb==ce762b1730871a72bc423c97444342ad +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssh-server_8.4p1-5+deb11u1+fips_arm64.deb==c943526cf7317d4c0d05005db47b6992 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssh-sftp-server_8.4p1-5+deb11u1+fips_arm64.deb==4e360e97ed3f0eaead7a8ef79fa4f3d7 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/openssl_1.1.1n-0+deb11u4+fips_arm64.deb==68e32a58e12f960ce163decc0f756906 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==71935b5d5780014e0048f0e9d84acdb9 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.8/arm64/symcrypt-openssl_0.8_arm64.deb==0ab2a6b1c621508eb5b39da92fd69060 https://sonicstorage.blob.core.windows.net/public/sai/bcmpai/REL_3.8/3.8/libsaibroncos_3.8_amd64.deb==f7c3f0ed8c97c2572e3c2e59faaae4a8 https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/REL_7.0_SAI_1.11/7.1.111.1/libsaibcm_dnx_7.1.111.1_amd64.deb==458f404279c3f30ec71de6bad7373323 https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/SAI_8.4.0_GA/8.4.0.2/xgs/libsaibcm-dev_8.4.0.2_amd64.deb==50bc5321ebdf6c3f065ba53509a742e4 diff --git a/files/build/versions/dockers/docker-base-buster/versions-deb-buster b/files/build/versions/dockers/docker-base-buster/versions-deb-buster index f7aaa91c60a0..73cdf27b1c74 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -8,7 +8,7 @@ libdaemon0==0.14-7 libdbus-1-3==1.12.24-0+deb10u1 libestr0==0.1.10-2.1 libexpat1==2.2.6-2+deb10u6 -libfastjson4==0.99.8-2 +libfastjson4==0.99.8-2+deb10u1 libgdbm-compat4==1.18.1-4 libgdbm6==1.18.1-4 libgssapi-krb5-2==1.17-3+deb10u5 @@ -64,6 +64,6 @@ readline-common==7.0-5 redis-tools==5:6.0.6-1~bpo10+1 rsyslog==8.1901.0-1+deb10u2 socat==1.7.4.1-3 -vim-common==2:8.1.0875-5+deb10u4 -vim-tiny==2:8.1.0875-5+deb10u4 -xxd==2:8.1.0875-5+deb10u4 +vim-common==2:8.1.0875-5+deb10u5 +vim-tiny==2:8.1.0875-5+deb10u5 +xxd==2:8.1.0875-5+deb10u5 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye index 39e3e32b2dd2..d686852ba6d6 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye @@ -1,7 +1,7 @@ apt-utils==2.2.4 dpkg-dev==1.20.12 libboost-serialization1.74.0==1.74.0-9 -libhiredis0.14==0.14.0-3~bpo9+1 +libhiredis0.14==0.14.1-1 libjs-jquery==3.5.1+dfsg+~3.5.5-7 libnl-3-200==3.5.0-1 libnl-cli-3-200==3.5.0-1 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster index 47ee62bb348e..67de9912f7b7 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -3,7 +3,7 @@ bzip2==1.0.6-9.2~deb10u2 dpkg-dev==1.19.8 libapt-inst2.0==1.8.2.3 libboost-serialization1.71.0==1.71.0-6~bpo10+1 -libhiredis0.14==0.14.0-3~bpo9+1 +libhiredis0.14==0.14.1-1 libnl-3-200==3.5.0-1 libnl-cli-3-200==3.5.0-1 libnl-genl-3-200==3.5.0-1 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index 34bf99a18dc4..70d81e6f2d3f 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -1,7 +1,7 @@ async-timeout==4.0.2 bitarray==1.5.3 ijson==2.6.1 -importlib-metadata==6.6.0 +importlib-metadata==6.7.0 ipaddress==1.0.23 jsondiff==2.0.0 lxml==4.9.1 diff --git a/files/build/versions/dockers/docker-database/versions-deb-bullseye b/files/build/versions/dockers/docker-database/versions-deb-bullseye index 8493b0e6aa5a..76ad9de84898 100644 --- a/files/build/versions/dockers/docker-database/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-database/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye index dc43b1434163..76db9967cbe8 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bullseye @@ -15,7 +15,7 @@ libexplain51==1.4.D001-11+deb11u1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libirs-export161==1:9.11.19+dfsg-2.1 diff --git a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye index 36188a31e892..20265004b97a 100644 --- a/files/build/versions/dockers/docker-eventd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-eventd/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye index 06b58d24b24c..8e9306966088 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -16,7 +16,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libjson-c5==0.15-2 diff --git a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye index c3d7b718ba51..d3cbca6be966 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -13,7 +13,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye index 45618871230d..67ade6f8b5a3 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye index c8f39651ff40..8f1853a7df3f 100644 --- a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye index 6f1dbf3e3a74..36e584830d4f 100644 --- a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye @@ -11,7 +11,7 @@ libevent-2.1-7==2.1.12-stable-1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye index cce9e68611e7..33d136604062 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-mux/versions-deb-bullseye b/files/build/versions/dockers/docker-mux/versions-deb-bullseye index bb0de019fcfd..74f70ebc0f01 100644 --- a/files/build/versions/dockers/docker-mux/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-mux/versions-deb-bullseye @@ -14,7 +14,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bullseye b/files/build/versions/dockers/docker-nat/versions-deb-bullseye index bdce4fce5990..79665247db1d 100644 --- a/files/build/versions/dockers/docker-nat/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-nat/versions-deb-bullseye @@ -13,7 +13,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libip4tc2==1.8.7-1 libip6tc2==1.8.7-1 diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye index 3747c20b0f65..552e796dc122 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-bullseye @@ -14,7 +14,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye index 8e9e9c1b400b..ea571f6d9037 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bullseye @@ -31,7 +31,7 @@ libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 libgraphite2-3==1.3.14-1 libharfbuzz0b==2.7.4-1 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libi2c0==4.2-1+b1 libicu67==67.1-7 libipt2==2.0.3-1 @@ -54,8 +54,8 @@ libswsscommon-dbgsym==1.0.0 libthai-data==0.1.28-3 libthai0==0.1.28-3 libunwind8==1.3.2-2 -libx11-6==2:1.7.2-1 -libx11-data==2:1.7.2-1 +libx11-6==2:1.7.2-1+deb11u1 +libx11-data==2:1.7.2-1+deb11u1 libxau6==1:1.0.9-1 libxcb-render0==1.14-3 libxcb-shm0==1.14-3 diff --git a/files/build/versions/dockers/docker-ptf-sai/versions-py3 b/files/build/versions/dockers/docker-ptf-sai/versions-py3 index 3ac7ddd9c461..4454071cb0f1 100644 --- a/files/build/versions/dockers/docker-ptf-sai/versions-py3 +++ b/files/build/versions/dockers/docker-ptf-sai/versions-py3 @@ -3,7 +3,7 @@ getmac==0.9.4 netifaces==0.11.0 packet-helper==0.0.1 psutil==5.9.5 -ptf==0.9.3 +ptf==0.0.0 pyperclip==1.8.2 pysubnettree==0.35 scapy-helper==0.14.8 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index ec72d61333c5..149586560650 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -88,9 +88,9 @@ libatk1.0-data==2.30.0-2 libatomic1==8.3.0-6 libatspi2.0-0==2.30.0-7 libauthen-sasl-perl==2.1600-1 -libavahi-client3==0.7-4+deb10u2 -libavahi-common-data==0.7-4+deb10u2 -libavahi-common3==0.7-4+deb10u2 +libavahi-client3==0.7-4+deb10u3 +libavahi-common-data==0.7-4+deb10u3 +libavahi-common3==0.7-4+deb10u3 libbabeltrace1==1.5.6-2+deb10u1 libbinutils==2.31.1-16 libblas3==3.8.0-2 @@ -144,7 +144,7 @@ libevent-pthreads-2.1-6==2.1.8-stable-4 libexpat1==2.2.6-2+deb10u6 libexpat1-dev==2.2.6-2+deb10u6 libfakeroot==1.23-1 -libfastjson4==0.99.8-2 +libfastjson4==0.99.8-2+deb10u1 libffi-dev==3.2.1-9 libfile-basedir-perl==0.08-1 libfile-desktopentry-perl==0.22-1 @@ -448,7 +448,7 @@ libxml-xpathengine-perl==0.14-1 libxml2==2.9.4+dfsg1-7+deb10u6 libxmu6==2:1.1.2-2+b3 libxmuu1==2:1.1.2-2+b3 -libxpm4==1:3.5.12-1 +libxpm4==1:3.5.12-1+deb10u1 libxrandr2==2:1.5.1-1 libxrender1==1:0.9.10-1 libxshmfence1==1.3-1 @@ -580,9 +580,9 @@ ttf-bitstream-vera==1.10-8 tzdata==2021a-0+deb10u11 ucf==3.0038+nmu1 unzip==6.0-23+deb10u3 -vim==2:8.1.0875-5+deb10u4 -vim-common==2:8.1.0875-5+deb10u4 -vim-runtime==2:8.1.0875-5+deb10u4 +vim==2:8.1.0875-5+deb10u5 +vim-common==2:8.1.0875-5+deb10u5 +vim-runtime==2:8.1.0875-5+deb10u5 wget==1.20.1-1.1 wireshark==2.6.20-0+deb10u7 wireshark-common==2.6.20-0+deb10u7 @@ -596,5 +596,5 @@ xdg-utils==1.1.3-1+deb10u1 xfonts-encodings==1:1.0.4-2 xfonts-utils==1:7.7+6 xkb-data==2.26-2 -xxd==2:8.1.0875-5+deb10u4 +xxd==2:8.1.0875-5+deb10u5 xz-utils==5.2.4-1+deb10u1 diff --git a/files/build/versions/dockers/docker-ptf/versions-py2 b/files/build/versions/dockers/docker-ptf/versions-py2 index 6eef6d0d23ba..ab45c6a42cce 100644 --- a/files/build/versions/dockers/docker-ptf/versions-py2 +++ b/files/build/versions/dockers/docker-ptf/versions-py2 @@ -1,4 +1,4 @@ -backports.functools-lru-cache==1.6.4 +backports.functools-lru-cache==1.6.5 backports.shutil-get-terminal-size==1.0.0 bcrypt==3.1.7 cffi==1.15.1 diff --git a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye index a516e0f0fec0..defd23f2a500 100644 --- a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye index aa9aa0ce60e7..53e145fe6a77 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye @@ -12,7 +12,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye index 93d1a8f0011e..00564bd6ba83 100644 --- a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye @@ -14,7 +14,7 @@ libfido2-1==1.6.0-2 libfreeipmi17==1.6.6-4+deb11u1 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster index 7d4c38cbba18..e24e68194311 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster @@ -9,7 +9,7 @@ libdw1==0.176-1.1 libedit2==3.1-20181209-1 libglib2.0-0==2.58.3-2+deb10u4 libgpm2==1.20.7-5 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu63==63.1-6+deb10u3 libipt2==2.0-2 libpopt0==1.16-12 @@ -22,5 +22,5 @@ sonic-mgmt-framework==1.0-01 sonic-mgmt-framework-dbg==1.0-01 sshpass==1.06-1 strace==4.26-0.2 -vim==2:8.1.0875-5+deb10u4 -vim-runtime==2:8.1.0875-5+deb10u4 +vim==2:8.1.0875-5+deb10u5 +vim-runtime==2:8.1.0875-5+deb10u5 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 index 416b6173c410..272991b8d277 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -5,7 +5,7 @@ click==8.1.3 clickclick==20.10.2 connexion==2.7.0 flask==2.2.5 -grpcio==1.54.2 +grpcio==1.56.0 grpcio-tools==1.20.0 idna==3.4 importlib-resources==5.12.0 @@ -18,7 +18,7 @@ openapi-schema-validator==0.4.4 openapi-spec-validator==0.5.7 pathable==0.4.3 pkgutil_resolve_name==1.3.10 -protobuf==4.23.2 +protobuf==4.23.3 pyrsistent==0.19.3 python-dateutil==2.6.0 requests==2.31.0 diff --git a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye index 363275ebac84..8390c1ad927b 100644 --- a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-bullseye @@ -18,7 +18,7 @@ libgcc-10-dev==10.2.1-6 libglib2.0-0==2.66.8-1 libgomp1==10.2.1-6 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libitm1==10.2.1-6 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index cd2773ac5c01..eea043b5daac 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -12,11 +12,11 @@ dbus-python==1.3.2 docker==6.1.3 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.12.1 +filelock==3.12.2 idna==3.4 importlib-metadata==6.1.0 -jsonpatch==1.32 -jsonpointer==2.3 +jsonpatch==1.33 +jsonpointer==2.4 lazy-object-proxy==1.9.0 m2crypto==0.38.0 netifaces==0.10.9 @@ -26,7 +26,7 @@ pexpect==4.8.0 prefixed==0.7.0 prettyprinter==0.18.0 ptyprocess==0.7.0 -pycairo==1.23.0 +pycairo==1.24.0 pycparser==2.21 pygments==2.15.1 pygobject==3.44.1 @@ -41,6 +41,6 @@ toposort==1.6 typing_extensions==4.5.0 urllib3==1.26.16 wcwidth==0.2.6 -websocket-client==1.5.3 +websocket-client==1.6.1 www-authenticate==0.9.2 zipp==3.15.0 diff --git a/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye index cab91b0efaa5..938b3739f297 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye @@ -12,7 +12,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 diff --git a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye index 3059a6370577..6bdbf3b6b2f8 100644 --- a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye @@ -12,7 +12,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 diff --git a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye index 149de54ea5a1..542e98ea6633 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye @@ -11,7 +11,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libkmod2==28-1 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye index 6e6e17770e5c..92530838ec0e 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bullseye @@ -20,7 +20,7 @@ libexpat1-dev==2.2.10-2+deb11u5 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libjs-sphinxdoc==3.4.3-2 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye index ce44d532911e..5491e98c301b 100644 --- a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bullseye @@ -11,7 +11,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye index 5de49809ff56..d7ad2c7caf6a 100644 --- a/files/build/versions/dockers/docker-teamd/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-teamd/versions-deb-bullseye @@ -10,7 +10,7 @@ libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 libglib2.0-0==2.66.8-1 libgpm2==1.20.7-8 -libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index 1222f554f884..16db332eb677 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -1106,7 +1106,6 @@ libsrt1.4-gnutls==1.4.2-1.3 libssh-gcrypt-4==0.9.7-0+deb11u1 libssh2-1==1.9.0-2 libssl-dev==1.1.1n-0+deb11u5 -libssl1.1==1.1.1n-0+deb11u5 libstdc++-10-dev==10.2.1-6 libstemmer0d==2.1.0-1 libstrictures-perl==2.000006-1 @@ -1237,11 +1236,11 @@ libwrap0==7.6.q-31 libwrap0-dev==7.6.q-31 libwww-perl==6.52-1 libwww-robotrules-perl==6.02-1 -libx11-6==2:1.7.2-1 -libx11-data==2:1.7.2-1 -libx11-dev==2:1.7.2-1 +libx11-6==2:1.7.2-1+deb11u1 +libx11-data==2:1.7.2-1+deb11u1 +libx11-dev==2:1.7.2-1+deb11u1 libx11-protocol-perl==0.56-7.1 -libx11-xcb1==2:1.7.2-1 +libx11-xcb1==2:1.7.2-1+deb11u1 libx264-160==2:0.160.3011+gitcde9a93-2.1 libx265-192==3.4-2 libx32asan6==10.2.1-6 @@ -1459,13 +1458,13 @@ php-timer==5.0.3-2 php-tokenizer==1.2.0-1 php-webmozart-assert==1.9.1-2 php-xml==2:7.4+76 -php7.4-cli==7.4.33-1+deb11u3 -php7.4-common==7.4.33-1+deb11u3 -php7.4-json==7.4.33-1+deb11u3 -php7.4-mbstring==7.4.33-1+deb11u3 -php7.4-opcache==7.4.33-1+deb11u3 -php7.4-readline==7.4.33-1+deb11u3 -php7.4-xml==7.4.33-1+deb11u3 +php7.4-cli==7.4.33-1+deb11u4 +php7.4-common==7.4.33-1+deb11u4 +php7.4-json==7.4.33-1+deb11u4 +php7.4-mbstring==7.4.33-1+deb11u4 +php7.4-opcache==7.4.33-1+deb11u4 +php7.4-readline==7.4.33-1+deb11u4 +php7.4-xml==7.4.33-1+deb11u4 phpunit==9.5.2-1 phpunit-cli-parser==1.0.1-1 phpunit-code-unit==1.0.8-1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 71fdfeaa458a..aab91a4138ef 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -6,7 +6,7 @@ automat==20.2.0 babel==2.8.0 bcrypt==3.1.7 beautifulsoup4==4.9.3 -bitarray==2.7.5 +bitarray==2.7.6 certifi==2020.6.20 chardet==4.0.0 click==7.1.2 @@ -84,7 +84,7 @@ python-magic==0.4.20 pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 -redis==4.5.5 +redis==4.6.0 regex==2023.6.3 requests==2.25.1 roman==2.0.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 253478a6bec3..0ef357e93936 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -270,15 +270,15 @@ libaugeas0==1.11.0-3 libauparse-dev==1:2.8.4-3 libauparse0==1:2.8.4-3 libauthen-sasl-perl==2.1600-1 -libavahi-client3==0.7-4+deb10u2 -libavahi-common-data==0.7-4+deb10u2 -libavahi-common3==0.7-4+deb10u2 +libavahi-client3==0.7-4+deb10u3 +libavahi-common-data==0.7-4+deb10u3 +libavahi-common3==0.7-4+deb10u3 libavalon-framework-java==4.2.0-10 libavc1394-0==0.5.4-5 -libavcodec58==7:4.1.10-0+deb10u1 -libavfilter7==7:4.1.10-0+deb10u1 -libavformat58==7:4.1.10-0+deb10u1 -libavutil56==7:4.1.10-0+deb10u1 +libavcodec58==7:4.1.11-0+deb10u1 +libavfilter7==7:4.1.11-0+deb10u1 +libavformat58==7:4.1.11-0+deb10u1 +libavutil56==7:4.1.11-0+deb10u1 libb-hooks-endofscope-perl==0.24-1 libb-hooks-op-check-perl==0.22-1+b1 libbabeltrace-dev==1.5.6-2+deb10u1 @@ -500,7 +500,7 @@ libexplain51==1.4.D001-8 libexporter-tiny-perl==1.002001-1 libfabric1==1.6.2-3 libfakeroot==1.23-1 -libfastjson4==0.99.8-2 +libfastjson4==0.99.8-2+deb10u1 libfcgi-perl==0.78-2+b3 libfdt1==1.4.7-4 libffi-dev==3.2.1-9 @@ -947,7 +947,7 @@ libpolkit-agent-1-0==0.105-25+deb10u1 libpolkit-backend-1-0==0.105-25+deb10u1 libpolkit-gobject-1-0==0.105-25+deb10u1 libpopt0==1.16-12 -libpostproc55==7:4.1.10-0+deb10u1 +libpostproc55==7:4.1.11-0+deb10u1 libpotrace0==1.15-1 libprocps7==2:3.3.15-2 libprotobuf-c1==1.3.1-1+b1 @@ -1110,8 +1110,8 @@ libsubunit-dev==1.3.0-1 libsubunit0==1.3.0-1 libsurefire-java==2.22.1-1 libswitch-perl==2.17-2 -libswresample3==7:4.1.10-0+deb10u1 -libswscale5==7:4.1.10-0+deb10u1 +libswresample3==7:4.1.11-0+deb10u1 +libswscale5==7:4.1.11-0+deb10u1 libsynctex2==2018.20181218.49446-1+deb10u2 libsys-hostname-long-perl==1.5-1 libsystemd-dev==241-7~deb10u9 @@ -1319,7 +1319,7 @@ libxmlgraphics-commons-java==2.3-1+deb10u1 libxmlrpc-lite-perl==0.717-2 libxmu6==2:1.1.2-2+b3 libxmuu1==2:1.1.2-2+b3 -libxpm4==1:3.5.12-1 +libxpm4==1:3.5.12-1+deb10u1 libxrandr-dev==2:1.5.1-1 libxrandr2==2:1.5.1-1 libxrender-dev==1:0.9.10-1 @@ -1439,13 +1439,13 @@ php-token-stream==3.0.1-1 php-tokenizer==1.1.0-1 php-webmozart-assert==1.4.0-3 php-xml==2:7.3+69 -php7.3-cli==7.3.31-1~deb10u3 -php7.3-common==7.3.31-1~deb10u3 -php7.3-json==7.3.31-1~deb10u3 -php7.3-mbstring==7.3.31-1~deb10u3 -php7.3-opcache==7.3.31-1~deb10u3 -php7.3-readline==7.3.31-1~deb10u3 -php7.3-xml==7.3.31-1~deb10u3 +php7.3-cli==7.3.31-1~deb10u4 +php7.3-common==7.3.31-1~deb10u4 +php7.3-json==7.3.31-1~deb10u4 +php7.3-mbstring==7.3.31-1~deb10u4 +php7.3-opcache==7.3.31-1~deb10u4 +php7.3-readline==7.3.31-1~deb10u4 +php7.3-xml==7.3.31-1~deb10u4 phpunit==7.5.6-1 phpunit-code-unit-reverse-lookup==1.0.1-1 phpunit-comparator==3.0.2-1 @@ -1547,7 +1547,7 @@ python-pygments==2.3.1+dfsg-1+deb10u2 python-pyparsing==2.2.0+dfsg1-2 python-pytest==3.10.1-2 python-pytest-cov==2.6.0-1 -python-requests==2.21.0-1 +python-requests==2.21.0-1+deb10u1 python-roman==2.0.0-3 python-scandir==1.9.0-2 python-secretstorage==2.3.1-2 @@ -1630,7 +1630,7 @@ python3-pygments==2.3.1+dfsg-1+deb10u2 python3-pyparsing==2.2.0+dfsg1-2 python3-pytest==3.10.1-2 python3-pytest-cov==2.6.0-1 -python3-requests==2.21.0-1 +python3-requests==2.21.0-1+deb10u1 python3-roman==2.0.0-3 python3-secretstorage==2.3.1-2 python3-setuptools==40.8.0-1 @@ -1739,9 +1739,9 @@ uuid-dev==2.33.1-0.1 va-driver-all==2.4.0-1 vdpau-driver-all==1.1.1-10 velocity==1.7-5+deb10u1 -vim==2:8.1.0875-5+deb10u4 -vim-common==2:8.1.0875-5+deb10u4 -vim-runtime==2:8.1.0875-5+deb10u4 +vim==2:8.1.0875-5+deb10u5 +vim-common==2:8.1.0875-5+deb10u5 +vim-runtime==2:8.1.0875-5+deb10u5 wayland-protocols==1.17-1 wdiff==1.2.2-2+b1 wget==1.20.1-1.1 @@ -1773,7 +1773,7 @@ xorg-sgml-doctools==1:1.11-1 xsltproc==1.1.32-2.2~deb10u2 xterm==344-1+deb10u2 xtrans-dev==1.3.5-1 -xxd==2:8.1.0875-5+deb10u4 +xxd==2:8.1.0875-5+deb10u5 xz-utils==5.2.4-1+deb10u1 zip==3.0-11+b1 zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 4ad4461e66c8..db0d9fcfdbfa 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -4,7 +4,7 @@ async-timeout==4.0.2 atomicwrites==1.1.5 attrs==18.2.0 babel==2.6.0 -bitarray==2.7.5 +bitarray==2.7.6 certifi==2018.8.24 chardet==3.0.4 cov-core==1.15.0 @@ -20,7 +20,7 @@ gcovr==4.1 gpg==1.12.0 idna==2.6 imagesize==1.0.0 -importlib-metadata==6.6.0 +importlib-metadata==6.7.0 jinja2==3.0.3 keyring==17.1.1 keyrings.alt==3.1.1 @@ -64,7 +64,7 @@ python-magic==0.4.16 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 -redis==4.5.5 +redis==4.6.0 regex==2023.6.3 requests==2.21.0 roman==2.0.0 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index 42d400d5b19e..84673f52d380 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -146,7 +146,7 @@ libgpm2==1.20.7-8 libgrpc++1==1.30.2-3 libgrpc10==1.30.2-3 libhavege2==1.9.14-1 -libhiredis0.14==0.14.0-3~bpo9+1 +libhiredis0.14==0.14.1-1 libi2c0==4.2-1+b1 libiniparser1==4.1-4 libip4tc2==1.8.7-1 @@ -297,6 +297,7 @@ python3.9==3.9.2-1 python3.9-minimal==3.9.2-1 rasdaemon==0.6.6-2 readline-common==8.1-1 +resolvconf==1.87 rsyslog==8.2302.0-1~bpo11+1 runit-helper==2.10.3 sbsigntool==0.9.2-2 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index cd669752ee12..216ceea00ae1 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -15,7 +15,7 @@ dbus-python==1.2.16 docker==6.1.1 docker-image-py==0.1.12 enlighten==1.11.2 -filelock==3.12.1 +filelock==3.12.2 grpcio==1.39.0 grpcio-tools==1.39.0 idna==3.4 @@ -25,8 +25,8 @@ ipaddress==1.0.23 j2cli==0.3.10 jinja2==3.1.2 jsondiff==2.0.0 -jsonpatch==1.32 -jsonpointer==2.3 +jsonpatch==1.33 +jsonpointer==2.4 jsonschema==2.6.0 lazy-object-proxy==1.9.0 lxml==4.9.1 @@ -48,7 +48,7 @@ psutil==5.9.5 ptyprocess==0.7.0 pyang==2.5.3 pyangbind==0.8.1 -pycairo==1.23.0 +pycairo==1.24.0 pycparser==2.21 pycurl==7.43.0.6 pygments==2.15.1 @@ -72,7 +72,7 @@ toposort==1.6 urllib3==1.26.16 watchdog==0.10.3 wcwidth==0.2.6 -websocket-client==1.5.3 +websocket-client==1.6.1 wheel==0.35.1 www-authenticate==0.9.2 xmltodict==0.12.0 From f154ff0a1c943f257e334c40b550c93b39c2f7ff Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 27 Jun 2023 01:23:49 +0800 Subject: [PATCH 034/107] Add the release 202211/202203 in the README.md (#15593) --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index c99c9fbe19d0..551e3af5f0d8 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,34 @@ [![Innovium](https://dev.azure.com/mssonic/build/_apis/build/status/innovium/Azure.sonic-buildimage.official.innovium?branchName=master&label=Innovium)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=148&branchName=master) [![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=master&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=master) [![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=master&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=master) +[![Marvell(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-arm64?branchName=master&label=Marvell-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=999&branchName=master) [![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=master&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=master) [![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=master&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=master) +*202305 builds*: + +[![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202205&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202305) +[![Broadcom](https://dev.azure.com/mssonic/build/_apis/build/status/broadcom/Azure.sonic-buildimage.official.broadcom?branchName=202305&label=Broadcom)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=138&branchName=202305) +[![Centec](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec?branchName=202305&label=Centec)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=143&branchName=202305) +[![Centec(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec-arm64?branchName=202305&label=Centec-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=140&branchName=202305) +[![Innovium](https://dev.azure.com/mssonic/build/_apis/build/status/innovium/Azure.sonic-buildimage.official.innovium?branchName=202305&label=Innovium)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=148&branchName=202305) +[![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=202305&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=202305) +[![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=202305&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=202305) +[![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=202305&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=202305) +[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=202305&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=202305) + +*202211 builds*: + +[![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202205&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202211) +[![Broadcom](https://dev.azure.com/mssonic/build/_apis/build/status/broadcom/Azure.sonic-buildimage.official.broadcom?branchName=202211&label=Broadcom)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=138&branchName=202211) +[![Centec](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec?branchName=202211&label=Centec)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=143&branchName=202211) +[![Centec(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec-arm64?branchName=202211&label=Centec-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=140&branchName=202211) +[![Innovium](https://dev.azure.com/mssonic/build/_apis/build/status/innovium/Azure.sonic-buildimage.official.innovium?branchName=202211&label=Innovium)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=148&branchName=202211) +[![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=202211&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=202211) +[![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=202211&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=202211) +[![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=202211&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=202211) +[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=202211&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=202211) + *202205 builds*: [![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202205&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202205) From ec6723d4a3c13edd37695b0dcaae7e8a4e8cb23e Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Mon, 26 Jun 2023 23:23:37 +0530 Subject: [PATCH 035/107] [Marvell] Update arm64 sai debian (#15602) - SAI-1.12.0 support Signed-off-by: rajkumar38 --- platform/marvell-arm64/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/marvell-arm64/sai.mk b/platform/marvell-arm64/sai.mk index f6372ca683c0..c6d84fa10db5 100644 --- a/platform/marvell-arm64/sai.mk +++ b/platform/marvell-arm64/sai.mk @@ -1,6 +1,6 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.11.0-1 +export MRVL_SAI_VERSION = 1.12.0-1 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai From 4e43484f1d796018102f324a59aa6b7f7d2a397b Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 26 Jun 2023 10:57:08 -0700 Subject: [PATCH 036/107] [Arista] Update platform library submodules (#15405) - fix pcied leak on chassis - fix fan status led setting on fixed systems - misc fixes --- platform/barefoot/sonic-platform-modules-arista | 2 +- platform/broadcom/sonic-platform-modules-arista | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index 1c036127fd4a..cca827843c05 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 1c036127fd4a0512a36ac0fc489a619fe87280ba +Subproject commit cca827843c0528347b996aedd5790558c5d6a656 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 1c036127fd4a..cca827843c05 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 1c036127fd4a0512a36ac0fc489a619fe87280ba +Subproject commit cca827843c0528347b996aedd5790558c5d6a656 From 05f326eed97590e6a27b8db2cb779465e5f71cce Mon Sep 17 00:00:00 2001 From: Prince George <45705344+prgeor@users.noreply.github.com> Date: Mon, 26 Jun 2023 10:58:39 -0700 Subject: [PATCH 037/107] Move /var/log to RAM for Mellanox SN2700, Nokia 7215 and Dell S6100 (#15077) * add ONIE_PLATFORM_EXTRA_CMDLINE_LINUX to kernel bootparam --- device/dell/x86_64-dell_s6100_c2538-r0/installer.conf | 2 +- device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf | 2 +- device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf | 1 + platform/marvell-armhf/platform.conf | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/installer.conf b/device/dell/x86_64-dell_s6100_c2538-r0/installer.conf index 87ea9d31bb18..be208a15c691 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/installer.conf +++ b/device/dell/x86_64-dell_s6100_c2538-r0/installer.conf @@ -1,3 +1,3 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich,wdat_wdt acpi_no_watchdog=1 nos-config-part=/dev/sda12" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich,wdat_wdt acpi_no_watchdog=1 nos-config-part=/dev/sda12 logs_inram=on" \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf b/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf index c9c9493a5404..eb12e734bb90 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq logs_inram=on" diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf b/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf index b138f294e1ea..36696d270385 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf @@ -1 +1,2 @@ VAR_LOG_SIZE=4096 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="logs_inram=on" diff --git a/platform/marvell-armhf/platform.conf b/platform/marvell-armhf/platform.conf index 0113c6a05ac0..9bfd495ed388 100644 --- a/platform/marvell-armhf/platform.conf +++ b/platform/marvell-armhf/platform.conf @@ -176,8 +176,7 @@ prepare_boot_menu() { fi BORDER='echo "---------------------------------------------------";echo;' fw_setenv ${FW_ARG} print_menu "$BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER" > /dev/null - - fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4 ${extra_cmdline_linux}" > /dev/null + fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4 ${extra_cmdline_linux} ${ONIE_PLATFORM_EXTRA_CMDLINE_LINUX}" > /dev/null fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4" > /dev/null # Set boot configs From 4449d473ae6f3c5412d3101079e54c98d05670a1 Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Tue, 27 Jun 2023 11:01:41 +0800 Subject: [PATCH 038/107] [CI/CD] Refine t0 sonic and remove SPECIFIED_PARAMS (#15625) Why I did it t0-sonic's specific params has been set on sonic-mgmt repo, remove useless SPECIFIED_PARAMS usage --- .azure-pipelines/run-test-scheduler-template.yml | 6 +----- azure-pipelines.yml | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/run-test-scheduler-template.yml b/.azure-pipelines/run-test-scheduler-template.yml index 47a28429bcad..176866a8bc05 100644 --- a/.azure-pipelines/run-test-scheduler-template.yml +++ b/.azure-pipelines/run-test-scheduler-template.yml @@ -34,10 +34,6 @@ parameters: type: string default: "ceos" -- name: SPECIFIED_PARAMS - type: string - default: "{}" - - name: MGMT_BRANCH type: string default: master @@ -61,7 +57,7 @@ steps: --min-worker ${{ parameters.MIN_WORKER }} --max-worker ${{ parameters.MAX_WORKER }} \ --test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) \ --deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \ - --mgmt-branch ${{ parameters.MGMT_BRANCH }} --vm-type ${{ parameters.VM_TYPE }} --specified-params "${{ parameters.SPECIFIED_PARAMS }}" \ + --mgmt-branch ${{ parameters.MGMT_BRANCH }} --vm-type ${{ parameters.VM_TYPE }} \ --num-asic ${{ parameters.NUM_ASIC }} TEST_PLAN_ID=`cat new_test_plan_id.txt` diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f64c710cbe88..c4f6e55dadb1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -224,9 +224,8 @@ stages: MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) TEST_SET: t0-sonic - COMMON_EXTRA_PARAMS: "--neighbor_type=sonic --enable_macsec --macsec_profile=128_SCI,256_XPN_SCI" + COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " VM_TYPE: vsonic - SPECIFIED_PARAMS: '{\"test_pretest.py\":[\"--completeness_level=confident\",\"--allow_recover\"],\"test_posttest.py\":[\"--completeness_level=confident\",\"--allow_recover\"]}' - job: wan_elastictest displayName: "kvmtest-wan by Elastictest" From bacba1f9884d77cdc0654ac8281b8a3fa58ec1fd Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:37:39 +0800 Subject: [PATCH 039/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15635) #### Why I did it src/sonic-swss ``` * a67f684f - (HEAD -> master, origin/master, origin/HEAD) [hash]: Implement GH backend (#2598) (3 hours ago) [Nazarii Hnydyn] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 7fe76e001d43..a67f684f448d 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 7fe76e001d4367c508c26816c95ba9d182ea333f +Subproject commit a67f684f448d45c5b6c4a7be6ccd4218d0ccd57e From 2047e5c6edb5d4bb7bddaf306989d1f98b6bc6e7 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:37:44 +0800 Subject: [PATCH 040/107] [submodule] Update submodule dhcpmon to the latest HEAD automatically (#15634) #### Why I did it src/dhcpmon ``` * 824a144 - (HEAD -> master, origin/master, origin/HEAD) replace atoi with strtol (#6) (3 hours ago) [Mai Bui] * 32c0c3f - Fix libswsscommon package installation for non-amd64 (#7) (6 hours ago) [Saikrishna Arcot] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/dhcpmon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcpmon b/src/dhcpmon index 3c16c8c4ded2..824a1448b9cb 160000 --- a/src/dhcpmon +++ b/src/dhcpmon @@ -1 +1 @@ -Subproject commit 3c16c8c4ded29c193695d0acc7693f9cada3dfcb +Subproject commit 824a1448b9cbe685664f94c25aa00c37e3e3c058 From 8b21b612ae61a9644f6c7ac216b000f6dedd9801 Mon Sep 17 00:00:00 2001 From: Clark Lee <44252284+clarklee-guizhao@users.noreply.github.com> Date: Tue, 27 Jun 2023 22:09:23 +0800 Subject: [PATCH 041/107] =?UTF-8?q?[sonic-pit]=20Add=20PIT(Platform=20Inte?= =?UTF-8?q?gration=20Test)=20feature,=20second=20part,=20=E2=80=A6=20(#125?= =?UTF-8?q?30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [sonic-pit] Add PIT(Platform Integration Test) feature, second part, add 6 test cases. Signed-off-by: Li Hua * Add missing test case configuration and platform configuration. Signed-off-by: Li Hua * Remove unsed comment, replace duplicated function with import from other moduls. --------- Signed-off-by: Li Hua --- .../pit-sysdiag/cases/cpu_tc/config.json | 6 + .../pit-sysdiag/cases/memory_tc/config.json | 6 + .../pit-sysdiag/cases/oob_tc/config.json | 6 + .../pit-sysdiag/cases/rtc_tc/config.json | 6 + .../pit-sysdiag/cases/sensor_tc/config.json | 6 + .../pit-sysdiag/cases/ssd_tc/config.json | 6 + .../case_config.json | 52 ++++ .../platform_config.json | 10 + src/sonic-pit/pit-sysdiag/src/cpu_tc.py | 107 +++++++++ src/sonic-pit/pit-sysdiag/src/memory_tc.py | 188 +++++++++++++++ src/sonic-pit/pit-sysdiag/src/oob_tc.py | 140 +++++++++++ src/sonic-pit/pit-sysdiag/src/rtc_tc.py | 144 +++++++++++ src/sonic-pit/pit-sysdiag/src/sensor_tc.py | 121 ++++++++++ src/sonic-pit/pit-sysdiag/src/ssd_tc.py | 224 ++++++++++++++++++ 14 files changed, 1022 insertions(+) create mode 100644 src/sonic-pit/pit-sysdiag/cases/cpu_tc/config.json create mode 100644 src/sonic-pit/pit-sysdiag/cases/memory_tc/config.json create mode 100644 src/sonic-pit/pit-sysdiag/cases/oob_tc/config.json create mode 100644 src/sonic-pit/pit-sysdiag/cases/rtc_tc/config.json create mode 100644 src/sonic-pit/pit-sysdiag/cases/sensor_tc/config.json create mode 100644 src/sonic-pit/pit-sysdiag/cases/ssd_tc/config.json create mode 100644 src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/case_config.json create mode 100644 src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/platform_config.json create mode 100644 src/sonic-pit/pit-sysdiag/src/cpu_tc.py create mode 100644 src/sonic-pit/pit-sysdiag/src/memory_tc.py create mode 100644 src/sonic-pit/pit-sysdiag/src/oob_tc.py create mode 100644 src/sonic-pit/pit-sysdiag/src/rtc_tc.py create mode 100644 src/sonic-pit/pit-sysdiag/src/sensor_tc.py create mode 100644 src/sonic-pit/pit-sysdiag/src/ssd_tc.py diff --git a/src/sonic-pit/pit-sysdiag/cases/cpu_tc/config.json b/src/sonic-pit/pit-sysdiag/cases/cpu_tc/config.json new file mode 100644 index 000000000000..b17842944328 --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/cases/cpu_tc/config.json @@ -0,0 +1,6 @@ +{ + "name": "cpu-test", + "description": "Check CPU information", + "type": "auto", + "tags": ["manufacture", "delivery", "pa", "power", "emc"] +} diff --git a/src/sonic-pit/pit-sysdiag/cases/memory_tc/config.json b/src/sonic-pit/pit-sysdiag/cases/memory_tc/config.json new file mode 100644 index 000000000000..f079c826a1c8 --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/cases/memory_tc/config.json @@ -0,0 +1,6 @@ +{ + "name": "memory-test", + "description": "Check memory and pattern test", + "type": "auto", + "tags": ["manufacture", "delivery", "pa", "power", "emc"] +} diff --git a/src/sonic-pit/pit-sysdiag/cases/oob_tc/config.json b/src/sonic-pit/pit-sysdiag/cases/oob_tc/config.json new file mode 100644 index 000000000000..a16c01512d35 --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/cases/oob_tc/config.json @@ -0,0 +1,6 @@ +{ + "name": "oob-test", + "description": "l2 mgmt switch test", + "type": "auto", + "tags": ["manufacture", "delivery", "pa"] +} diff --git a/src/sonic-pit/pit-sysdiag/cases/rtc_tc/config.json b/src/sonic-pit/pit-sysdiag/cases/rtc_tc/config.json new file mode 100644 index 000000000000..baa81c1841fe --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/cases/rtc_tc/config.json @@ -0,0 +1,6 @@ +{ + "name": "rtc-test", + "description": "Check RTC function", + "type": "auto", + "tags": ["manufacture", "delivery", "pa", "emc"] +} diff --git a/src/sonic-pit/pit-sysdiag/cases/sensor_tc/config.json b/src/sonic-pit/pit-sysdiag/cases/sensor_tc/config.json new file mode 100644 index 000000000000..9da2d1d588dc --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/cases/sensor_tc/config.json @@ -0,0 +1,6 @@ +{ + "name": "sensor-test", + "description": "Check sensors health", + "type": "auto", + "tags": ["manufacture", "delivery", "pa", "power", "emc"] +} diff --git a/src/sonic-pit/pit-sysdiag/cases/ssd_tc/config.json b/src/sonic-pit/pit-sysdiag/cases/ssd_tc/config.json new file mode 100644 index 000000000000..a7f83ca9694a --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/cases/ssd_tc/config.json @@ -0,0 +1,6 @@ +{ + "name": "ssd-test", + "description": "Check SSD capacity", + "type": "auto", + "tags": ["manufacture", "delivery", "pa", "emc", "power"] +} diff --git a/src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/case_config.json b/src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/case_config.json new file mode 100644 index 000000000000..00e765bf6f8f --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/case_config.json @@ -0,0 +1,52 @@ +{ + "fan_info":{ + "position": "bmc", + "count": 6, + "direction": "in", + "ratio_target": [10, 80, 20], + "speed_tolerance": 1000, + "speed_max": 20000, + "speed_min": 0, + "motor_count": 2 + }, + "psu_info":{ + "position": "bmc", + "count": 2, + "in_power_min": 0, + "in_power_max": 0, + "in_vol_min": 0, + "in_vol_max": 0, + "in_curr_min": 0, + "in_curr_max": 0, + "out_power_min": 0, + "out_power_max": 0, + "out_vol_min": 0, + "out_vol_max": 0, + "out_curr_min": 0, + "out_curr_max": 0 + }, + "cpu_info": { + "Model name": "Intel(R) Xeon(R) CPU D-1533N @ 2.10GHz", + "BogoMIPS": 4189.0, + "CPU(s)": 6, + "CPU MHz": 2100.0 + }, + "memory_free_size": 100, + "rtc_info":{ + "delay_time": 5, + "max_time_diff": 1 + }, + "ssd_test_size": "100M", + "ssd_bom": [ + { + "model": "AF2MA31DTDLT240A", + "size": "240 GB" + }, + { + "model": "MTFDDAV240TDS", + "size": "240 GB" + } + ], + "server_ip": "192.0.0.3", + "bmc_ip": "240.1.1.1" +} diff --git a/src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/platform_config.json b/src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/platform_config.json new file mode 100644 index 000000000000..7e3768d00daf --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/config/platform/x86_64-alibaba_as14-40d-cl-r0/platform_config.json @@ -0,0 +1,10 @@ +{ + "test_cases": [ + "fan_tc", + "psu_tc", + "cpu_tc", + "memory_tc", + "rtc_tc", + "sensor_tc" + ] +} diff --git a/src/sonic-pit/pit-sysdiag/src/cpu_tc.py b/src/sonic-pit/pit-sysdiag/src/cpu_tc.py new file mode 100644 index 000000000000..f7f3e139232a --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/src/cpu_tc.py @@ -0,0 +1,107 @@ +from function import run_command +from test_case import TestCaseCommon +from errcode import E +import traceback + + +# CPU test class +class CPUTC(TestCaseCommon): + def __init__(self, index, logger, platform_cfg_file, case_cfg_file=None): + MODULE_NAME = "cpu_tc" + TestCaseCommon.__init__(self, index, MODULE_NAME, logger, platform_cfg_file, case_cfg_file) + self.cpu_info_dict = None + try: + if self.platform_cfg_json and 'cpu_info' in self.platform_cfg_json.keys(): + self.cpu_info_dict = self.platform_cfg_json['cpu_info'] + except Exception as e: + self.logger.log_err(str(e), True) + self.logger.log_err(traceback.format_exc()) + + def test_cpu_info(self, also_print_console=False): + ret = E.OK + self.logger.log_info("check_cpu_info start", also_print_console) + + cmd = "lscpu | head -n25" + status, log = run_command(cmd) + if status != 0 or len(log) <= 0: + reason = "Failed, get cpu info failed, command {}, status {}, log {}".format( \ + cmd, status, log) + self.log_reason(reason) + ret = E.ECPU3005 + else: + lines = log.splitlines() + expected_cpu_model = self.cpu_info_dict.get('Model name') + expected_bogomips = self.cpu_info_dict.get('BogoMIPS') + expected_cpu_num = self.cpu_info_dict.get('CPU(s)') + expected_cpu_mhz = self.cpu_info_dict.get('CPU MHz') + self.logger.log_dbg("Expected value: {}, {}, {}, {}".format(expected_cpu_model, \ + expected_bogomips, expected_cpu_num, expected_cpu_mhz)) + for line in lines: + cols = line.strip().split(":") + if len(cols) < 2: + continue + + if expected_cpu_model and cols[0] == "Model name": + if cols[1].strip() != expected_cpu_model: + reason = "Failed, CPU model name {}(expected {})".format( \ + cols[1].strip(), expected_cpu_model) + self.log_reason(reason) + ret = E.ECPU3001 + else: + msg = "Model name {} =======> OK".format(cols[1].strip()) + self.logger.log_info(msg) + + if expected_bogomips and cols[0] == 'BogoMIPS': + read_bogomips = float(cols[1].strip()) + conf_bogomips = float(expected_bogomips) + if read_bogomips <= (conf_bogomips * 0.99) or \ + read_bogomips >= conf_bogomips * 1.01: + reason = "Failed, BogoMIPS {}(expected {})".format( \ + read_bogomips, expected_bogomips) + self.log_reason(reason) + ret = E.ECPU3001 + else: + msg = "BogoMIPS {} ===== OK".format(read_bogomips) + self.logger.log_info(msg) + + if expected_cpu_num and cols[0] == 'CPU(s)': + num_cpus = int(cols[1].strip()) + if num_cpus != self.cpu_info_dict.get('CPU(s)'): + reason = "Failed, CPU number {}(expected {})".format( \ + num_cpus, expected_cpu_num) + self.fail_reason.append(reason) + ret = E.ECPU3001 + else: + msg = "Number of CPUs {} ===== OK".format(num_cpus) + self.logger.log_info(msg) + + if expected_cpu_mhz and cols[0] == 'CPU MHz': + read_cpu_mhz = float(cols[1].strip()) + conf_cpu_mhz = float(expected_cpu_mhz) + if read_cpu_mhz <= (conf_cpu_mhz * 0.99) or \ + read_cpu_mhz >= (conf_cpu_mhz * 1.01): + reason = "Failed, CPU MHz {}(expected {})".format( \ + read_cpu_mhz, expected_cpu_mhz) + self.log_reason(reason) + ret = E.ECPU3001 + else: + msg = "CPU frequency {} ===== OK".format(read_cpu_mhz) + self.logger.log_info(msg) + + if ret != E.OK: + self.logger.log_err("test cpu info done, FAILED.", also_print_console) + else: + self.logger.log_info("test cpu info done, PASS.", also_print_console) + + return ret + + def run_test(self, *argv): + try: + ret = self.test_cpu_info(True) + return ret + except Exception as e: + self.logger.log_err("test cpu info got exception: {}".format(str(e))) + self.logger.log_err(traceback.format_exc()) + return ret + + return E.OK diff --git a/src/sonic-pit/pit-sysdiag/src/memory_tc.py b/src/sonic-pit/pit-sysdiag/src/memory_tc.py new file mode 100644 index 000000000000..6e44685b56a8 --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/src/memory_tc.py @@ -0,0 +1,188 @@ +from function import run_command +from test_case import TestCaseCommon +from errcode import E +import traceback + + +X86_ARCH_LIST = ["x86", "x86_64", "amd", "amd64"] +ARM_ARCH_LIST = ["arm", "arm64"] + + +# memory test class +class MEMORYTC(TestCaseCommon): + def __init__(self, index, logger, platform_cfg_file, case_cfg_file=None): + MODULE_NAME = "memory_tc" + TestCaseCommon.__init__(self, index, MODULE_NAME, logger, platform_cfg_file, case_cfg_file) + self.arch = "x86" # default arch + self.memory_bom_list = None # default conf + self.free_mem_size = 100 # free memory size in kB. if free mem is less than free_mem_size, fail. + try: + if self.platform_cfg_json and 'memory_bom' in self.platform_cfg_json.keys(): + self.memory_bom_list = self.platform_cfg_json['memory_bom'] + if self.platform_cfg_json and 'arch' in self.platform_cfg_json.keys(): + self.arch = self.platform_cfg_json['arch'] + if self.platform_cfg_json and 'memory_free_size' in self.platform_cfg_json.keys(): + self.free_mem_size = int(self.platform_cfg_json['memory_free_size']) + except Exception as e: + self.logger.log_err(str(e), True) + + def _memory_info_check_by_dmidecode(self): + ret = E.OK + pn_list = [] + vendor_list = [] + + status, out = run_command("dmidecode -t 17") + if status != 0 or len(out) <= 0: + self.fail_reason.append("dmidecode exec failed.") + ret = E.EMEM4001 + else: + for item in out.splitlines(): + self.logger.log_info(item) + if ":" in item: + key = item.split(":")[0].strip() + value = item.split(":")[1].strip() + if key == 'Part Number' and value != 'NO DIMM': + pn_list.append(value) + if key == 'Manufacturer' and value != 'NO DIMM': + vendor_list.append(value) + + # memory bom check + if self.memory_bom_list: + memory_matched = False + for memory_bom in self.memory_bom_list: + if memory_bom["manufacturer"] in vendor_list and memory_bom["pn"] in pn_list: + memory_matched = True + break + if not memory_matched: + ret = E.EMEM4001 + self.fail_reason.append("memory not matched") + + return ret + + def _arm_memory_ecc_check(self): + return E.OK + + def _x86_memory_ecc_check(self): + status, out = run_command("edac-util -v") + self.logger.log_info(out) + if status: + self.fail_reason.append("memort ecc occured") + return E.EMEM4003 + else: + return E.OK + + def test_memory_info(self): + self.logger.log_info("test memory info start") + + if self.arch in X86_ARCH_LIST: + ret = self._memory_info_check_by_dmidecode() + elif self.arch in ARM_ARCH_LIST: + ret = E.OK + + if ret != E.OK: + self.logger.log_err("test memory info done, FAILED.") + else: + self.logger.log_err("test memory info done, PASS.") + + return ret + + def test_memory_capacity(self): + self.logger.log_info("test memory capacity start") + ret = E.OK + status, out = run_command("free -t") + self.logger.log_info(out) + if status: + self.log_reason("exec failed, cmd: free -t") + ret = E.EIO + else: + for line in out.splitlines(): + if line.find("Total") >= 0: + free_mem = line.split()[3] + if int(free_mem) < self.free_mem_size: + self.log_reason("free memory less than {}kB".format(self.free_mem_size)) + ret = E.EMEM4004 + + if ret != E.OK: + self.logger.log_err("test memory capacity done, FAILED.") + else: + self.logger.log_err("test memory capacity done, PASS.") + + return ret + + def test_memory_stress(self): + self.logger.log_info("test memory stress start") + + ret = E.OK + status, out = run_command("memtester 1M 1") + self.logger.log_info(out) + if status: + reason = "exec failed, cmd: memtester 1M 1" + self.log_reason(reason) + ret = E.EMEM4002 + + if ret != E.OK: + self.logger.log_err("test memory stress done, FAILED!") + else: + self.logger.log_err("test memory stress done, PASS!") + + return ret + + def test_memory_ecc(self): + self.logger.log_info("test memory ecc start") + + if self.arch in X86_ARCH_LIST: + ret = self._x86_memory_ecc_check() + elif self.arch in ARM_ARCH_LIST: + ret = self._arm_memory_ecc_check() + + if ret != E.OK: + self.logger.log_err("test memory stress done, FAILED.") + else: + self.logger.log_err("test memory stress done, PASS.") + + return ret + + def run_test(self, *argv): + final_ret = E.OK + + try: + ret = self.test_memory_info() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "test memory info exception {}, FAILED".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_ret = E.EFAIL + + try: + ret = self.test_memory_capacity() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "test memory capacity exception {}, FAILED".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_ret = E.EFAIL + + try: + ret = self.test_memory_stress() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "test memory by memtester exception {}, FAILED".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_ret = E.EFAIL + + try: + ret = self.test_memory_ecc() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "test memory ecc exception {}, FAILED".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_ret = E.EFAIL + + return final_ret diff --git a/src/sonic-pit/pit-sysdiag/src/oob_tc.py b/src/sonic-pit/pit-sysdiag/src/oob_tc.py new file mode 100644 index 000000000000..bcac0d5540ea --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/src/oob_tc.py @@ -0,0 +1,140 @@ +import sys +from test_case import TestCaseCommon +from errcode import E +from function import run_command, load_platform_util_module +import traceback + + +class OOBTC(TestCaseCommon): + __PLATFORM_SPECIFIC_MODULE_NAME = "bmcutil" + __PLATFORM_SPECIFIC_CLASS_NAME = "BmcUtil" + def __init__(self, index, logger, platform_cfg_file, case_cfg_file=None): + MODULE_NAME = "oob_tc" + TestCaseCommon.__init__(self, index, MODULE_NAME, logger, platform_cfg_file, case_cfg_file) + self.server_ip = None # external ip + self.bmc_ip = None # BMC internal ip + + try: + if self.platform_cfg_json and 'server_ip' in self.platform_cfg_json.keys(): + self.server_ip = self.platform_cfg_json['server_ip'] + if self.platform_cfg_json and 'bmc_ip' in self.platform_cfg_json.keys(): + self.bmc_ip = self.platform_cfg_json['bmc_ip'] + except Exception as e: + self.logger.log_err(str(e)) + self.logger.log_err(traceback.format_exc()) + + bmc_module = load_platform_util_module(self.__PLATFORM_SPECIFIC_MODULE_NAME) + try: + bmc_util_class = getattr(bmc_module, self.__PLATFORM_SPECIFIC_CLASS_NAME) + self.bmc_util = bmc_util_class() + except AttributeError as e: + self.logger.log_err(str(e), True) + sys.exit(1) + + def cpu_ping_bmc_test(self, also_print_console=True): + self.logger.log_info("cpu ping bmc test start") + + ret = E.OK + if not self.bmc_ip: + self.logger.log_dbg("BMC not exist, skip") + else: + count = 5 + cmd = "ping %s -c %d -I eth0.4088 | grep received" % (self.bmc_ip, count) + status, output = run_command(cmd) + self.logger.log_info(output, also_print_console) + + if output.find(" 0% packet loss") > 0: + ret = E.OK + else: + self.log_reason("cpu ping bmc lost packages") + ret = E.EMGMT11003 + + if ret != E.OK: + self.logger.log_err("cpu ping bmc test done, FAILED.", also_print_console) + else: + self.logger.log_err("cpu ping bmc test done, PASS.", also_print_console) + + return ret + + def cpu_ping_server_test(self, also_print_console=True): + self.logger.log_info("cpu ping server test start") + + ret = E.OK + if not self.server_ip: + self.logger.log_dbg("External server ip not set, skip") + else: + count = 5 + ping_cmd = "ping %s -c %d -I eth0 | grep received" % (self.server_ip, count) + status, output = run_command(ping_cmd) + self.logger.log_info(output, also_print_console) + + if output.find(" 0% packet loss") > 0: + ret = E.OK + else: + self.log_reason("cpu ping server lost packages") + ret = E.EMGMT11002 + + if ret != E.OK: + self.logger.log_err("FAIL!", also_print_console) + else: + self.logger.log_info("PASS.", also_print_console) + + return ret + + def bmc_ping_server_test(self, also_print_console=True): + self.logger.log_info("bmc ping server test start") + + count = 5 + ping_cmd = "ping %s -c %d -I eth0 | grep received" % (self.server_ip, count) + try: + status, output = self.bmc_util.exec_raw_cmd(ping_cmd) + self.logger.log_info(output[0], also_print_console) + + if status and output[0].find(" 0% packet loss") > 0: + ret = E.OK + else: + self.log_reason.append("bmc ping server lost packages") + ret = E.EMGMT11004 + except Exception as e: + self.log_reason("bmc ping server exception: {}".format(str(e))) + self.logger.log_err(traceback.format_exc()) + ret = E.EMGMT11004 + + if ret != E.OK: + self.logger.log_err("FAIL!", also_print_console) + else: + self.logger.log_info("PASS.", also_print_console) + + return ret + + def run_test(self, *argv): + final_ret = E.OK + + try: + ret = self.cpu_ping_bmc_test() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "cpu ping bmc test exception: {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + try: + ret = self.cpu_ping_server_test() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "cpu ping server test exception: {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + try: + ret = self.bmc_ping_server_test() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "bmc ping server test exception: {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + return ret diff --git a/src/sonic-pit/pit-sysdiag/src/rtc_tc.py b/src/sonic-pit/pit-sysdiag/src/rtc_tc.py new file mode 100644 index 000000000000..64deb80b131d --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/src/rtc_tc.py @@ -0,0 +1,144 @@ +# -*- coding:utf-8 +import time +from test_case import TestCaseCommon +from function import run_command +from errcode import E +import traceback + +class RTCTC(TestCaseCommon): + def __init__(self, index, logger, platform_cfg_file, case_cfg_file=None): + MODULE_NAME = "rtc_tc" + TestCaseCommon.__init__(self, index, MODULE_NAME, logger, + platform_cfg_file, case_cfg_file) + self.rtc_info_dict = None + try: + if self.platform_cfg_json and \ + "rtc_info" in self.platform_cfg_json.keys(): + self.rtc_info_dict = self.platform_cfg_json["rtc_info"] + except Exception as e: + self.logger.log_err(str(e), True) + + def read_rtc_test(self, also_print_console=False): + ret = E.OK + self.logger.log_info("read_rtc_test start") + + cmd = "hwclock -r" + code, out = run_command(cmd) + if code: + reason = "Failed to exec 'hwclock -r'" + ret = E.ERTC12001 + self.log_reason(reason) + self.logger.log_dbg(out, also_print_console) + + if ret != E.OK: + self.logger.log_info("read_rtc_test done, FAILED.") + else: + self.logger.log_info("read_rtc_test done, PASS.") + return ret + + def rtc_precision_test(self, wait_time=5, also_print_console=False): + ret = E.OK + rtc_since_epoch_file = "/sys/class/rtc/rtc0/since_epoch" + + self.logger.log_info("rtc_precision_test start") + try: + with open(rtc_since_epoch_file, "r") as f: + start_sec = int(f.read()) + timeArraystart = time.localtime(start_sec) + otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArraystart) + log_msg = "rtc time: {}".format(otherStyleTime) + self.logger.log_info(log_msg, also_print_console) + log_msg = "system time: {}".format( + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) + self.logger.log_info(log_msg, also_print_console) + + self.logger.log_info("time sleep: " + str(wait_time), also_print_console) + time.sleep(wait_time) + + with open(rtc_since_epoch_file, "r") as f: + end_sec = int(f.read()) + timeArrayend = time.localtime(end_sec) + otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArrayend) + log_msg = "rtc time: {}".format(otherStyleTime) + self.logger.log_info(log_msg, also_print_console) + log_msg = "system time: {}".format( + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) + self.logger.log_info(log_msg, also_print_console) + + timeCompare = end_sec - start_sec + self.logger.log_info("time difference: " + str(timeCompare), + also_print_console) + if timeCompare < (wait_time - 1) or timeCompare > (wait_time + 1): + self.log_reason("{} beyond {}".format(timeCompare, wait_time)) + ret = E.ERTC12002 + except IOError as e: + self.fail_reason.append(str(e)) + ret = E.ERTC12001 + + if ret != E.OK: + self.logger.log_info("rtc_precision_test done, FAILED.") + else: + self.logger.log_info("rtc_precision_test done, PASS.") + + return ret + + def rtc_functional_test(self, also_print_console=False): + self.logger.log_info("rtc_functional_test start") + current_secs_before = int(time.time()) + delay_interval = self.rtc_info_dict["delay_time"] + self.logger.log_info( + "please waiting {} sec".format(delay_interval), also_print_console) + time.sleep(delay_interval) + time_end = time.strftime("%Y-%m-%d %H:%M:%S") + self.logger.log_info("current time: %s" % time_end, also_print_console) + current_secs_after = int(time.time()) + delta_interval = current_secs_after - current_secs_before + if abs(delta_interval - delay_interval) > self.rtc_info_dict["max_time_diff"]: + self.log_reason("time out of sync") + ret = E.ERTC12002 + else: + ret = E.OK + + if ret != E.OK: + self.logger.log_err("rtc_functional_test FAILED") + else: + self.logger.log_info("rtc_functional_test PASS.") + + return ret + + def run_test(self, *argv): + # RTC functional test + final_result = E.OK + try: + ret = self.rtc_functional_test() + if ret != E.OK: + final_result = ret + except Exception as e: + reason = "Failed, {} rtc_functional_test exception: {}".format(self.get_tc_name(), str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_result = E.EFAIL + + # RTC read test + try: + ret = self.read_rtc_test() + if ret != E.OK: + final_result = ret + except Exception as e: + reason = "Failed, {} read_rtc_test exception: {}".format(self.get_tc_name(), str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_result = E.EFAIL + + # RTC precision test + try: + ret = self.rtc_precision_test(5) + if ret != E.OK: + final_result = ret + except Exception as e: + reason = "Failed, {} rtc_precision_test exception: {}".format(self.get_tc_name(), str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + final_result = E.EFAIL + + return final_result diff --git a/src/sonic-pit/pit-sysdiag/src/sensor_tc.py b/src/sonic-pit/pit-sysdiag/src/sensor_tc.py new file mode 100644 index 000000000000..a65f8059aea3 --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/src/sensor_tc.py @@ -0,0 +1,121 @@ +import sys +from tabulate import tabulate +from test_case import TestCaseCommon +from function import load_platform_util_module +from errcode import E +import traceback + + +class SENSORTC(TestCaseCommon): + __PLATFORM_SPECIFIC_MODULE_NAME = "sensorutil" + __PLATFORM_SPECIFIC_CLASS_NAME = "SensorUtil" + def __init__(self, index, logger, platform_cfg_file, case_cfg_file=None): + MODULE_NAME = "sensor_tc" + self.sensor_util = None + TestCaseCommon.__init__(self, index, MODULE_NAME, logger, platform_cfg_file, case_cfg_file) + + sensor_module = load_platform_util_module(self.__PLATFORM_SPECIFIC_MODULE_NAME) + try: + platform_util_class = getattr(sensor_module, self.__PLATFORM_SPECIFIC_CLASS_NAME) + self.sensor_util = platform_util_class() + except AttributeError as e: + self.logger.log_err(str(e), True) + sys.exit(1) + + def load_sensor_info(self): + sensor_dict = {} + if self.sensor_util: + sensor_dict = self.sensor_util.get_all() + return sensor_dict + + def sensor_verify(self, sensor_dict): + self.logger.log_info("sensor verify start") + if not sensor_dict: + self.log_reason("get sensors failed!") + return E.EFAIL + + ret = E.OK + header = ["Sensor", 'InputName', 'Status', 'Value', 'LowThd', 'HighThd'] + status_table = [] + + try: + for sensor_name, sensor_obj in sensor_dict.items(): + if sensor_name == 'Number': + continue + + if not isinstance(sensor_obj, dict): + continue + + si_names = [k for k in sensor_obj.keys()] + si_names.sort() + for si_name in si_names: + si = sensor_obj[si_name] + sval = si.get('Value') + slow = si.get('LowThd') + shigh = si.get("HighThd") + sunit = si.get('Unit') + sdesc = si.get('Description') + fault = False + + if not sunit: + sunit = "" + stype = si.get('Type') + if stype: + type2unit = {"amp": "A", "voltage": "V", "power": "W", + "temperature": "C", "RPM": "RPM"} + if stype in type2unit: + sunit = type2unit[stype] + + try: + sval = float(sval) + except: + sval = 0.0 + fault = True + + try: + slow = float(slow) + except: + slow = 0.0 + fault = True + + try: + shigh = float(shigh) + except: + shigh = 0.0 + fault = True + + status = 'NOT_OK' + if fault == False and sval >= slow and sval <= shigh: + status = 'OK' + else: + ret = E.ESSR7003 + self.log_reason("{} out of threshold".format(si_name)) + + status_table.append([sensor_name, si_name, status, "{} {}".format(sval, sunit), \ + "{} {}".format(slow, sunit), "{} {}".format(shigh, sunit)]) + except Exception as e: + reason = "sensor verify got exception: {}".format(str(e)) + self.fail_reason.append(str(e)) + self.logger.log_err(traceback.format_exc()) + ret = E.ESSR7002 + + if len(status_table) > 0: + status_table.sort() + self.logger.log_info(tabulate(status_table, header, tablefmt="simple")) + + if ret != E.OK: + self.logger.log_err("sensor verify done, FAILED.") + else: + self.logger.log_info("sensor verify done, PASS.") + + return ret + + def run_test(self, *argv): + try: + sensor_dict = self.load_sensor_info() + ret = self.sensor_verify(sensor_dict) + except Exception as e: + reason = "load_sensor/sensor_verify got exception: {}".format(str(e)) + self.log_reason(reason) + + return ret diff --git a/src/sonic-pit/pit-sysdiag/src/ssd_tc.py b/src/sonic-pit/pit-sysdiag/src/ssd_tc.py new file mode 100644 index 000000000000..9d86819d5ab5 --- /dev/null +++ b/src/sonic-pit/pit-sysdiag/src/ssd_tc.py @@ -0,0 +1,224 @@ +import os +import re +import subprocess +from test_case import TestCaseCommon +from errcode import * +from function import run_command +import traceback + + +class SSDTC(TestCaseCommon): + def __init__(self, index, logger, platform_cfg_file, case_cfg_file=None): + MODULE_NAME = "ssd_tc" + TestCaseCommon.__init__(self, index, MODULE_NAME, logger, platform_cfg_file, case_cfg_file) + self.test_size = 1 # unit: MBytes, default + self.ssd_bom_list = None # default + + try: + if self.platform_cfg_json and 'ssd_test_size' in self.platform_cfg_json.keys(): + size = self.platform_cfg_json['ssd_test_size'] + if size.endswith("m") or size.endswith("M"): + self.test_size = int(size.strip("mM")) + else: + self.test_size = int(size) + if self.platform_cfg_json and 'ssd_bom' in self.platform_cfg_json.keys(): + self.ssd_bom_list = self.platform_cfg_json['ssd_bom'] + except Exception as e: + self.logger.log_err(str(e)) + + def search_dir_by_name(self, name, dir): + result = [] + try: + files = os.listdir(dir) + for file in files: + if name in file: + result.append(os.path.join(dir, file)) + except Exception as e: + pass + return result + + def get_ssd_location(self): + ret = NO_ERR + dir = "/sys/block/" + spect = "sd" + ssdpath = [] + result = self.search_dir_by_name(spect, dir) + if len(result) <= 0: + ret = ABSENT_ERR + else: + for item in result: + with open(os.path.join(item, "removable"), 'r') as fd: + value = fd.read() + if value.strip() == "0": # found ssd + ssd_disk = "/dev/" + os.path.basename(item) + ssdpath.append(ssd_disk) + if not ssdpath: # not found ssd + self.logger.log_err("no ssd found") + ret = ABSENT_ERR + + if ret: + self.log_reason("ssd not found!") + + return ret, ssdpath + + def test_ssd_info(self, ssdpath): + ret = E.OK + ssd = {} + self.logger.log_info("test ssd info start") + for path in ssdpath: + status, out = run_command("smartctl -i {}".format(path)) + self.logger.log_info(out) + if status: + err = "Read ssd {} info failed!".format(path) + self.log_reason(err) + ret = E.ESSD2001 + else: + if self.ssd_bom_list: + matched = False + model_match = False + size_match = False + lines = out.splitlines() + for ssd_bom in self.ssd_bom_list: + expected_model = ssd_bom["model"] + expected_size = ssd_bom["size"] + for line in lines: + if line.startswith("Device Model:"): + if line.find(expected_model) != -1: + model_match = True + continue + elif line.startswith("User Capacity"): + if line.find(expected_size) != -1: + size_match = True + continue + if model_match and size_match: + matched = True + break + + # Does not match any of expected BOM + if not matched: + ret = E.ESSD2001 + self.fail_reason.append("SSD model/size not match") + + if ret != E.OK: + self.logger.log_err("test ssd info done, FAILED.") + else: + self.logger.log_err("test ssd info done, PASS.") + + return ret + + def ssd_health_check(self, ssdpath): + """ + SSD SMART overall-health self-assessment test + """ + ret = E.OK + self.logger.log_info("ssd health check start") + for path in ssdpath: + status, out = run_command("smartctl -H {} | grep result".format(path)) + self.logger.log_info(out) + + if out.find("PASSED") == -1: + reason = "ssd {} health check failed!".format(path) + ret = E.ESSD2004 + self.log_reason(err) + + if ret != E.OK: + self.logger.log_err("ssd health check done, FAILED.") + else: + self.logger.log_err("ssd health check done, PASS.") + + return ret + + def ssd_read_test(self): + self.logger.log_info("ssd read test start") + + bs_count = self.test_size * 64 + cmd = "dd if=/dev/sda of=/dev/null bs=16k count=%d iflag=direct,nonblock" % bs_count + self.logger.log_dbg(cmd) + status, out = run_command(cmd) + if status: + err = "[{}] read test failed!".format(self.module_name) + self.log_reason.append(err) + else: + self.logger.log_info(out) + + if status: + self.logger.log_err("ssd read test done, FAILED.") + ret = E.ESSD2002 + else: + self.logger.log_info("ssd read test done, PASS.") + ret = E.OK + + return ret + + def ssd_write_test(self): + self.logger.log_info("ssd write test start") + + bs_count = self.test_size * 64 + cmd = "dd if=/dev/urandom of=/tmp/txtfile_ssd bs=16k count=%d oflag=direct,nonblock" % bs_count + self.logger.log_info(cmd) + status, out = run_command(cmd) + if status: + err = "[{}] write test failed!".format(self.module_name) + self.log_reason.append(err) + else: + self.logger.log_info(out) + os.remove("/tmp/txtfile_ssd") + + if status: + self.logger.log_err("ssd write test done, FAILED.") + ret = E.ESSD2003 + else: + self.logger.log_info("ssd write test done, PASS.") + ret = E.OK + + return ret + + def run_test(self, *argv): + final_ret = E.OK + + try: + status, ssdpath = self.get_ssd_location() + if status: + final_ret = E.ESSD2001 + except Exception as e: + reason = "get ssd location exception {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + try: + ret = self.test_ssd_info(ssdpath) + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "ssd info check exception {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + try: + ret = self.ssd_health_check(ssdpath) + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "ssd health check exception {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + try: + ret = self.ssd_read_test() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "ssd read test exception {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + try: + ret = self.ssd_write_test() + if ret != E.OK: + final_ret = ret + except Exception as e: + reason = "ssd write test exception {}".format(str(e)) + self.log_reason(reason) + self.logger.log_err(traceback.format_exc()) + + return final_ret From bf5b72a356d35eca7a03be5be825a265a3f11e67 Mon Sep 17 00:00:00 2001 From: siqbal1986 Date: Tue, 27 Jun 2023 12:53:56 -0700 Subject: [PATCH 042/107] Vnet monitor table cleanup (#15399) * Added VNET_MONITOR_TABLE, BFD_SESSION_TABLE, to the listof tables to be cleaned up after swss restart. * Added VNET_ROUTE* table in cleanup. This should cover VNET_ROUTE_TUNNEL_TABLE as well. --- files/scripts/swss.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index c0c9b1952b05..0e37fe1376cd 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -175,7 +175,7 @@ start() { $SONIC_DB_CLI GB_ASIC_DB FLUSHDB $SONIC_DB_CLI GB_COUNTERS_DB FLUSHDB $SONIC_DB_CLI RESTAPI_DB FLUSHDB - clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*', 'FG_ROUTE_TABLE*', 'BUFFER_POOL*', 'BUFFER_PROFILE*', 'MUX_CABLE_TABLE*', 'ADVERTISE_NETWORK_TABLE*', 'VXLAN_TUNNEL_TABLE*', 'MACSEC_PORT_TABLE*', 'MACSEC_INGRESS_SA_TABLE*', 'MACSEC_EGRESS_SA_TABLE*', 'MACSEC_INGRESS_SC_TABLE*', 'MACSEC_EGRESS_SC_TABLE*', 'VRF_OBJECT_TABLE*', 'VNET_MONITOR_TABLE*', 'BFD_SESSION_TABLE*', 'VNET_ROUTE_TUNNEL_TABLE*'" + clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*', 'FG_ROUTE_TABLE*', 'BUFFER_POOL*', 'BUFFER_PROFILE*', 'MUX_CABLE_TABLE*', 'ADVERTISE_NETWORK_TABLE*', 'VXLAN_TUNNEL_TABLE*', 'VNET_ROUTE*', 'MACSEC_PORT_TABLE*', 'MACSEC_INGRESS_SA_TABLE*', 'MACSEC_EGRESS_SA_TABLE*', 'MACSEC_INGRESS_SC_TABLE*', 'MACSEC_EGRESS_SC_TABLE*', 'VRF_OBJECT_TABLE*', 'VNET_MONITOR_TABLE*', 'BFD_SESSION_TABLE*'" $SONIC_DB_CLI APPL_STATE_DB FLUSHDB rm -rf /tmp/cache fi From d4de62d15567c487f6a5fb538c07cb70440d487b Mon Sep 17 00:00:00 2001 From: prabhataravind <108555774+prabhataravind@users.noreply.github.com> Date: Tue, 27 Jun 2023 14:10:53 -0700 Subject: [PATCH 043/107] [docker-sonic-vs]: dd NPU SKU for docker-sonic-vs (#15604) Define a generic 2-port NPU SKU for docker-sonic-vs to enable DASH vstests to pass on azure pipelines Work item tracking Microsoft ADO 24375371: How I did it Define a generic 2-port NPU hwsku that is used only for DASH-specific vstests. Signed-off-by: Prabhat Aravind --- .../x86_64-kvm_x86_64-r0/NPU/sai_npu.profile | 5 ++++ platform/vs/docker-sonic-vs/Dockerfile.j2 | 1 + .../vs/docker-sonic-vs/platform-npu-2p.json | 23 +++++++++++++++++++ platform/vs/docker-sonic-vs/start.sh | 18 ++++++++++++--- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile create mode 100644 platform/vs/docker-sonic-vs/platform-npu-2p.json diff --git a/device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile b/device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile new file mode 100644 index 000000000000..ffc5d7a21103 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile @@ -0,0 +1,5 @@ +SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_NPU +SAI_VS_HOSTIF_USE_TAP_DEVICE=true +SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini +SAI_VS_CORE_PORT_INDEX_MAP_FILE=/usr/share/sonic/hwsku/coreportindexmap.ini +SAI_VS_INTERFACE_FABRIC_LANE_MAP_FILE=/usr/share/sonic/hwsku/fabriclanemap.ini diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index 4b356fa1a17a..bbff022601c9 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -147,6 +147,7 @@ COPY ["zero_profiles.json", "/etc/sonic"] COPY ["buffermgrd.sh", "/usr/bin/"] COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] +COPY ["platform-npu-2p.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Mellanox-SN2700/"] diff --git a/platform/vs/docker-sonic-vs/platform-npu-2p.json b/platform/vs/docker-sonic-vs/platform-npu-2p.json new file mode 100644 index 000000000000..718582b1a283 --- /dev/null +++ b/platform/vs/docker-sonic-vs/platform-npu-2p.json @@ -0,0 +1,23 @@ +{ + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1", + "lanes": "0,1,2,3", + "breakout_modes": { + "1x100G": ["etp1"], + "1x100G[50G,40G,25G,10G]": ["etp1"], + "2x50G[25G,10G]": ["etp1a", "etp1b"], + "4x10G[25G]": ["etp1a", "etp1b", "etp1c", "etp1d"] + } + }, + "Ethernet4": { + "index": "2,2,2,2", + "lanes": "4,5,6,7", + "breakout_modes": { + "1x100G": ["etp2"], + "1x100G[50G,40G,25G,10G]": ["etp2"], + "2x50G[25G,10G]": ["etp2a", "etp2b"] + } + } + } +} diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 9911c1bfe011..59c05ed4eabf 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -8,6 +8,11 @@ ln -sf /usr/share/sonic/device/$PLATFORM /usr/share/sonic/platform ln -sf /usr/share/sonic/device/$PLATFORM/$HWSKU /usr/share/sonic/hwsku +PLATFORM_CONF=platform.json +if [[ $HWSKU == "NPU-2P" ]]; then + PLATFORM_CONF=platform-npu-2p.json +fi + pushd /usr/share/sonic/hwsku # filter available front panel ports in lanemap.ini @@ -45,9 +50,14 @@ if [ -f /etc/sonic/config_db.json ]; then mv /tmp/config_db.json /etc/sonic/config_db.json else # generate and merge buffers configuration into config file - sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/platform.json -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json - sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json - sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/platform.json -k $HWSKU --print-data > /tmp/ports.json + if [ -f /usr/share/sonic/hwsku/buffers.json.j2 ]; then + sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json + fi + if [ -f /usr/share/sonic/hwsku/qos.json.j2 ]; then + sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json + fi + + sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -k $HWSKU --print-data > /tmp/ports.json # change admin_status from up to down; Test cases dependent sed -i "s/up/down/g" /tmp/ports.json sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/qos.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json @@ -56,6 +66,8 @@ sonic-cfggen -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.jso if [ "$HWSKU" == "Mellanox-SN2700" ]; then cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile +elif [ "$HWSKU" == "NPU" ]; then + cp /usr/share/sonic/hwsku/sai_npu.profile /usr/share/sonic/hwsku/sai.profile fi mkdir -p /etc/swss/config.d/ From f0617c7f9a97e33969c679f1f75b60b2a371400f Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 28 Jun 2023 05:40:20 +0800 Subject: [PATCH 044/107] [Ci] Support to build sonic-swss-common for test (#15566) #### Why I did it [Ci] Support to build sonic-swss-common for test ##### Work item tracking - Microsoft ADO **(number only)**: 24341479 --- azure-pipelines.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c4f6e55dadb1..6a5af16bc75b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -108,27 +108,26 @@ stages: sudo rm -rf ../*.deb displayName: "Cleanup" - - task: DownloadPipelineArtifact@2 - inputs: - source: specific - project: build - pipeline: 9 - artifact: sonic-swss-common.amd64.ubuntu20_04 - runVersion: 'latestFromBranch' - runBranch: 'refs/heads/master' - displayName: "Download sonic swss common deb packages" - - task: DownloadPipelineArtifact@2 inputs: artifact: sonic-buildimage.vs displayName: "Download sonic-buildimage.vs artifact" - script: | - set -x sudo apt-get update - sudo apt-get install libyang0.16 -y - sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb - sudo dpkg -i ../python3-swsscommon_1.0.0_amd64.deb + sudo apt-get install -y make libtool m4 autoconf dh-exec debhelper cmake pkg-config \ + libhiredis-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev swig3.0 \ + libpython2.7-dev libboost-dev libboost-serialization-dev uuid-dev libzmq5 libzmq3-dev python3-pip \ + cmake libgtest-dev libgmock-dev libyang-dev + sudo pip3 install pytest + cd src/sonic-swss-common + ./autogen.sh + dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc) + sudo dpkg -i --force-confask,confnew ../libswsscommon_*.deb + sudo dpkg -i ../python3-swsscommon_*.deb + displayName: "Compile sonic swss common" + + - script: | sudo docker load -i ../target/docker-sonic-vs.gz docker tag docker-sonic-vs:latest docker-sonic-vs:$(Build.BuildNumber) username=$(id -un) From 42671e75b6ae165681eaff441fdcb41dd7d7de2c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:21:50 +0800 Subject: [PATCH 045/107] [submodule] Update submodule sonic-restapi to the latest HEAD automatically (#15646) --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index 1c50caaeda51..6b242a30bea4 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit 1c50caaeda51081e44789ddd5527e01c9e02bf9e +Subproject commit 6b242a30bea40b796dec8ce48ac79e06d6aba3c6 From a06ffc9f0c87dcbfad61c109e655abd1504a5c37 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:37:28 +0800 Subject: [PATCH 046/107] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#15645) #### Why I did it src/sonic-host-services ``` * bc08806 - (HEAD -> master, origin/master, origin/HEAD) Implemented ssh configurations (#32) (14 hours ago) [ycoheNvidia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index eab4a9ee30be..bc08806b6400 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit eab4a9ee30be81da70d38f1320c37caef261e7e3 +Subproject commit bc08806b64002c506b8401eae5d9e1c760651e49 From 1ebdcda9e39ee30f080ab1253705f75cb52fd987 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 29 Jun 2023 01:26:49 +0300 Subject: [PATCH 047/107] [nvidia] make sure shared storage with syncd is cleared on restarts (#14547) Why I did it Sharing the storage of syncd with other proprietary application extensions allows them to communicate with syncd in differnt ways. If one container wants to pass some information to syncd then shared storage can be used. However, today the shared storage isn't cleaned on restarts making it possible for syncd to read out-of-date information generated in the past. NOTE: No plans to use it for standard SONIC dockers and we are working on removing the SDK dependency from PMON docker How I did it Implemented new service to clean the shared storage. How to verify it Do reboot/fast-reboot/warm-reboot/config-reload/systemctl restart swss and verify /tmp/ is cleaned after each restart in syncd container. Signed-off-by: Stepan Blyschak --- files/build_templates/docker_image_ctl.j2 | 13 +++++++------ .../per_namespace/syncd.service.j2 | 4 ++++ files/build_templates/sonic_debian_extension.j2 | 4 ++++ .../nv-syncd-shared/nv-syncd-shared.service | 17 +++++++++++++++++ 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 platform/mellanox/nv-syncd-shared/nv-syncd-shared.service diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 4b0bf80231f8..c14bedfd6f32 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -157,9 +157,9 @@ function waitForAllInstanceDatabaseConfigJsonFilesReady() done fi # Delay a second to allow all instance database_config.json files to be completely generated and fully accessible. - # This delay is needed to make sure that the database_config.json files are correctly rendered from j2 template + # This delay is needed to make sure that the database_config.json files are correctly rendered from j2 template # files ( renderning takes some time ) - sleep 1 + sleep 1 fi } {%- endif %} @@ -240,7 +240,7 @@ function postStartAction() mv $WARM_DIR/dump.rdb $WARM_DIR/dump.rdb.old else # If there is a config_db.json dump file, load it. - if [ -r /etc/sonic/config_db$DEV.json ]; then + if [ -r /etc/sonic/config_db$DEV.json ]; then if [ -r /etc/sonic/init_cfg.json ]; then $SONIC_CFGGEN -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db$DEV.json --write-to-db @@ -323,7 +323,7 @@ start() { {%- if sonic_asic_platform == "broadcom" %} {%- if docker_container_name == "syncd" %} - # Set the SYNCD_SHM_SIZE if this variable not defined + # Set the SYNCD_SHM_SIZE if this variable not defined BRCM_PLATFORM_COMMON_DIR=/usr/share/sonic/device/x86_64-broadcom_common SYNCD_SHM_INI=$BRCM_PLATFORM_COMMON_DIR/syncd_shm.ini @@ -545,14 +545,15 @@ start() { {%- if docker_container_name == "syncd" %} -v /var/log/mellanox:/var/log/mellanox:rw \ -v mlnx_sdk_socket:/var/run/sx_sdk \ - -v mlnx_sdk_ready:/tmp \ + -v /tmp/nv-syncd-shared/:/tmp \ -v /dev/shm:/dev/shm:rw \ -v /var/log/sai_failure_dump:/var/log/sai_failure_dump:rw \ -e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \ {%- elif docker_container_name == "pmon" %} -v /var/run/hw-management:/var/run/hw-management:rw \ -v mlnx_sdk_socket:/var/run/sx_sdk \ - -v mlnx_sdk_ready:/tmp \ + -v /tmp/nv-syncd-shared/:/tmp \ + -v /dev/shm:/dev/shm:rw \ -e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \ -v /dev/shm:/dev/shm:rw \ {%- else %} diff --git a/files/build_templates/per_namespace/syncd.service.j2 b/files/build_templates/per_namespace/syncd.service.j2 index b509e7732cfd..1fb803390a80 100644 --- a/files/build_templates/per_namespace/syncd.service.j2 +++ b/files/build_templates/per_namespace/syncd.service.j2 @@ -19,6 +19,10 @@ After=updategraph.service BindsTo=sonic.target After=sonic.target Before=ntp-config.service +{% if sonic_asic_platform == 'mellanox' %} +Requires=nv-syncd-shared.service +After=nv-syncd-shared.service +{% endif %} [Service] User=root diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index fee493990867..2849437ad8d8 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -946,6 +946,10 @@ MLNX_SONIC_PLATFORM_PY3_WHEEL_NAME=$(basename {{mlnx_platform_api_py3_wheel_path sudo cp {{mlnx_platform_api_py3_wheel_path}} $FILESYSTEM_ROOT/$MLNX_SONIC_PLATFORM_PY3_WHEEL_NAME sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $MLNX_SONIC_PLATFORM_PY3_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$MLNX_SONIC_PLATFORM_PY3_WHEEL_NAME + +# Install service that manages Nvidia specific shared storage +sudo cp platform/mellanox/nv-syncd-shared/nv-syncd-shared.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable nv-syncd-shared {% endif %} {%- if SONIC_ROUTING_STACK == "frr" %} diff --git a/platform/mellanox/nv-syncd-shared/nv-syncd-shared.service b/platform/mellanox/nv-syncd-shared/nv-syncd-shared.service new file mode 100644 index 000000000000..a298b4fae926 --- /dev/null +++ b/platform/mellanox/nv-syncd-shared/nv-syncd-shared.service @@ -0,0 +1,17 @@ +[Unit] +Description=Manage Nvidia specific syncd shared volume +Requires=docker.service +After=docker.service +BindsTo=sonic.target +After=sonic.target +PartOf=syncd.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=rm -rf /tmp/nv-syncd-shared/ +ExecStart=mkdir -p /tmp/nv-syncd-shared/ + +[Install] +WantedBy=sonic.target + From 5aaa65db6c74e546a21b33592ba5f4c4c23b95c6 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:06:03 +0800 Subject: [PATCH 048/107] [submodule] Update submodule sonic-restapi to the latest HEAD automatically (#15657) --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index 6b242a30bea4..a69ba06560eb 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit 6b242a30bea40b796dec8ce48ac79e06d6aba3c6 +Subproject commit a69ba06560eb9d2a9b5ace43e22e9665fa986d33 From 874390a14e24c08f54e3c76c4f4173411633e386 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:29:45 +0800 Subject: [PATCH 049/107] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#15658) --- 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 d6453bcb372b..dffd76a857e7 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit d6453bcb372b2fc93995ef6ccf5a40f0638506a8 +Subproject commit dffd76a857e74321917080d75e62568ff3a480e3 From aa46167fdd09b5f973d6c39529715ad75a2a58ec Mon Sep 17 00:00:00 2001 From: snider-nokia <76123698+snider-nokia@users.noreply.github.com> Date: Thu, 29 Jun 2023 14:05:45 -0400 Subject: [PATCH 050/107] [Nokia][sonic-platform] Update Nokia sonic-platform submodule (#15239) Why I did it To support dynamic swapping of module types/speeds (400G/100G/40G) To optimize CMIS ZR optics operation How I did it Reinitialize xcvr_api at module removal/insertion time, and also optimize cache for ZR optics. How to verify it Verify that different (supported) module types can be dynamically swapped (removed/inserted) and that each is properly provisioned by Xcvrd and has its EEPROM information accurately reported in Redis DB (using "show transceiver eeprom") as well as "sfputil show eeprom" direct access. Also verify that Xcvrd initialization and operation with 400G CMIS ZR optics is both efficient and functional. ** edit 6/14/23: pushed enhanced caching (full memory map) support and elimination of base class APIs override. --- platform/broadcom/sonic-platform-modules-nokia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-nokia b/platform/broadcom/sonic-platform-modules-nokia index b027ce0fbccc..c976714e3f39 160000 --- a/platform/broadcom/sonic-platform-modules-nokia +++ b/platform/broadcom/sonic-platform-modules-nokia @@ -1 +1 @@ -Subproject commit b027ce0fbcccaff92d42ef05c05e87922f9161ba +Subproject commit c976714e3f39fc22b5c616ae0f4aadbd2bd4360f From c91707ff3139a8b5d8d3c8eaa9d41406d52287ea Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:08:54 -0700 Subject: [PATCH 051/107] Migrate flush_unused_database from py-redis to sonic-swss-common (#15511) Migrate flush_unused_database from py-redis to sonic-swss-common #### Why I did it flush_unused_database using py-redis, but sonic-swss-common already support flushdb, so we need migrate to sonic-swss-common ##### Work item tracking - Microsoft ADO **(number only)**: 24292565 #### How I did it Migrate flush_unused_database from py-redis to sonic-swss-common #### How to verify it Pass all UT and E2E test #### Description for the changelog Migrate flush_unused_database from py-redis to sonic-swss-common --- dockers/docker-database/flush_unused_database | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dockers/docker-database/flush_unused_database b/dockers/docker-database/flush_unused_database index 11eb7215ebd0..f4c1efdc1268 100755 --- a/dockers/docker-database/flush_unused_database +++ b/dockers/docker-database/flush_unused_database @@ -1,6 +1,5 @@ #!/usr/bin/python3 from swsscommon import swsscommon -import redis import subprocess import time import syslog @@ -26,7 +25,18 @@ for instname, v in instlists.items(): continue try: - r = redis.Redis(host=insthost, unix_socket_path=instsocket, db=dbid) - r.flushdb() - except (redis.exceptions.ConnectionError): + # Migrate code from py-redis to swsscommon, original code: + # r = redis.Redis(host=insthost, unix_socket_path=instsocket, db=dbid) + # py-redis will use TCP connection when unix_socket_path is None + # https://github.com/redis/redis-py/blob/d95d8a24ed2af3eae80b7b0f14cbccc9dbe86e96/redis/client.py#L1006 + if instsocket is not None: + # connect with Unix socket + connector = swsscommon.DBConnector(dbid, instsocket, 0) + else: + # connect with TCP socket + port = swsscommon.SonicDBConfig.getDbPort(dbname); + connector = swsscommon.DBConnector(dbid, insthost, port, 0) + + connector.flushdb() + except RuntimeError: syslog.syslog(syslog.LOG_INFO,"flushdb:Redis Unix Socket connection error for path {} and dbaname {}".format(instsocket, dbname)) From b4a3711a95c67ff922b981698061e01dccc5ed96 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Fri, 30 Jun 2023 14:06:25 -0700 Subject: [PATCH 052/107] [arp_update]: Fix IPv6 neighbor race condition (#15583) * [arp_update]: Fix IPv6 neighbor race condition on dualtors Signed-off-by: Lawrence Lee --- files/scripts/arp_update | 65 ++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 4b25973cfc02..f267e05a54cc 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -89,32 +89,47 @@ while /bin/true; do eval `eval $ip6cmd` if [[ $SUBTYPE == "dualtor" ]]; then - # manually set any remaining FAILED/INCOMPLETE entries to permanently INCOMPLETE - # this prevents any remaining INCOMPLETE entries from automatically transitioning to FAILED - # once these entries are incomplete, any subsequent neighbor advertisement messages - # are able to resolve the entry - - # generates the following command for each failed or incomplete IPv6 neighbor - # ip neigh replace dev nud incomplete - neigh_replace_template="sed -e 's/^/ip neigh replace /' -e 's/,/ dev /' -e 's/$/ nud incomplete;/'" - ip_neigh_replace_cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',' | $neigh_replace_template" - eval `eval $ip_neigh_replace_cmd` - - # on dual ToR devices, try to resolve failed neighbor entries since - # these entries will have tunnel routes installed, preventing normal - # neighbor resolution (SWSS PR #2137) - - # since ndisc6 is a userland process, the above ndisc6 commands are - # insufficient to update the kernel neighbor table for failed entries - - # we don't need to do this for ipv4 neighbors since arping is able to - # update the kernel neighbor table - - # generates the following command for each failed or incomplete IPv6 neighbor + # capture all current failed/incomplete IPv6 neighbors in the kernel to avoid situations where new neighbors are learned + # in the middle of the below sequence of commands + unresolved_kernel_neighbors=$(ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE') + failed_kernel_neighbors=$(echo "$unresolved_kernel_neighbors" | grep FAILED | cut -d ' ' -f 1) + + # it's possible for kernel neighbors to fall out of sync with the hardware + # this can result in failed neighbors entries that don't have corresponding zero MAC neighbor entries + # and therefore don't have tunnel routes installed in the hardware + # flush these neighbors from the kernel to force relearning and resync them to the hardware: + # 1. for every FAILED or INCOMPLETE neighbor in the kernel, check if there is a corresponding zero MAC neighbor in APPL_DB + # 2. if no zero MAC neighbor entry exists, flush the kernel neighbor entry + # - generates the command 'ip neigh flush ' for all such neighbors + unsync_neighbors=$(echo "$unresolved_kernel_neighbors" | cut -d ' ' -f 1 | xargs -I{} bash -c "if [[ -z \"\$(sonic-db-cli APPL_DB hget NEIGH_TABLE:$vlan:{} neigh)\" ]]; then echo '{}'; fi") + if [[ ! -z "$unsync_neighbors" ]]; then + ip_neigh_flush_cmd="echo \"$unsync_neighbors\" | sed -e 's/^/ip neigh flush /' -e 's/$/;/'" + eval `eval "$ip_neigh_flush_cmd"` + sleep 2 + fi + + # generates the following command for each FAILED or INCOMPLETE IPv6 neighbor # timeout 0.2 ping -n -q -i 0 -c 1 -W 1 -I >/dev/null - ping6_template="sed -e 's/^/timeout 0.2 ping /' -e 's/,/ -n -q -i 0 -c 1 -W 1 -I /' -e 's/$/ >\/dev\/null;/'" - failed_ip6_neigh_cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',' | $ping6_template" - eval `eval $failed_ip6_neigh_cmd` + if [[ ! -z "$unresolved_kernel_neighbors" ]]; then + ping6_template="sed -e 's/^/timeout 0.2 ping /' -e 's/,/ -n -q -i 0 -c 1 -W 1 -I /' -e 's/$/ >\/dev\/null;/'" + failed_ip6_neigh_cmd="echo \"$unresolved_kernel_neighbors\" | cut -d ' ' -f 1,3 --output-delimiter=',' | $ping6_template" + eval `eval "$failed_ip6_neigh_cmd"` + # allow some time for any transient INCOMPLETE neighbors to transition to FAILED + sleep 5 + fi + + # manually set any remaining FAILED entries to permanently INCOMPLETE + # once these entries are INCOMPLETE, any subsequent neighbor advertisement messages are able to resolve the entry + # ignore INCOMPLETE neighbors since if they are transiently incomplete (i.e. new kernel neighbors that we are attempting to resolve for the first time), + # setting them to permanently incomplete here means the kernel will never generate a netlink message for that neighbor + # generates the following command for each FAILED IPv6 neighbor + # ip neigh replace dev nud incomplete + failed_kernel_neighbors=$(ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED') + if [[ ! -z "$failed_kernel_neighbors" ]]; then + neigh_replace_template="sed -e 's/^/ip neigh replace /' -e 's/,/ dev /' -e 's/$/ nud incomplete;/'" + ip_neigh_replace_cmd="echo \"$failed_kernel_neighbors\" | cut -d ' ' -f 1,3 --output-delimiter=',' | $neigh_replace_template" + eval `eval "$ip_neigh_replace_cmd"` + fi fi done From c190a8f795e4aac1fe66fc1fbf6a0ebd13a386ac Mon Sep 17 00:00:00 2001 From: Andrew Sapronov Date: Sat, 1 Jul 2023 03:30:07 +0300 Subject: [PATCH 053/107] [Netberg][Barefoot] Added support for Aurora 710 (#15298) * [202012][platform/barefoot] (#8543) Why I did it Pcied running by python 2. How I did it dropped python2 support and add python3 support for pcied in file docker-pmon.supervisord.conf.j2 How to verify it docker exec pmon supervisorctl status * [Netberg][nba710] Added initial support for Aurora 710 Signed-off-by: Andrew Sapronov --------- Signed-off-by: Andrew Sapronov Co-authored-by: Kostiantyn Yarovyi --- .../aurora-710/buffers.json.j2 | 2 + .../aurora-710/buffers_defaults_t0.j2 | 86 ++++ .../aurora-710/buffers_defaults_t1.j2 | 86 ++++ .../aurora-710/hwsku.json | 164 +++++++ .../aurora-710/pg_profile_lookup.ini | 17 + .../aurora-710/port_config.ini | 33 ++ .../aurora-710/qos.json.j2 | 10 + .../aurora-710/sai.profile | 2 + .../aurora-710/switch-tna-sai.conf | 39 ++ .../x86_64-netberg_aurora_710-r0/default_sku | 1 + .../x86_64-netberg_aurora_710-r0/fancontrol | 12 + .../installer.conf | 3 + .../x86_64-netberg_aurora_710-r0/pcie.yaml | 417 ++++++++++++++++++ .../platform_asic | 1 + .../plugins/eeprom.py | 22 + .../plugins/psuutil.py | 107 +++++ .../plugins/sfputil.py | 332 ++++++++++++++ .../pmon_daemon_control.json | 3 + .../x86_64-netberg_aurora_710-r0/sensors.conf | 76 ++++ platform/barefoot/one-image.mk | 1 + platform/barefoot/platform-modules-netberg.mk | 13 +- .../aurora-710/.gitignore | 23 + .../aurora-710/README.md | 185 ++++++++ .../aurora-710/modules/Makefile | 0 .../service/aurora-710-monitor.service | 18 + .../aurora-710/setup.py | 27 ++ .../aurora-710/sonic_platform/__init__.py | 2 + .../aurora-710/sonic_platform/chassis.py | 237 ++++++++++ .../aurora-710/sonic_platform/component.py | 106 +++++ .../aurora-710/sonic_platform/eeprom.py | 114 +++++ .../sonic_platform/event_monitor.py | 95 ++++ .../aurora-710/sonic_platform/fan.py | 216 +++++++++ .../aurora-710/sonic_platform/fan_drawer.py | 23 + .../aurora-710/sonic_platform/platform.py | 20 + .../aurora-710/sonic_platform/psu.py | 327 ++++++++++++++ .../aurora-710/sonic_platform/sfp.py | 197 +++++++++ .../aurora-710/sonic_platform/thermal.py | 219 +++++++++ .../aurora-710/sonic_platform/watchdog.py | 251 +++++++++++ .../aurora-710/utils/i2c_init.sh | 404 +++++++++++++++++ .../debian/changelog | 9 +- .../debian/control | 5 +- .../debian/rules | 5 +- .../sonic-platform-netberg-aurora-710.init | 40 ++ .../sonic-platform-netberg-aurora-710.install | 1 + ...sonic-platform-netberg-aurora-710.postinst | 9 + 45 files changed, 3951 insertions(+), 9 deletions(-) create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers.json.j2 create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t0.j2 create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t1.j2 create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/hwsku.json create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/pg_profile_lookup.ini create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/port_config.ini create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/qos.json.j2 create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/sai.profile create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/switch-tna-sai.conf create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/default_sku create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/fancontrol create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/installer.conf create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/pcie.yaml create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/platform_asic create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/plugins/eeprom.py create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/plugins/psuutil.py create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/plugins/sfputil.py create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/pmon_daemon_control.json create mode 100644 device/netberg/x86_64-netberg_aurora_710-r0/sensors.conf create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/.gitignore create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/README.md create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/modules/Makefile create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/service/aurora-710-monitor.service create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/setup.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/__init__.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/chassis.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/component.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/eeprom.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/event_monitor.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan_drawer.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/platform.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/psu.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/sfp.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/thermal.py create mode 100644 platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/watchdog.py create mode 100755 platform/barefoot/sonic-platform-modules-netberg/aurora-710/utils/i2c_init.sh create mode 100644 platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.init create mode 100644 platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.install create mode 100755 platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.postinst diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers.json.j2 b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers.json.j2 new file mode 100644 index 000000000000..1083a6210fc9 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t0.j2 b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..64735cf0e29e --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t0.j2 @@ -0,0 +1,86 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '4194304' %} +{% set ingress_lossy_pool_size = '7340032' %} +{% set egress_lossless_pool_size = '16777152' %} +{% set egress_lossy_pool_size = '7340032' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,47) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} + {% for port_idx in range(48,55) %} + {% if PORT.append("Ethernet%d" % (48 + ( port_idx - 48 )*4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "{{ ingress_lossy_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"ingress_lossless_pool", + "size":"4096", + "dynamic_th":"0", + "xon":"18432", + "xoff":"18432" + }, + "ingress_lossy_profile": { + "pool":"ingress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"4096", + "dynamic_th":"7", + "xon":"18432", + "xoff":"18432" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "q_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "q_lossy_profile" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +{%- endmacro %} diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t1.j2 b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..cea4955456bf --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/buffers_defaults_t1.j2 @@ -0,0 +1,86 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '2097152' %} +{% set ingress_lossy_pool_size = '5242880' %} +{% set egress_lossless_pool_size = '16777152' %} +{% set egress_lossy_pool_size = '5242880' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,47) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} + {% for port_idx in range(48,55) %} + {% if PORT.append("Ethernet%d" % (48+(port_idx-48)*4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "{{ ingress_lossy_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"ingress_lossless_pool", + "size":"4096", + "dynamic_th":"0", + "xon":"18432", + "xoff":"18432" + }, + "ingress_lossy_profile": { + "pool":"ingress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"4096", + "dynamic_th":"7", + "xon":"18432", + "xoff":"18432" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "q_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "q_lossy_profile" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +{%- endmacro %} diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/hwsku.json b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/hwsku.json new file mode 100644 index 000000000000..203aa5a34047 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/hwsku.json @@ -0,0 +1,164 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet8": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet12": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet16": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet20": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet24": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet28": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet32": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet36": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet40": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet44": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet48": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet52": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet56": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet60": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet64": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet68": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet72": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet76": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet80": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet84": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet88": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet92": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet96": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet100": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet104": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet108": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet112": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet116": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet120": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet124": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + } + } +} diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/pg_profile_lookup.ini b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/pg_profile_lookup.ini new file mode 100644 index 000000000000..26287e4b6fea --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 34816 18432 16384 0 + 25000 5m 34816 18432 16384 0 + 40000 5m 34816 18432 16384 0 + 50000 5m 34816 18432 16384 0 + 100000 5m 36864 18432 18432 0 + 10000 40m 36864 18432 18432 0 + 25000 40m 39936 18432 21504 0 + 40000 40m 41984 18432 23552 0 + 50000 40m 41984 18432 23552 0 + 100000 40m 54272 18432 35840 0 + 10000 300m 49152 18432 30720 0 + 25000 300m 71680 18432 53248 0 + 40000 300m 94208 18432 75776 0 + 50000 300m 94208 18432 75776 0 + 100000 300m 184320 18432 165888 0 diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/port_config.ini b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/port_config.ini new file mode 100644 index 000000000000..180555196c18 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/port_config.ini @@ -0,0 +1,33 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0,1,2,3 Ethernet0 100000 0 rs 0 +Ethernet4 4,5,6,7 Ethernet4 100000 0 rs 1 +Ethernet8 8,9,10,11 Ethernet8 100000 0 rs 2 +Ethernet12 12,13,14,15 Ethernet12 100000 0 rs 3 +Ethernet16 16,17,18,19 Ethernet16 100000 0 rs 4 +Ethernet20 20,21,22,23 Ethernet20 100000 0 rs 5 +Ethernet24 24,25,26,27 Ethernet24 100000 0 rs 6 +Ethernet28 28,29,30,31 Ethernet28 100000 0 rs 7 +Ethernet32 32,33,34,35 Ethernet32 100000 0 rs 8 +Ethernet36 36,37,38,39 Ethernet36 100000 0 rs 9 +Ethernet40 40,41,42,43 Ethernet40 100000 0 rs 10 +Ethernet44 44,45,46,47 Ethernet44 100000 0 rs 11 +Ethernet48 48,49,50,51 Ethernet48 100000 0 rs 12 +Ethernet52 52,53,54,55 Ethernet52 100000 0 rs 13 +Ethernet56 56,57,58,59 Ethernet56 100000 0 rs 14 +Ethernet60 60,61,62,63 Ethernet60 100000 0 rs 15 +Ethernet64 64,65,66,67 Ethernet64 100000 0 rs 16 +Ethernet68 68,69,70,71 Ethernet68 100000 0 rs 17 +Ethernet72 72,73,74,75 Ethernet72 100000 0 rs 18 +Ethernet76 76,77,78,79 Ethernet76 100000 0 rs 19 +Ethernet80 80,81,82,83 Ethernet80 100000 0 rs 20 +Ethernet84 84,85,86,87 Ethernet84 100000 0 rs 21 +Ethernet88 88,89,90,91 Ethernet88 100000 0 rs 22 +Ethernet92 92,93,94,95 Ethernet92 100000 0 rs 23 +Ethernet96 96,97,98,99 Ethernet96 100000 0 rs 24 +Ethernet100 100,101,102,103 Ethernet100 100000 0 rs 25 +Ethernet104 104,105,106,107 Ethernet104 100000 0 rs 26 +Ethernet108 108,109,110,111 Ethernet108 100000 0 rs 27 +Ethernet112 112,113,114,115 Ethernet112 100000 0 rs 28 +Ethernet116 116,117,118,119 Ethernet116 100000 0 rs 29 +Ethernet120 120,121,122,123 Ethernet120 100000 0 rs 30 +Ethernet124 124,125,126,127 Ethernet124 100000 0 rs 31 diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/qos.json.j2 b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/qos.json.j2 new file mode 100644 index 000000000000..f7cd608b6b66 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/qos.json.j2 @@ -0,0 +1,10 @@ +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} \ No newline at end of file diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/sai.profile b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/sai.profile new file mode 100644 index 000000000000..81f300522592 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/sai.profile @@ -0,0 +1,2 @@ +SAI_KEY_WARM_BOOT_WRITE_FILE=/var/warmboot/sai-warmboot.bin +SAI_KEY_WARM_BOOT_READ_FILE=/var/warmboot/sai-warmboot.bin \ No newline at end of file diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/switch-tna-sai.conf b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/switch-tna-sai.conf new file mode 100644 index 000000000000..23707a4ee919 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/aurora-710/switch-tna-sai.conf @@ -0,0 +1,39 @@ +{ + "chip_list": [ + { + "chip_family": "Tofino", + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 + } + ], + "p4_devices": [ + { + "device-id": 0, + "agent0": "lib/platform/x86_64-netberg_aurora_710-r0/libpltfm_mgr.so", + "p4_programs": [ + { + "p4_pipelines": [ + { + "p4_pipeline_name": "pipe", + "config": "share/switch/pipe/tofino.bin", + "context": "share/switch/pipe/context.json" + } + ], + "program-name": "switch", + "bfrt-config": "share/switch/bf-rt.json", + "model_json_path" : "share/switch/aug_model.json", + "switchapi_port_add": false, + "non_default_port_ppgs": 5 + } + ] + } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } + ] +} diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/default_sku b/device/netberg/x86_64-netberg_aurora_710-r0/default_sku new file mode 100644 index 000000000000..d6002ac2c9ba --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/default_sku @@ -0,0 +1 @@ +aurora-710 t1 diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/fancontrol b/device/netberg/x86_64-netberg_aurora_710-r0/fancontrol new file mode 100644 index 000000000000..dc303afac034 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/fancontrol @@ -0,0 +1,12 @@ +# Configuration file generated by pwmconfig, changes will be lost +INTERVAL=10 +DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-56/56-002f +DEVNAME=hwmon1=w83795adg +FCTEMPS=hwmon1/device/pwm2=hwmon2/temp2_input hwmon1/device/pwm1=hwmon2/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 +# TODO: check the temp value with HW after board ready +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/netberg/x86_64-netberg_aurora_710-r0/installer.conf b/device/netberg/x86_64-netberg_aurora_710-r0/installer.conf new file mode 100644 index 000000000000..925a32fc0c3a --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/installer.conf @@ -0,0 +1,3 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/pcie.yaml b/device/netberg/x86_64-netberg_aurora_710-r0/pcie.yaml new file mode 100644 index 000000000000..adafbe61e649 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/pcie.yaml @@ -0,0 +1,417 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '03' + fn: '1' + id: 6f09 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '03' + fn: '2' + id: 6f0a + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '03' + fn: '3' + id: 6f0b + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '01' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '01' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '01' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '01' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '02' + dev: '00' + fn: '0' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '02' + dev: '00' + fn: '1' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '04' + dev: '00' + fn: '0' + id: '0010' + name: 'Unassigned class [ff00]: Device 1d1c:0010 (rev 10)' +- bus: 08 + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/platform_asic b/device/netberg/x86_64-netberg_aurora_710-r0/platform_asic new file mode 100644 index 000000000000..88d88117928c --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/platform_asic @@ -0,0 +1 @@ +barefoot diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/plugins/eeprom.py b/device/netberg/x86_64-netberg_aurora_710-r0/plugins/eeprom.py new file mode 100644 index 000000000000..18c3e5f05a57 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/plugins/eeprom.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +############################################################################# +# Netberg Aurora 710 +# +# Platform and model specific eeprom subclass, inherits from the base class, +# and provides the followings: +# - the eeprom format definition +# - specific encoder/decoder if there is special need +############################################################################# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError, e: + raise ImportError (str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0055/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/plugins/psuutil.py b/device/netberg/x86_64-netberg_aurora_710-r0/plugins/psuutil.py new file mode 100644 index 000000000000..25cdfb031882 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/plugins/psuutil.py @@ -0,0 +1,107 @@ +# +# psuutil.py +# Platform-specific PSU status interface for SONiC +# + + +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + GPIO_OFFSET = 0 + SYS_GPIO_DIR = "/sys/class/gpio/" + + def set_gpio_offset(self): + sys_gpio_dir = "/sys/class/gpio" + self.GPIO_OFFSET = 0 + gpiochip_no = 0 + for d in os.listdir(sys_gpio_dir): + if "gpiochip" in d: + try: + gpiochip_no = int(d[8:],10) + except ValueError as e: + print "Error: %s" % str(e) + if gpiochip_no > 255: + self.GPIO_OFFSET=256 + return True + return True + + def __init__(self): + self.set_gpio_offset() + PsuBase.__init__(self) + + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def get_num_psus(self): + """ + Retrieves the number of PSUs available on the device + :return: An integer, the number of PSUs available on the device + """ + MAX_PSUS = 2 + return MAX_PSUS + + def get_psu_status(self, index): + """ + Retrieves the oprational status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is operating properly, False if PSU is\ + faulty + """ + status = 0 + gpio_path = [ 'gpio'+str(99+self.GPIO_OFFSET)+'/value', 'gpio'+str(96+self.GPIO_OFFSET)+'/value' ] + attr_path = self.SYS_GPIO_DIR + gpio_path[index-1] + + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = int(attr_value, 10) + # Check for PSU status + if (attr_value == 1): + status = 1 + + return status + + def get_psu_presence(self, index): + """ + Retrieves the presence status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is plugged, False if not + """ + status = 0 + gpio_path = [ 'gpio'+str(100+self.GPIO_OFFSET)+'/value', 'gpio'+str(97+self.GPIO_OFFSET)+'/value' ] + attr_path = self.SYS_GPIO_DIR + gpio_path[index-1] + + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = int(attr_value, 10) + # Check for PSU status + if (attr_value == 1): + status = 1 + + return status + diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/plugins/sfputil.py b/device/netberg/x86_64-netberg_aurora_710-r0/plugins/sfputil.py new file mode 100644 index 000000000000..00c5e10e0b0d --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/plugins/sfputil.py @@ -0,0 +1,332 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +import os + +try: + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 0 + PORT_END = 33 + SFP_PORT_START = 32 + PORTS_IN_BLOCK = 34 + GPIO_OFFSET = 0 + + 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: 10, + 1: 9, + 2: 12, + 3: 11, + 4: 14, + 5: 13, + 6: 16, + 7: 15, + 8: 18, + 9: 17, + 10: 20, + 11: 19, + 12: 22, + 13: 21, + 14: 24, + 15: 23, + 16: 26, + 17: 25, + 18: 28, + 19: 27, + 20: 30, + 21: 29, + 22: 32, + 23: 31, + 24: 34, + 25: 33, + 26: 36, + 27: 35, + 28: 38, + 29: 37, + 30: 40, + 31: 39, + 32: 45, + 33: 46 + } + + abs_to_gpio_mapping = {} + lpmode_to_gpio_mapping = {} + reset_to_gpio_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 + @property + def sfp_port_start(self): + return self.SFP_PORT_START + + def set_gpio_offset(self): + sys_gpio_dir = "/sys/class/gpio" + self.GPIO_OFFSET = 0 + gpiochip_no = 0 + for d in os.listdir(sys_gpio_dir): + if "gpiochip" in d: + try: + gpiochip_no = int(d[8:],10) + except ValueError as e: + print "Error: %s" % str(e) + if gpiochip_no > 255: + self.GPIO_OFFSET=256 + return True + return True + + def init_abs_to_gpio_mapping(self): + self.abs_to_gpio_mapping = { + 0: 241+self.GPIO_OFFSET, + 1: 240+self.GPIO_OFFSET, + 2: 243+self.GPIO_OFFSET, + 3: 242+self.GPIO_OFFSET, + 4: 245+self.GPIO_OFFSET, + 5: 244+self.GPIO_OFFSET, + 6: 247+self.GPIO_OFFSET, + 7: 246+self.GPIO_OFFSET, + 8: 249+self.GPIO_OFFSET, + 9: 248+self.GPIO_OFFSET, + 10: 251+self.GPIO_OFFSET, + 11: 250+self.GPIO_OFFSET, + 12: 253+self.GPIO_OFFSET, + 13: 252+self.GPIO_OFFSET, + 14: 255+self.GPIO_OFFSET, + 15: 254+self.GPIO_OFFSET, + 16: 225+self.GPIO_OFFSET, + 17: 224+self.GPIO_OFFSET, + 18: 227+self.GPIO_OFFSET, + 19: 226+self.GPIO_OFFSET, + 20: 229+self.GPIO_OFFSET, + 21: 228+self.GPIO_OFFSET, + 22: 231+self.GPIO_OFFSET, + 23: 230+self.GPIO_OFFSET, + 24: 233+self.GPIO_OFFSET, + 25: 232+self.GPIO_OFFSET, + 26: 235+self.GPIO_OFFSET, + 27: 234+self.GPIO_OFFSET, + 28: 237+self.GPIO_OFFSET, + 29: 236+self.GPIO_OFFSET, + 30: 239+self.GPIO_OFFSET, + 31: 238+self.GPIO_OFFSET, + 32: 177+self.GPIO_OFFSET, + 33: 176+self.GPIO_OFFSET + } + return True + + def init_lpmode_to_gpio_mapping(self): + self.lpmode_to_gpio_mapping = { + 0: 161+self.GPIO_OFFSET, + 1: 160+self.GPIO_OFFSET, + 2: 163+self.GPIO_OFFSET, + 3: 162+self.GPIO_OFFSET, + 4: 165+self.GPIO_OFFSET, + 5: 164+self.GPIO_OFFSET, + 6: 167+self.GPIO_OFFSET, + 7: 166+self.GPIO_OFFSET, + 8: 169+self.GPIO_OFFSET, + 9: 168+self.GPIO_OFFSET, + 10: 171+self.GPIO_OFFSET, + 11: 170+self.GPIO_OFFSET, + 12: 173+self.GPIO_OFFSET, + 13: 172+self.GPIO_OFFSET, + 14: 175+self.GPIO_OFFSET, + 15: 174+self.GPIO_OFFSET, + 16: 145+self.GPIO_OFFSET, + 17: 144+self.GPIO_OFFSET, + 18: 147+self.GPIO_OFFSET, + 19: 146+self.GPIO_OFFSET, + 20: 149+self.GPIO_OFFSET, + 21: 148+self.GPIO_OFFSET, + 22: 151+self.GPIO_OFFSET, + 23: 150+self.GPIO_OFFSET, + 24: 153+self.GPIO_OFFSET, + 25: 152+self.GPIO_OFFSET, + 26: 155+self.GPIO_OFFSET, + 27: 154+self.GPIO_OFFSET, + 28: 157+self.GPIO_OFFSET, + 29: 156+self.GPIO_OFFSET, + 30: 159+self.GPIO_OFFSET, + 31: 158+self.GPIO_OFFSET + } + return True + + def init_reset_to_gpio_mapping(self): + self.reset_to_gpio_mapping = { + 0: 129+self.GPIO_OFFSET, + 1: 128+self.GPIO_OFFSET, + 2: 131+self.GPIO_OFFSET, + 3: 130+self.GPIO_OFFSET, + 4: 133+self.GPIO_OFFSET, + 5: 132+self.GPIO_OFFSET, + 6: 135+self.GPIO_OFFSET, + 7: 134+self.GPIO_OFFSET, + 8: 137+self.GPIO_OFFSET, + 9: 136+self.GPIO_OFFSET, + 10: 139+self.GPIO_OFFSET, + 11: 138+self.GPIO_OFFSET, + 12: 141+self.GPIO_OFFSET, + 13: 140+self.GPIO_OFFSET, + 14: 143+self.GPIO_OFFSET, + 15: 142+self.GPIO_OFFSET, + 16: 113+self.GPIO_OFFSET, + 17: 112+self.GPIO_OFFSET, + 18: 115+self.GPIO_OFFSET, + 19: 114+self.GPIO_OFFSET, + 20: 117+self.GPIO_OFFSET, + 21: 116+self.GPIO_OFFSET, + 22: 119+self.GPIO_OFFSET, + 23: 118+self.GPIO_OFFSET, + 24: 121+self.GPIO_OFFSET, + 25: 120+self.GPIO_OFFSET, + 26: 123+self.GPIO_OFFSET, + 27: 122+self.GPIO_OFFSET, + 28: 125+self.GPIO_OFFSET, + 29: 124+self.GPIO_OFFSET, + 30: 127+self.GPIO_OFFSET, + 31: 126+self.GPIO_OFFSET + } + return True + + def __init__(self): + # Init abs, lpmode, and reset to gpio mapping + self.set_gpio_offset() + self.init_abs_to_gpio_mapping() + self.init_lpmode_to_gpio_mapping() + self.init_reset_to_gpio_mapping() + + # Override port_to_eeprom_mapping for class initialization + 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) + + 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.sfp_port_start: # TBD + 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.sfp_port_start: # TBD + 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.sfp_port_start: # TBD + 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 + + def get_transceiver_change_event(self): + """ + TODO: This function need to be implemented + when decide to support monitoring SFP(Xcvrd) + on this platform. + """ + raise NotImplementedError diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/pmon_daemon_control.json b/device/netberg/x86_64-netberg_aurora_710-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..94592fa8cebc --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/pmon_daemon_control.json @@ -0,0 +1,3 @@ +{ + "skip_ledd": true +} diff --git a/device/netberg/x86_64-netberg_aurora_710-r0/sensors.conf b/device/netberg/x86_64-netberg_aurora_710-r0/sensors.conf new file mode 100644 index 000000000000..eb991d771d15 --- /dev/null +++ b/device/netberg/x86_64-netberg_aurora_710-r0/sensors.conf @@ -0,0 +1,76 @@ +# libsensors configuration file +chip "i350bb-*" + ignore loc1 + +chip "jc42-*" + label temp1 "DIMM Temp" + set temp1_max 50 + set temp1_crit 85 + +bus "i2c-0" "I2C I801" +chip "tmp75-i2c-*-4f" + label temp1 "CPU Board Temp" + set temp1_max 50 + +bus "i2c-41" "i2c-7-switch (chan_id 0)" +chip "tmp75-i2c-*-48" + label temp1 "Near PSU1" + set temp1_max 50 +chip "tmp75-i2c-*-4a" + label temp1 "Rear MAC" + set temp1_max 50 +chip "tmp75-i2c-*-4b" + label temp1 "Near Port 32" + set temp1_max 50 +chip "tmp75-i2c-*-4d" + label temp1 "Near PSU2" + set temp1_max 50 +chip "lm86-i2c-*-4c" + label temp1 "Front MAC" + label temp2 "ASIC Core Temp" + set temp1_min 20 + set temp1_max 65 + set temp1_crit 70 + set temp2_min 20 + set temp2_max 70 + set temp2_crit 80 + +bus "i2c-56" "i2c-0-mux (chan_id 7)" +chip "w83795adg-*" + label in0 "0.9V" + set in0_max 0.927 + set in0_min 0.873 + label in1 "VDD" + set in1_max 0.962 + set in1_min 0.717 + ignore in2 + ignore in3 + ignore in4 + ignore in5 + ignore in6 + ignore in7 + label in12 "2.5V" + #compute in12 (2*4*@)/10, @-(2*4*@/10) + compute in12 @/(1+(3/10)), @*(1+(3/10)) + set in12_max 2.625 + set in12_min 2.375 + # in12 and in13 are the same source + ignore in13 + ignore in14 + ignore in15 + ignore in16 + label fan1 "FANTRAY 1-A" + label fan2 "FANTRAY 1-B" + label fan3 "FANTRAY 2-A" + label fan4 "FANTRAY 2-B" + label fan5 "FANTRAY 3-A" + label fan6 "FANTRAY 3-B" + label fan7 "FANTRAY 4-A" + label fan8 "FANTRAY 4-B" + ignore temp1 + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore intrusion0 diff --git a/platform/barefoot/one-image.mk b/platform/barefoot/one-image.mk index d282fec5640a..798a0d678a0d 100644 --- a/platform/barefoot/one-image.mk +++ b/platform/barefoot/one-image.mk @@ -14,6 +14,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9180_32X_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9280_64X_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_QS_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(NETBERG_AURORA_610_PLATFORM_MODULE) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(NETBERG_AURORA_710_PLATFORM_MODULE) ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) diff --git a/platform/barefoot/platform-modules-netberg.mk b/platform/barefoot/platform-modules-netberg.mk index 1d65b3324d03..aeaac7f79e6b 100644 --- a/platform/barefoot/platform-modules-netberg.mk +++ b/platform/barefoot/platform-modules-netberg.mk @@ -1,16 +1,19 @@ -# Netberg Aurora 610 Platform modules +# Netberg tofino-based platforms modules -NETBERG_AURORA_610_PLATFORM_MODULE_VERSION = 1.1.0 +NETBERG_AURORA_610_PLATFORM_MODULE_VERSION = 1.1.1 +NETBERG_AURORA_710_PLATFORM_MODULE_VERSION = 1.1.1 export NETBERG_AURORA_610_PLATFORM_MODULE_VERSION +export NETBERG_AURORA_710_PLATFORM_MODULE_VERSION NETBERG_AURORA_610_PLATFORM_MODULE = sonic-platform-netberg-aurora-610_$(NETBERG_AURORA_610_PLATFORM_MODULE_VERSION)_amd64.deb $(NETBERG_AURORA_610_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-netberg $(NETBERG_AURORA_610_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(NETBERG_AURORA_610_PLATFORM_MODULE)_PLATFORM = x86_64-netberg_aurora_610-r0 -SONIC_DPKG_DEBS += $(NETBERG_AURORA_610_PLATFORM_MODULE) -export NETBERG_AURORA_610_PLATFORM_MODULE +SONIC_DPKG_DEBS += $(NETBERG_AURORA_610_PLATFORM_MODULE) -#$(eval $(call add_extra_package,$(NETBERG_AURORA_610_PLATFORM_MODULE))) +NETBERG_AURORA_710_PLATFORM_MODULE = sonic-platform-netberg-aurora-710_$(NETBERG_AURORA_710_PLATFORM_MODULE_VERSION)_amd64.deb +$(NETBERG_AURORA_710_PLATFORM_MODULE)_PLATFORM = x86_64-netberg_aurora_710-r0 +$(eval $(call add_extra_package,$(NETBERG_AURORA_610_PLATFORM_MODULE),$(NETBERG_AURORA_710_PLATFORM_MODULE))) diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/.gitignore b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/.gitignore new file mode 100644 index 000000000000..912bdc23edd4 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/.gitignore @@ -0,0 +1,23 @@ +# kernel module build +*.o +*.ko +*.mod.c +*.mod.o +*.cmd +Module.symvers +modules.order + +# debian packaging +*.debhelper +*.log +DEBIAN +.tmp_versions +.finished.build +*.substvars + +# python +*.pyc +/build +/*.egg-info +/venv +/.pybuild diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/README.md b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/README.md new file mode 100644 index 000000000000..549ce695d67d --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/README.md @@ -0,0 +1,185 @@ +# Netberg Aurora 710 Platform Driver for SONiC + +Copyright (C) 2019 Netberg, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +## Licensing terms + +The Licensing terms of the files within this project is split 2 parts. +The Linux kernel is released under the GNU General Public License version 2. +All other code is released under the GNU General Public License version 3. +Please see the LICENSE file for copies of both licenses. + +## Contents of this package + + - service/ + > Service config files for platform initialization and monitoring + - utils/ + > Scripts useful during platform bringup and sysfs function + - conf/ + > Platform configure files. + +## Kernel modules and drivers + +The driver for interacting with Netberg Aurora 710 is contained in the I2C +kernel module and initialization script. The initialization script loads +the modules in the correct order. It has been built and tested against +the Linux 3.16 kernel. + +The initialization script will modprobe the needed modules, navigate to the +module's device directory in sysfs, and write configuration data to +the kernel module. + +### IGB + +This is OOB Ports on front panel for management plane. + +The IGB module must be loaded first on Netberg Aurora 710 platform. + +### I2C i801 + +The I2C i801 on Netberg Aurora 710 can be found in +`/sys/bus/i2c/devices/i2c-0/` + +This is I2C bus for Clock Gen, DIMM channel and digital potentiometers. + +The i801 module must be loaded second on Netberg Aurora 710. + +### I2C iSMT + +The I2C iSMT module on Aurora 710 can be found in +`/sys/bus/i2c/devices/i2c-1/` + +This is I2C bus for CPLD, HWM, power controller and I2C Switches. + +The i801 module must be loaded third on Netberg Aurora 710. + +### I2C PCA9548 +The PCA9548 module on Aurora 710 can be found in +`/sys/bus/i2c/devices/i2c-2/` , `/sys/bus/i2c/devices/i2c-3/`, +`/sys/bus/i2c/devices/i2c-4/`, `/sys/bus/i2c/devices/i2c-5/`, +`/sys/bus/i2c/devices/i2c-6/`, `/sys/bus/i2c/devices/i2c-7/`, +`/sys/bus/i2c/devices/i2c-8/`, `/sys/bus/i2c/devices/i2c-9/`. + +The pca9548 module for zQSFP module get/set functions, PSU information, +fan status and EEPROM. + +## Hardware components + +The hardware components are initialized in the init script on Aurora 710. +The following describes manual initialization as well as interaction. +The examples below are just for Netberg Aurora 710 platform. + +### Hardware initialization + +When the sonic-platform-netberg-aurora-710 package is installed on the Aurora 710, +it is automatically initialized. If you want to manual initialization, the +utility command usage as follows: +``` + i2c_utils.sh i2c_init +``` + +### EEPROM + +The EEPROM is including the board SKU, model name, vendor name, serial number, +and other information can be accessed with the specific eeprom kernel module. +After using `modprobe eeprom_mb` to detect the eeprom, it will show up in sysfs. + +The hexdump utility can be used to decode the raw output of the EEPROM. +For example, +``` + bash# echo "mb_eeprom 0x54" > /sys/bus/i2c/devices/i2c-9/new_device + bash# cat /sys/bus/i2c/drivers/mb_eeprom/9-0054/eeprom | hexdump -C +``` + +### Front panel LEDs + +LEDs can be setup on/off by using i2c utility `/usr/sbin/i2c_utils.sh`. +Utility function command usage as follows: + +``` +Status LED: + i2c_utils.sh i2c_sys_led green|amber on|off + +Fan status LED: + i2c_utils.sh i2c_fan_led green|amber on|off + +PSU1 status LED: + i2c_utils.sh i2c_psu1_led green|amber on|off + +PSU2 status LED: + i2c_utils.sh i2c_psu2_led green|amber on|off + +``` +QSFP Module Port LEDs control by ASIC library. + + +### Fan speed + +Fan speed are controlled by the w83795 kernel module. +It can be found in `/sys/class/hwmon/hwmon3/device/`. +If they were compiled as modules, you will need to modprobe w83795 for +their sysfs entries to show up. Each fan has an `fan_input` file +for reading the fan speed. And `pwm1` setting fan1 to fan4, +`pwm2` setting fan5 to fan8. + +There is docker-platform-monitor container installed fancontrol package that can +automatic control platform fan speed. + + +### Temperature sensors + +Temperature sensors are controlled by the w83795 kernel +module. It can be found in `/sys/class/hwmon/hwmon3/device/`. +If they were compiled as modules, then you will need to modprobe w83795 for +their sysfs entries to show up. +`temp1_input` is front MAC temperature sensor. `temp2_input` is rear MAC +temperature sensor. + +There is docker-platform-monitor container installed lm-sensors package that can +monitor platform temperature. And `sensors` command can show each +temperature sensors status. + +### Power supplies + +Power supplies status and its EEPROM info can be used i2c utility +`/usr/sbin/i2c_utils.sh` to get. +The usage as follows: +``` +PSU EEPROM: + i2c_utils.sh i2c_psu_eeprom_get + hexdump -C psu0.rom + hexdump -C psu1.rom + +PSU Status: + i2c_utils.sh i2c_psu_status +``` + +### QSFPs +QSFP modules are managed by the pca9548 kernel driver. +The i2c utility `/usr/sbin/i2c_utils.sh` can be used to get status and +module EEPROM informations. +The usage as follows: +``` +QSFP EEPROM: + i2c_utils.sh i2c_qsfp_eeprom_get [1-32] + +QSFP Insert Event: + i2c_utils.sh i2c_qsfp_eeprom_get [1-32] + 0 => not insert + 1 => inserted +``` + diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/modules/Makefile b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/modules/Makefile new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/service/aurora-710-monitor.service b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/service/aurora-710-monitor.service new file mode 100644 index 000000000000..ac6ed5bae8c4 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/service/aurora-710-monitor.service @@ -0,0 +1,18 @@ +[Unit] +Description= This Platform Monitor service is to initialize platform and monitor platform. +Before=platform-monitor.service +After=sysinit.target +Wants=fancontrol.service +Wants=qsfp-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/sbin/i2c_init.sh +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/setup.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/setup.py new file mode 100644 index 000000000000..3f0e99b5bd21 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/setup.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='sonic_platform', + version='1.0', + description='Netberg Aurora 710 sonic platform API', + + packages=['sonic_platform'], + package_dir={'sonic_platform': 'sonic_platform'}, + + classifiers=[ + 'Development Status :: 3 - Beta', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], +) diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/__init__.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/__init__.py new file mode 100644 index 000000000000..d5f19f74f4c6 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp'] +from . import platform diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/chassis.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/chassis.py new file mode 100644 index 000000000000..e2128141012a --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/chassis.py @@ -0,0 +1,237 @@ +try: + import re + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.thermal import Thermal + from sonic_platform.component import Component + from sonic_platform.watchdog import Watchdog + from sonic_platform.event_monitor import EventMonitor +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" +PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" +monitor = None + + +class Chassis(ChassisBase): + + __num_of_fantrays = 4 + __num_of_psus = 2 + __num_of_sfps = 32 + __num_of_thermals = 12 + __num_of_components = 1 + + def __init__(self): + ChassisBase.__init__(self) + + # Initialize EEPROM + self._eeprom = Eeprom() + self._eeprom_data = self._eeprom.get_eeprom_data() + + # Initialize FAN + for index in range(self.__num_of_fantrays): + fandrawer = FanDrawer(index) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) + + # Initialize PSU + for index in range(self.__num_of_psus): + psu = Psu(index) + self._psu_list.append(psu) + self._fan_list.extend(psu._fan_list) + + # Initialize SFP + for index in range(self.__num_of_sfps): + sfp = Sfp(index) + self._sfp_list.append(sfp) + + # Initialize THERMAL + for index in range(self.__num_of_thermals): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize COMPONENT + for index in range(self.__num_of_components): + component = Component(index) + self._component_list.append(component) + + # Initialize WATCHDOG + self._watchdog = Watchdog() + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + +############################################## +# Device methods +############################################## + + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr(self._eeprom_data) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + description = 'None' + reboot_cause = self.REBOOT_CAUSE_HARDWARE_OTHER + + reboot_cause_path = PMON_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE + prev_reboot_cause_path = PMON_REBOOT_CAUSE_PATH + PREV_REBOOT_CAUSE_FILE + + sw_reboot_cause = self.__read_txt_file(reboot_cause_path) or "Unknown" + prev_sw_reboot_cause = self.__read_txt_file( + prev_reboot_cause_path) or "Unknown" + + if sw_reboot_cause == "Unknown" and prev_sw_reboot_cause in ("Unknown", self.REBOOT_CAUSE_POWER_LOSS): + reboot_cause = self.REBOOT_CAUSE_POWER_LOSS + description = prev_sw_reboot_cause + elif sw_reboot_cause != "Unknown": + reboot_cause = self.REBOOT_CAUSE_NON_HARDWARE + description = sw_reboot_cause + elif prev_reboot_cause_path != "Unknown": + reboot_cause = self.REBOOT_CAUSE_NON_HARDWARE + description = prev_sw_reboot_cause + + return (reboot_cause, description) + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + + Returns: + (bool, dict): + - True if call successful, False if not; + - A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, + where device_id is the device ID for this device and + device_event, + status='1' represents device inserted, + status='0' represents device removed. + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0'}} + indicates that fan 0 has been removed, fan 2 + has been inserted and sfp 11 has been removed. + """ + global monitor + port_dict = {} + while True: + with EventMonitor(timeout) as monitor: + while True: + event = monitor.get_events() + + if not bool(event): + return True, {'sfp': port_dict} + else: + if event['SUBSYSTEM'] == 'swps': + portname = event['DEVPATH'].split("/")[-1] + rc = re.match(r"port(?P\d+)", portname) + if rc is not None: + if event['ACTION'] == "remove": + remove_num = int(rc.group("num")) + port_dict[remove_num] = "0" + elif event['ACTION'] == "add": + add_num = int(rc.group("num")) + port_dict[add_num] = "1" + return True, {'sfp': port_dict} + return False, {'sfp': port_dict} + else: + pass diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/component.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/component.py new file mode 100644 index 000000000000..278317f553b0 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/component.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python + +try: + import os + import subprocess + import logging + from sonic_platform_base.component_base import ComponentBase + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +OS_SYSTEM_SUCCESS = 0 + +MAIN_BIOS_INDEX = 0 + +COMPONENT_NAME_LIST = [ + "Main BIOS", +] + +COMPONENT_DESC_LIST = [ + "Main BIOS", +] + + +class Component(ComponentBase): + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if not os.path.isfile(attr_path): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open file: %s", attr_path) + + retval = retval.rstrip(' \t\n\r') + return retval + + def __set_attr_value(self, attr_path, value): + try: + with open(attr_path, 'r+') as reg_file: + reg_file.write(value) + except IOError as e: + logging.error("Error: unable to open file: %s", str(e)) + return False + + return True + + def __get_bios_version(self): + """ + Retrieves the firmware version of the BIOS + Returns: + A string containing the firmware version of the BIOS + """ + try: + cmd = ['dmidecode', '-s', 'bios-version'] + if os.geteuid() != 0: + cmd.insert(0, 'sudo') + return subprocess.check_output(cmd).strip().decode() + except subprocess.CalledProcessError as e: + raise RuntimeError("Failed to get BIOS version") + + __get_version_callback_list = { + MAIN_BIOS_INDEX: __get_bios_version, + } + + def __init__(self, component_index): + self.index = component_index + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_NAME_LIST[self.index] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_DESC_LIST[self.index] + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + Returns: + A string containing the firmware version of the component + """ + return self.__get_version_callback_list[self.index](self) + + def install_firmware(self, image_path): + """ + Installs firmware to the component + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install was successful, False if not + """ + return self.__install_firmware_callback_list[self.index](self, image_path) diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/eeprom.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/eeprom.py new file mode 100644 index 000000000000..e3cf2b56be46 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/eeprom.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python + +try: + import sys + import re + if sys.version_info.major == 3: + from io import StringIO + else: + from cStringIO import StringIO + # from sonic_platform_base.sonic_eeprom import eeprom_dts + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + + EEPROM_DECODE_HEADLINES = 6 + + def __init__(self): + self._eeprom_path = "/sys/bus/i2c/devices/0-0055/eeprom" + super(Eeprom, self).__init__(self._eeprom_path, 0, '', True) + self._eeprom = self._load_eeprom() + + def __parse_output(self, decode_output): + decode_output.replace('\0', '') + lines = decode_output.split('\n') + lines = lines[self.EEPROM_DECODE_HEADLINES:] + _eeprom_info_dict = dict() + + for line in lines: + match = re.search( + r'(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + if match is not None: + idx = match.group(1) + value = match.group(3).rstrip('\0') + _eeprom_info_dict[idx] = value + return _eeprom_info_dict + + def _load_eeprom(self): + original_stdout = sys.stdout + sys.stdout = StringIO() + err = self.read_eeprom_db() + if err: + pass + else: + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + return self.__parse_output(decode_output) + + status = self.check_status() + if status < 'ok': + return {} + + data = self.read_eeprom() + if data is None: + return 0 + + self.decode_eeprom(data) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + + is_valid = self.is_checksum_valid(data) + if not is_valid: + return {} + + return self.__parse_output(decode_output) + + def get_eeprom(self): + return self._eeprom + + def serial_number_str(self): + """ + Returns the serial number + """ + return self._eeprom.get('0x23', "Undefined.") + + def base_mac_addr(self, ee): + """ + Returns the base mac address found in the system EEPROM + """ + return self._eeprom.get('0x24', "Undefined.") + + def modelstr(self): + """ + Returns the Model name + """ + return self._eeprom.get('0x28', "Undefined.") + + def part_number_str(self): + """ + Returns the part number + """ + return self._eeprom.get('0x22', "Undefined.") + + def revision_str(self): + """ + Returns the device revision + """ + return self._eeprom.get('0x26', "Undefined.") + + def serial_str(self): + return self._eeprom.get('0x2F', "Undefined.") + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self._eeprom + + def get_eeprom_data(self): + return self._eeprom diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/event_monitor.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/event_monitor.py new file mode 100644 index 000000000000..3b966023339e --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/event_monitor.py @@ -0,0 +1,95 @@ +# +# event_monitor.py +# Description: module to minitor events +# + +try: + import socket + from collections import OrderedDict + import os +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +NETLINK_KOBJECT_UEVENT = 15 + + +class EventMonitor: + + def __init__(self, timeout): + self.recieved_events = OrderedDict() + self.socket = socket.socket( + socket.AF_NETLINK, socket.SOCK_DGRAM, NETLINK_KOBJECT_UEVENT) + self.timeout = timeout + + def start(self): + self.socket.bind((os.getpid(), -1)) + + if self.timeout == 0: + self.socket.settimeout(None) + else: + self.socket.settimeout(self.timeout/1000.0) + + def stop(self): + self.socket.close() + + def __enter__(self): + self.start() + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.stop() + + def __iter__(self): + while True: + for item in self.next_events(): + yield item + + def next_events(self): + try: + data = self.socket.recv(16384) + event = {} + for item in data.split(b'\x00'): + if not item: + # check if we have an event and if we already received it + if event and event['SEQNUM'] not in self.recieved_events: + self.recieved_events[event['SEQNUM']] = None + if len(self.recieved_events) > 100: + self.recieved_events.popitem(last=False) + yield event + event = {} + else: + try: + k, v = item.split(b'=', 1) + event[k.decode('ascii')] = v.decode('ascii') + except ValueError: + pass + except socket.timeout: + yield event + + def get_events(self): + event = {} + while True: + try: + data = self.socket.recv(16384) + + for item in data.split(b'\x00'): + if not item: + # check if we have an event and if we already received it + # if no item and event empty, means received garbled + if bool(event): + if event['SEQNUM'] not in self.recieved_events: + self.recieved_events[event['SEQNUM']] = None + if len(self.recieved_events) > 100: + self.recieved_events.popitem(last=False) + return event + else: + event = {} + else: + try: + k, v = item.split(b'=', 1) + event[k] = v + except ValueError: + pass + except socket.timeout: + return event diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan.py new file mode 100644 index 000000000000..42da0454aee6 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python +# +# Name: fan.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +MAX_FAN_RPM = 22000 +MAX_PSU_FAN_RPM = 18000 + +MAX_PWM_OF_FAN = 255 + + +FAN_SYS_FS = "/sys/class/hwmon/hwmon1/device/fan{}_input" +FAN_ALARM_SYS_FS = "/sys/class/hwmon/hwmon1/device/fan{}_alarm" + +PSU_FAN_SYS_FS = "/sys/class/hwmon/hwmon{}/fan1_input" +PSU_FAN_ALARM_SYS_FS = "/sys/class/hwmon/hwmon{}/fan1_alarm" + + +logger = Logger('sonic-platform-fan') + + +class Fan(FanBase): + + def __init__(self, index, psu_fan=False): + self.__psu_fan = psu_fan + + if psu_fan: + self.__index = index + self.__rpm = PSU_FAN_SYS_FS.format(8 + self.__index) + self.__alarm = PSU_FAN_ALARM_SYS_FS.format(8 + self.__index) + else: + self.__index = 8 - index + self.__rpm = FAN_SYS_FS.format(self.__index) + self.__alarm = FAN_ALARM_SYS_FS.format(self.__index) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if not os.path.isfile(attr_path): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open file: %s", attr_path) + + retval = retval.rstrip(' \t\n\r') + return retval + + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "FAN{}".format(self.__index) if not self.__psu_fan else "PSU{}_FAN".format(self.__index+1) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + return self.get_status() + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + + rv = self.__get_attr_value(self.__alarm) + if rv != 'ERR': + if rv == '0': + status = True + else: + raise SyntaxError + + return status + + def is_replaceable(self): + """ + Indicate whether Fan is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_position_in_parent(self): + return self.__index + + +############################################## +# FAN methods +############################################## + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + return 'N/A' + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + speed = 44 + rv = self.__get_attr_value(self.__rpm) + + if rv != 'ERR': + speed = int( + rv) * 100 // (MAX_PSU_FAN_RPM if self.__psu_fan else MAX_FAN_RPM) + + return speed + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed() + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + raise NotImplementedError + + def set_speed(self, speed): + """ + Sets the fan speed + + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + + Returns: + A boolean, True if speed is set successfully, False if not + """ + return False + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return False + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan_drawer.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..25006dd92c80 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/fan_drawer.py @@ -0,0 +1,23 @@ +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + """ Platform-specific Fan class""" + + def __init__(self, fantray_index): + FanDrawerBase.__init__(self) + self.fantray_index = fantray_index + self._fan_list.append(Fan(2 * fantray_index)) + self._fan_list.append(Fan(2 * fantray_index + 1)) + + def get_name(self): + """ + Retrieves the fan drawer name + Returns: + string: The name of the device + """ + return "FanTray{}".format(self.fantray_index+1) diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/platform.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/platform.py new file mode 100644 index 000000000000..a2ffe0a47e78 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/psu.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/psu.py new file mode 100644 index 000000000000..dd89a86339c9 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/psu.py @@ -0,0 +1,327 @@ +try: + from sonic_platform_base.psu_base import PsuBase + from sonic_py_common.logger import Logger + from sonic_platform.fan import Fan + import subprocess +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +VOLTAGE_HIGH_THRESHOLD = 13.4 +VOLTAGE_LOW_THRESHOLD = 10.2 +TEMPERATURE_HIGH_THRESHOLD = 70.0 +MAX_SUPPLIED_POWER = 550.0 + +GPIO_OFFSET = 9984 + +PSU_SYS_FS = "/sys/class/hwmon/hwmon{}/" + +PSU_EXIST_INPOWER = "/sys/class/gpio/gpio{}/value" + +PSU_EEPROM = "/sys/bus/i2c/devices/{}-0050/eeprom" + +logger = Logger('sonic-platform-psu') + + +class Psu(PsuBase): + + __name_of_psus = ['PSU1', 'PSU2'] + + def __init__(self, index): + PsuBase.__init__(self) + + self.__index = index + + # Presence: PSU1: GPIO_OFFSET+100; PSU2: GPIO_OFFSET+97 + self.__psu_presence_attr = PSU_EXIST_INPOWER.format( + GPIO_OFFSET + 100 - 3 * self.__index) + + # Powerstatus: PSU1: GPIO_OFFSET+99; PSU2: GPIO_OFFSET+96 + self.__psu_inpower_status_attr = PSU_EXIST_INPOWER.format( + GPIO_OFFSET + 99 - 3 * self.__index) + + psun_sys_fs = PSU_SYS_FS.format(8 + self.__index) + + # /sys/bus/i2c/devices/i2c-57/57-0058/hwmon/hwmon8/in2_input + self.__psu_voltage_out_attr = psun_sys_fs + "in2_input" + + # /sys/bus/i2c/devices/i2c-57/57-0058/hwmon/hwmon8/curr2_input + self.__psu_current_out_attr = psun_sys_fs + "curr2_input" + + # /sys/bus/i2c/devices/i2c-57/57-0058/hwmon/hwmon8/power2_input + self.__psu_power_out_attr = psun_sys_fs + "power2_input" + + # /sys/bus/i2c/devices/i2c-57/57-0058/hwmon/hwmon8/temp2_input + self.__psu_temperature_attr = psun_sys_fs + "temp2_input" + + self.__psu_eeprom_attr = PSU_EEPROM.format(57 + index) + + self._fan_list.append(Fan(index=self.__index, psu_fan=True)) + + def __eeprom_read_bytes(self, start, end): + try: + val = open(self.__psu_eeprom_attr, "rb").read()[start:end] + except Exception: + val = None + return val.decode('ascii') + + def __get_attr_value(self, filepath): + try: + with open(filepath, 'r') as fd: + # text + data = fd.readlines() + return data[0].rstrip('\r\n') + except FileNotFoundError: + logger.log_error(f"File {filepath} not found. Aborting") + except (OSError, IOError) as ex: + logger.log_error("Cannot open - {}: {}".format(filepath, repr(ex))) + + return 'ERR' +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return self.__name_of_psus[self.__index] + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = self.__psu_presence_attr + + attr_rv = self.__get_attr_value(attr_path) + if attr_rv != 'ERR': + if attr_rv == "1": + presence = True + else: + raise SyntaxError + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + return self.__eeprom_read_bytes(22, 34) + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + return self.__eeprom_read_bytes(50, 61) + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return self.__eeprom_read_bytes(46, 48) + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + inpower = False + attr_rv = self.__get_attr_value(self.__psu_inpower_status_attr) + if attr_rv != 'ERR': + if attr_rv == "1": + inpower = True + + return self.get_presence() and inpower + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + attr_path = self.__psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if attr_rv != 'ERR': + voltage_out = float(attr_rv) / 1000 + else: + raise SyntaxError + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + attr_path = self.__psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if attr_rv != 'ERR': + current_out = float(attr_rv) / 1000 + else: + raise SyntaxError + + return current_out + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + attr_path = self.__psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if attr_rv != 'ERR': + power_out = float(attr_rv) / 1000000 + else: + raise SyntaxError + + return power_out + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_rv = self.__get_attr_value(self.__psu_temperature_attr) + if attr_rv != 'ERR': + temperature = float(attr_rv) / 1000 + else: + raise SyntaxError + + return temperature + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + powergood_status = False + voltage_out = self.get_voltage() + + # Check the voltage out with 12V, plus or minus 20 percentage. + if self.get_voltage_low_threshold() <= voltage_out <= self.get_voltage_high_threshold(): + powergood_status = True + + return powergood_status + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + return VOLTAGE_HIGH_THRESHOLD + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + return VOLTAGE_LOW_THRESHOLD + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return TEMPERATURE_HIGH_THRESHOLD + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return MAX_SUPPLIED_POWER + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + + Args: + color: A string representing the color with which to set the + PSU status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + value = 0 + # PSU1: mask = 8 + # PSU2: mask = 16 + mask = 8 + 8 * self.__index + + if color == self.STATUS_LED_COLOR_GREEN: + value = 0x00 + elif color == self.STATUS_LED_COLOR_AMBER: + value = 0xFF + else: + logger.log_error( + "Invalid Parameters. LED Color {} doesn't support".format(color)) + return False + + ret_val, log = subprocess.getstatusoutput( + "i2cset -m {} -y -r 50 0x75 2 {}".format(mask, value)) + + if ret_val != 0: + logger.log_error("Unable set PSU{} color with following i2cset output {} ".format( + self.__index + 1, log)) + return False + + return True + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + raise NotImplementedError diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/sfp.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/sfp.py new file mode 100644 index 000000000000..bb42dea1e080 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/sfp.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python + +try: + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from sonic_py_common.logger import Logger + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" +QSFP_DD_TYPE = "QSFP_DD" + +GPIO_OFFSET = 9984 +GPIO_VALUE = "/sys/class/gpio/gpio{}/value" +EEPROM_PATH = "/sys/bus/i2c/devices/{}-0050/eeprom" + +logger = Logger('sonic-platform-sfp') + +class Sfp(SfpOptoeBase): + """ + BFN Platform-specific SFP class + """ + + def __init__(self, port_num): + SfpOptoeBase.__init__(self) + self.index = port_num + self.port_num = port_num + self.sfp_type = QSFP_TYPE + + self.eeprom_path = EEPROM_PATH.format(9 + (port_num ^ 1)) + # print(self.eeprom_path) + + def __get_attr_value(self, filepath): + try: + with open(filepath, 'r') as fd: + # text + data = fd.readlines() + return data[0].rstrip('\r\n') + except FileNotFoundError: + logger.log_error(f"File {filepath} not found. Aborting") + except (OSError, IOError) as ex: + logger.log_error("Cannot open - {}: {}".format(filepath, repr(ex))) + + return 'ERR' + + def get_presence(self): + """ + Retrieves the presence of the sfp + """ + presence = False + + gpio = GPIO_OFFSET + 224 + (16 if self.index < 16 else - 16) + attr_rv = self.__get_attr_value( + GPIO_VALUE.format(gpio + (self.index) ^ 1)) + if attr_rv != 'ERR': + if attr_rv == "1": + presence = True + else: + raise SyntaxError + + return presence + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + """ + lpmode = False + gpio = GPIO_OFFSET + 160 + (16 if self.index < 16 else - 16) + attr_rv = self.__get_attr_value( + GPIO_VALUE.format(gpio + (self.index) ^ 1)) + if attr_rv != 'ERR': + if attr_rv == "1": + lpmode = True + else: + raise SyntaxError + + return lpmode + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + """ + return False + + def get_eeprom_path(self): + return self.eeprom_path + + def write_eeprom(self, offset, num_bytes, write_buffer): + # Not supported at the moment + return False + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return "sfp{}".format(self.index) + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + """ + status = False + gpio = GPIO_OFFSET + 128 + (16 if self.index < 16 else - 16) + attr_rv = self.__get_attr_value( + GPIO_VALUE.format(gpio + (self.index) ^ 1)) + if attr_rv != 'ERR': + if attr_rv == "1": + status = True + else: + raise SyntaxError + + return status + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + """ + return False + + def get_status(self): + """ + Retrieves the operational status of the device + """ + reset = self.get_reset_status() + + if reset: + status = False + else: + status = True + + return status + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + return self.SFP_STATUS_OK + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.sfp_type == QSFP_TYPE: + return self.tx_disable_channel(0xF, tx_disable) + return False + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + + Returns: + A boolean, True if successful, False if not + """ + return False + + def get_power_override(self): + return False + + def set_power_override(self, power_override, power_set): + return False diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/thermal.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/thermal.py new file mode 100644 index 000000000000..514ff2da0d65 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/thermal.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python +# +# Name: thermal.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import os + import logging + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + + __core_temp_path = "/sys/devices/platform/coretemp.0/hwmon/hwmon0/temp{}_{}" + __switch_thermal_path = "/sys/class/hwmon/hwmon{}/temp{}_{}" + __name_of_thermal = [ + "Core 0", + "Core 1", + "Core 2", + "Core 3", + "Core 4", + "Front MAC", + "ASIC Core", + "CPU Board", + "Near PSU1", + "Rear MAC", + "Near Port 32", + "Near PSU2" + ] + __thermal_path_list = [ + __core_temp_path.format(1, "input"), + __core_temp_path.format(2, "input"), + __core_temp_path.format(3, "input"), + __core_temp_path.format(4, "input"), + __core_temp_path.format(5, "input"), + __switch_thermal_path.format(2, 1, "input"), + __switch_thermal_path.format(2, 2, "input"), + __switch_thermal_path.format(3, 1, "input"), + __switch_thermal_path.format(4, 1, "input"), + __switch_thermal_path.format(5, 1, "input"), + __switch_thermal_path.format(6, 1, "input"), + __switch_thermal_path.format(7, 1, "input") + ] + __max_temp_path_list = [ + __core_temp_path.format(1, "max"), + __core_temp_path.format(2, "max"), + __core_temp_path.format(3, "max"), + __core_temp_path.format(4, "max"), + __core_temp_path.format(5, "max"), + __switch_thermal_path.format(2, 1, "max"), + __switch_thermal_path.format(2, 2, "max"), + __switch_thermal_path.format(3, 1, "max"), + __switch_thermal_path.format(4, 1, "max"), + __switch_thermal_path.format(5, 1, "max"), + __switch_thermal_path.format(6, 1, "max"), + __switch_thermal_path.format(7, 1, "max") + ] + + def __init__(self, index): + self.__index = index + + self.__thermal_temp_attr = self.__thermal_path_list[self.__index] + self.__max_temp_attr = self.__max_temp_path_list[self.__index] + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if not os.path.isfile(attr_path): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except FileNotFoundError: + logging.error("File %s not found. Aborting", attr_path) + except (OSError, IOError) as ex: + logging.error("Cannot open - %s: %s", attr_path, repr(ex)) + + retval = retval.rstrip(' \t\n\r') + return retval + + +############################################## +# Device methods +############################################## + + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return self.__name_of_thermal[self.__index] + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = self.__thermal_temp_attr + return os.path.isfile(attr_path) + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + raise NotImplementedError + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + raise NotImplementedError + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + if self.get_presence(): + status = True + + return status + +############################################## +# THERMAL methods +############################################## + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = self.__thermal_temp_attr + + attr_rv = self.__get_attr_value(attr_path) + if attr_rv != 'ERR': + temperature = float(attr_rv) / 1000 + else: + raise SyntaxError + + return temperature + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = self.__max_temp_attr + + if attr_path == '': + raise NotImplementedError + else: + attr_rv = self.__get_attr_value(attr_path) + if attr_rv != 'ERR': + high_threshold = float(attr_rv) / 1000 + else: + raise SyntaxError + + return high_threshold + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature of thermal + + Returns: + A float number, the low threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + raise NotImplementedError + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + + Returns: + A boolean, True if threshold is set successfully, False if not + """ + raise NotImplementedError + + def set_low_threshold(self, temperature): + """ + Sets the low threshold temperature of thermal + + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + + Returns: + A boolean, True if threshold is set successfully, False if not + """ + raise NotImplementedError diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/watchdog.py b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/watchdog.py new file mode 100644 index 000000000000..e3df1b3f8614 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/sonic_platform/watchdog.py @@ -0,0 +1,251 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Watchdog information +# +############################################################################# + +import fcntl +import os +import array + +try: + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +""" ioctl constants """ +IO_WRITE = 0x40000000 +IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 +IO_SIZE_INT = 0x00040000 +IO_SIZE_40 = 0x00280000 +IO_TYPE_WATCHDOG = ord('W') << 8 + +WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG + +""" Watchdog ioctl commands """ +WDIOC_GETSUPPORT = 0 | WDR_40 +WDIOC_GETSTATUS = 1 | WDR_INT +WDIOC_GETBOOTSTATUS = 2 | WDR_INT +WDIOC_GETTEMP = 3 | WDR_INT +WDIOC_SETOPTIONS = 4 | WDR_INT +WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT +WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT + +""" Watchdog status constants """ +WDIOS_DISABLECARD = 0x0001 +WDIOS_ENABLECARD = 0x0002 + +WDT_COMMON_ERROR = -1 +WD_MAIN_IDENTITY = "iTCO_wdt" +WDT_SYSFS_PATH = "/sys/class/watchdog/" + + +class Watchdog(WatchdogBase): + + def __init__(self): + + self.watchdog = None + self.armed = False + + def _is_wd_main(self, dev): + """ + Checks watchdog identity + """ + identity = self._read_file( + "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) + return identity == WD_MAIN_IDENTITY + + def _get_wdt(self): + """ + Retrieves watchdog device + """ + wdt_main_dev_list = [dev for dev in os.listdir( + "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] + if not wdt_main_dev_list: + return None + wdt_main_dev_name = wdt_main_dev_list[0] + watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) + try: + watchdog = os.open(watchdog_device_path, os.O_RDWR) + except (FileNotFoundError, IOError, OSError): + watchdog = None + except SystemExit: + pass + + return watchdog, wdt_main_dev_name + + def _read_file(self, file_path): + """ + Read text file + """ + try: + with open(file_path, "r") as fd: + txt = fd.read() + except IOError: + return WDT_COMMON_ERROR + return txt.strip() + + def _enable(self): + """ + Turn on the watchdog timer + """ + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _disable(self): + """ + Turn off the watchdog timer + """ + if self.watchdog is None: + return WDT_COMMON_ERROR + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): + """ + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout + """ + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + return int(req[0]) + + def _gettimeout(self, timeout_path): + """ + Get watchdog timeout + @return watchdog timeout + """ + if self.watchdog is None: + return WDT_COMMON_ERROR + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + + return int(req[0]) + + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + + def _set_arm(self): + self.watchdog, self.wdt_main_dev_name = self._get_wdt() + self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name + self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name + self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name + # Set default value + self._disable() + self.timeout = self._gettimeout(self.timeout_path) + + ################################################################# + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* available + value. + Returns: + An integer specifying the *actual* number of seconds the watchdog + was armed with. On failure returns -1. + """ + if self.watchdog is None: + self._set_arm() + + ret = WDT_COMMON_ERROR + if seconds < 0 or self.watchdog is None: + return ret + + try: + if self.timeout != seconds: + self.timeout = self._settimeout(seconds) + if self.armed: + self._keepalive() + else: + self._enable() + self.armed = True + ret = self.timeout + except IOError as e: + pass + + return ret + + def disarm(self): + """ + Disarm the hardware watchdog + Returns: + A boolean, True if watchdog is disarmed successfully, False if not + """ + disarmed = False + if self.watchdog is None: + return disarmed + + if self.is_armed(): + try: + self._disable() + self.armed = False + disarmed = True + except IOError: + pass + + return disarmed + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + Returns: + A boolean, True if watchdog is armed, False if not + """ + + return self.armed + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds remaining on + the watchdog timer + Returns: + An integer specifying the number of seconds remaining on thei + watchdog timer. If the watchdog is not armed, returns -1. + """ + + timeleft = WDT_COMMON_ERROR + if self.watchdog is None: + return WDT_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft + + def __del__(self): + """ + Close watchdog + """ + if self.watchdog is not None: + os.close(self.watchdog) diff --git a/platform/barefoot/sonic-platform-modules-netberg/aurora-710/utils/i2c_init.sh b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/utils/i2c_init.sh new file mode 100755 index 000000000000..52576eac3f6d --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/aurora-710/utils/i2c_init.sh @@ -0,0 +1,404 @@ +#!/bin/bash + +# vdd value for mac +rov_val_array=( 0.85 0.82 0.77 0.87 0.74 0.84 0.79 0.89 ) +rov_reg_array=( 0x24 0x21 0x1c 0x26 0x19 0x23 0x1e 0x28 ) + +#GPIO Offset +GPIO_OFFSET=0 + +function _set_gpio_offset { + GPIO_OFFSET=0 + gpio_base_max=`cat /sys/class/gpio/gpiochip*/base | sort -n | tail -1` + GPIO_OFFSET=$(($gpio_base_max - 240)) + echo "set GPIO_OFFSET=${GPIO_OFFSET}" +} + +#GPIO Init +function i2c_gpio_init { + local i=0 + #ABS Port 0-15 + echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-5/new_device + _set_gpio_offset + #for i in {240..255}; + for((i=${GPIO_OFFSET}+240;i<=${GPIO_OFFSET}+255;i++)); + do + echo $i > /sys/class/gpio/export + echo 1 > /sys/class/gpio/gpio${i}/active_low + done + + #ABS Port 16-31 + echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-5/new_device + #for i in {224..239}; + for((i=${GPIO_OFFSET}+224;i<=${GPIO_OFFSET}+239;i++)); + do + echo $i > /sys/class/gpio/export + echo 1 > /sys/class/gpio/gpio${i}/active_low + done + + #INT Port 0-15 + echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-5/new_device + #for i in {208..223}; + for((i=${GPIO_OFFSET}+208;i<=${GPIO_OFFSET}+223;i++)); + do + echo $i > /sys/class/gpio/export + echo 1 > /sys/class/gpio/gpio${i}/active_low + done + + #INT Port 16-31 + echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-5/new_device + #for i in {192..207}; + for((i=${GPIO_OFFSET}+192;i<=${GPIO_OFFSET}+207;i++)); + do + echo $i > /sys/class/gpio/export + echo 1 > /sys/class/gpio/gpio${i}/active_low + done + + #SFP+ + echo "pca9535 0x27" > /sys/bus/i2c/devices/i2c-5/new_device + #for i in {176..191}; + for((i=${GPIO_OFFSET}+176;i<=${GPIO_OFFSET}+191;i++)); + do + echo $i > /sys/class/gpio/export + case ${i} in + #176|177|178|179|182|183|188|189|190|191) + $((${GPIO_OFFSET}+176)) | \ + $((${GPIO_OFFSET}+177)) | \ + $((${GPIO_OFFSET}+178)) | \ + $((${GPIO_OFFSET}+179)) | \ + $((${GPIO_OFFSET}+182)) | \ + $((${GPIO_OFFSET}+183)) | \ + $((${GPIO_OFFSET}+188)) | \ + $((${GPIO_OFFSET}+189)) | \ + $((${GPIO_OFFSET}+190)) | \ + $((${GPIO_OFFSET}+191)) ) + echo 1 > /sys/class/gpio/gpio${i}/active_low + ;; + #180|181|184|185|186|187) + $((${GPIO_OFFSET}+180)) | \ + $((${GPIO_OFFSET}+181)) | \ + $((${GPIO_OFFSET}+184)) | \ + $((${GPIO_OFFSET}+185)) | \ + $((${GPIO_OFFSET}+186)) | \ + $((${GPIO_OFFSET}+187)) ) + echo out > /sys/class/gpio/gpio${i}/direction + ;; + esac + + done + + #LP Mode Port 0-15 + echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-6/new_device + #for i in {160..175}; + for((i=${GPIO_OFFSET}+160;i<=${GPIO_OFFSET}+175;i++)); + do + echo $i > /sys/class/gpio/export + echo out > /sys/class/gpio/gpio${i}/direction + done + + #LP Mode Port 16-31 + echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-6/new_device + #for i in {144..159}; + for((i=${GPIO_OFFSET}+144;i<=${GPIO_OFFSET}+159;i++)); + do + echo $i > /sys/class/gpio/export + echo out > /sys/class/gpio/gpio${i}/direction + done + + #RST Port 0-15 + echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-6/new_device + #for i in {128..143}; + for((i=${GPIO_OFFSET}+128;i<=${GPIO_OFFSET}+143;i++)); + do + echo $i > /sys/class/gpio/export + echo 1 > /sys/class/gpio/gpio${i}/active_low + echo low > /sys/class/gpio/gpio${i}/direction + done + + #RST Port 16-31 + echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-6/new_device + #for i in {112..127}; + for((i=${GPIO_OFFSET}+112;i<=${GPIO_OFFSET}+127;i++)); + do + echo $i > /sys/class/gpio/export + echo 1 > /sys/class/gpio/gpio${i}/active_low + echo low > /sys/class/gpio/gpio${i}/direction + #echo out > /sys/class/gpio/gpio${i}/direction + #echo 0 > /sys/class/gpio/gpio${i}/value + done + + #PSU I/O on Dummy Board 0x25 + echo "pca9535 0x25" > /sys/bus/i2c/devices/i2c-0/new_device + #for i in {96..111}; + for((i=${GPIO_OFFSET}+96;i<=${GPIO_OFFSET}+111;i++)); + do + echo $i > /sys/class/gpio/export + case ${i} in + #97|98|100|101|102|105|106|108) + $((${GPIO_OFFSET}+97)) | \ + $((${GPIO_OFFSET}+98)) | \ + $((${GPIO_OFFSET}+100)) | \ + $((${GPIO_OFFSET}+101)) | \ + $((${GPIO_OFFSET}+102)) | \ + $((${GPIO_OFFSET}+105)) | \ + $((${GPIO_OFFSET}+106)) | \ + $((${GPIO_OFFSET}+108)) ) + echo 1 > /sys/class/gpio/gpio${i}/active_low + ;; + #98|101|106|107|108) + $((${GPIO_OFFSET}+98)) | \ + $((${GPIO_OFFSET}+101)) | \ + $((${GPIO_OFFSET}+106)) | \ + $((${GPIO_OFFSET}+107)) | \ + $((${GPIO_OFFSET}+108)) ) + echo out > /sys/class/gpio/gpio${i}/direction + ;; + esac + done +} + +#IO Expander Init +function _i2c_io_exp_init { + # Reset BMC Dummy Board + i2cset -y -r 0 0x26 4 0x00 + i2cset -y -r 0 0x26 5 0x00 + i2cset -y -r 0 0x26 2 0x3F + i2cset -y -r 0 0x26 3 0x1F + i2cset -y -r 0 0x26 6 0xC0 + i2cset -y -r 0 0x26 7 0x00 + + # CPU Board + i2cset -y -r 0 0x77 6 0xFF + i2cset -y -r 0 0x77 7 0xFF + + # init SMBUS1 ABS + i2cset -y -r 5 0x20 4 0x00 + i2cset -y -r 5 0x20 5 0x00 + i2cset -y -r 5 0x20 6 0xFF + i2cset -y -r 5 0x20 7 0xFF + + i2cset -y -r 5 0x21 4 0x00 + i2cset -y -r 5 0x21 5 0x00 + i2cset -y -r 5 0x21 6 0xFF + i2cset -y -r 5 0x21 7 0xFF + + i2cset -y -r 5 0x22 4 0x00 + i2cset -y -r 5 0x22 5 0x00 + i2cset -y -r 5 0x22 6 0xFF + i2cset -y -r 5 0x22 7 0xFF + + i2cset -y -r 5 0x23 4 0x00 + i2cset -y -r 5 0x23 5 0x00 + i2cset -y -r 5 0x23 2 0xCF + i2cset -y -r 5 0x23 3 0xF0 + i2cset -y -r 5 0x23 6 0xCF + i2cset -y -r 5 0x23 7 0xF0 + + # init SFP + i2cset -y -r 5 0x27 4 0x00 + i2cset -y -r 5 0x27 5 0x00 + i2cset -y -r 5 0x27 2 0x00 + i2cset -y -r 5 0x27 3 0x00 + i2cset -y -r 5 0x27 6 0xCF + i2cset -y -r 5 0x27 7 0xF0 + + # set ZQSFP LP_MODE = 0 + i2cset -y -r 6 0x20 4 0x00 + i2cset -y -r 6 0x20 5 0x00 + i2cset -y -r 6 0x20 2 0x00 + i2cset -y -r 6 0x20 3 0x00 + i2cset -y -r 6 0x20 6 0x00 + i2cset -y -r 6 0x20 7 0x00 + + i2cset -y -r 6 0x21 4 0x00 + i2cset -y -r 6 0x21 5 0x00 + i2cset -y -r 6 0x21 2 0x00 + i2cset -y -r 6 0x21 3 0x00 + i2cset -y -r 6 0x21 6 0x00 + i2cset -y -r 6 0x21 7 0x00 + + # set ZQSFP RST = 1 + i2cset -y -r 6 0x22 4 0x00 + i2cset -y -r 6 0x22 5 0x00 + i2cset -y -r 6 0x22 2 0xFF + i2cset -y -r 6 0x22 3 0xFF + i2cset -y -r 6 0x22 6 0x00 + i2cset -y -r 6 0x22 7 0x00 + + i2cset -y -r 6 0x23 4 0x00 + i2cset -y -r 6 0x23 5 0x00 + i2cset -y -r 6 0x23 2 0xFF + i2cset -y -r 6 0x23 3 0xFF + i2cset -y -r 6 0x23 6 0x00 + i2cset -y -r 6 0x23 7 0x00 + + # init Host GPIO + i2cset -y -r 0 0x74 4 0x00 + i2cset -y -r 0 0x74 5 0x00 + i2cset -y -r 0 0x74 2 0x0F + i2cset -y -r 0 0x74 3 0xDF + i2cset -y -r 0 0x74 6 0x08 + i2cset -y -r 0 0x74 7 0x1F + + # init Board ID + i2cset -y -r 51 0x27 4 0x00 + i2cset -y -r 51 0x27 5 0x00 + i2cset -y -r 51 0x27 6 0xFF + i2cset -y -r 51 0x27 7 0xFF + + # init Board ID of Dummy BMC Board + i2cset -y -r 0 0x24 4 0x00 + i2cset -y -r 0 0x24 5 0x00 + i2cset -y -r 0 0x24 6 0xFF + i2cset -y -r 0 0x24 7 0xFF + + # init PSU I/O (BAREFOOT_IO_EXP_PSU_ID) + i2cset -y -r 0 0x25 4 0x00 + i2cset -y -r 0 0x25 5 0x00 + i2cset -y -r 0 0x25 2 0x00 + i2cset -y -r 0 0x25 3 0x1D + i2cset -y -r 0 0x25 6 0xDB + i2cset -y -r 0 0x25 7 0x03 + + # init FAN I/O (BAREFOOT_IO_EXP_FAN_ID) + i2cset -y -r 59 0x20 4 0x00 + i2cset -y -r 59 0x20 5 0x00 + i2cset -y -r 59 0x20 2 0x11 + i2cset -y -r 59 0x20 3 0x11 + i2cset -y -r 59 0x20 6 0xCC + i2cset -y -r 59 0x20 7 0xCC + + # init Fan + # select bank 0 + i2cset -y -r 56 0x2F 0x00 0x80 + + # enable FANIN 1-8 + i2cset -y -r 56 0x2F 0x06 0xFF + + # disable FANIN 9-14 + i2cset -y -r 56 0x2F 0x07 0x00 + + # select bank 2 + i2cset -y -r 56 0x2F 0x00 0x82 + + # set PWM mode in FOMC + i2cset -y -r 56 0x2F 0x0F 0x00 + + # init VOLMON + i2cset -y -r 56 0x2F 0x00 0x80 + i2cset -y -r 56 0x2F 0x01 0x1C + i2cset -y -r 56 0x2F 0x00 0x80 + i2cset -y -r 56 0x2F 0x02 0xFF + i2cset -y -r 56 0x2F 0x03 0x50 + i2cset -y -r 56 0x2F 0x04 0x0A + i2cset -y -r 56 0x2F 0x00 0x80 + i2cset -y -r 56 0x2F 0x01 0x1D +} + +function mac_vdd_init { + # read mac vid register value from CPLD + val=`i2cget -y 44 0x33 0x42 2>/dev/null` + + # get vid form register value [0:2] + vid=$(($val & 0x7)) + + # get rov val and reg according to vid + rov_val=${rov_val_array[$vid]} + rov_reg=${rov_reg_array[$vid]} + echo "vid=${vid}, rov_val=${rov_val}, rov_reg=${rov_reg}" + + # write the rov reg to rov + i2cset -y -r 8 0x22 0x21 ${rov_reg} w + + if [ $? -eq 0 ]; then + echo "set ROV for mac vdd done" + else + echo "set ROV for mac vdd fail" + fi +} + +rmmod i2c_i801 +modprobe i2c_i801 +modprobe i2c_dev +modprobe i2c_mux_pca954x + +echo 'pca9548 0x70' > /sys/bus/i2c/devices/i2c-0/new_device +#todo: switch to channels +echo 'pca9548 0x71' > /sys/bus/i2c/devices/i2c-1/new_device +echo 'pca9548 0x71' > /sys/bus/i2c/devices/i2c-2/new_device +echo 'pca9548 0x71' > /sys/bus/i2c/devices/i2c-3/new_device +echo 'pca9548 0x71' > /sys/bus/i2c/devices/i2c-4/new_device +echo 'pca9548 0x71' > /sys/bus/i2c/devices/i2c-7/new_device +echo 'pca9548 0x76' > /sys/bus/i2c/devices/i2c-0/new_device +echo 'pca9545 0x72' > /sys/bus/i2c/devices/i2c-0/new_device + + +echo '-2' > /sys/bus/i2c/devices/0-0070/idle_state +echo '-2' > /sys/bus/i2c/devices/1-0071/idle_state +echo '-2' > /sys/bus/i2c/devices/2-0071/idle_state +echo '-2' > /sys/bus/i2c/devices/3-0071/idle_state +echo '-2' > /sys/bus/i2c/devices/4-0071/idle_state +echo '-2' > /sys/bus/i2c/devices/7-0071/idle_state +echo '-2' > /sys/bus/i2c/devices/0-0076/idle_state +echo '-2' > /sys/bus/i2c/devices/0-0072/idle_state + + + +# i2cget -y 44 0x74 2 + +_i2c_io_exp_init + +echo 'w83795adg 0x2F' > /sys/bus/i2c/devices/i2c-56/new_device + +sleep 1 + +echo 120 > /sys/class/hwmon/hwmon1/device/pwm1 +echo 120 > /sys/class/hwmon/hwmon1/device/pwm2 + +#TMP75 Init +echo "lm86 0x4c" > /sys/bus/i2c/devices/i2c-53/new_device # ASIC Coretemp and Front MAC +echo "tmp75 0x4f" > /sys/bus/i2c/devices/i2c-0/new_device #CPU Board +echo "tmp75 0x48" > /sys/bus/i2c/devices/i2c-53/new_device # Near PSU1 +echo "tmp75 0x4a" > /sys/bus/i2c/devices/i2c-53/new_device # Rear MAC +echo "tmp75 0x4b" > /sys/bus/i2c/devices/i2c-53/new_device # Near Port 32 +echo "tmp75 0x4d" > /sys/bus/i2c/devices/i2c-53/new_device # Near PSU2 + + + +rmmod gpio-pca953x +rmmod gpio_ich + +modprobe gpio-pca953x +sleep 1 + +i2c_gpio_init + +modprobe at24 + +#Init MB EEPROM +echo "24c32 0x55" > /sys/bus/i2c/devices/i2c-0/new_device + +# modprobe eeprom +# PS EEPROM +echo "spd 0x50" > /sys/bus/i2c/devices/i2c-58/new_device #PS0 +echo "spd 0x50" > /sys/bus/i2c/devices/i2c-57/new_device #PS1 + +#modprobe pmbus + +# PS PMBUS +echo "pmbus 0x58" > /sys/bus/i2c/devices/i2c-58/new_device #PS0 +echo "pmbus 0x58" > /sys/bus/i2c/devices/i2c-57/new_device #PS1 + +#QSFP EEPROM +modprobe optoe +for i in {9..40}; +do + echo "optoe1 0x50" > /sys/bus/i2c/devices/i2c-$i/new_device +done + +# init SFP0/1 EEPROM +echo "optoe2 0x50" > /sys/bus/i2c/devices/i2c-45/new_device +echo "optoe2 0x50" > /sys/bus/i2c/devices/i2c-46/new_device + +mac_vdd_init + diff --git a/platform/barefoot/sonic-platform-modules-netberg/debian/changelog b/platform/barefoot/sonic-platform-modules-netberg/debian/changelog index 9948453bcf78..f88da8ffc3d4 100644 --- a/platform/barefoot/sonic-platform-modules-netberg/debian/changelog +++ b/platform/barefoot/sonic-platform-modules-netberg/debian/changelog @@ -1,12 +1,17 @@ +platform-driver (1.1.1) unstable; urgency=low + + * Add support for Aurora 710 + + -- developer Fri, 26 Aug 2022 11:00:00 +0800 + platform-driver (1.1.0) unstable; urgency=low * Add support for Aurora 610 - -- developer Fri, 26 May 2017 11:00:00 +0800 + -- developer Fri, 26 May 2022 11:00:00 +0800 platform-driver (1.0.0) unstable; urgency=low * Initial commit -- developer Wed, 05 Oct 2016 16:30:45 +0800 - diff --git a/platform/barefoot/sonic-platform-modules-netberg/debian/control b/platform/barefoot/sonic-platform-modules-netberg/debian/control index fb1fb68f6e49..5a25891f69de 100644 --- a/platform/barefoot/sonic-platform-modules-netberg/debian/control +++ b/platform/barefoot/sonic-platform-modules-netberg/debian/control @@ -5,7 +5,10 @@ Maintainer: Netberg Build-Depends: debhelper (>= 9) Standards-Version: 1.0.0 +Package: sonic-platform-netberg-aurora-710 +Architecture: amd64 +Description: This package contains Aurora 710 platform driver utility for SONiC project. + Package: sonic-platform-netberg-aurora-610 Architecture: amd64 Description: This package contains Aurora 610 platform driver utility for SONiC project. - diff --git a/platform/barefoot/sonic-platform-modules-netberg/debian/rules b/platform/barefoot/sonic-platform-modules-netberg/debian/rules index 99c1bcc408cd..1806928f393c 100755 --- a/platform/barefoot/sonic-platform-modules-netberg/debian/rules +++ b/platform/barefoot/sonic-platform-modules-netberg/debian/rules @@ -8,7 +8,7 @@ PACKAGE_PRE_NAME := sonic-platform-netberg KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) -MODULE_DIRS:= aurora-610 +MODULE_DIRS:= aurora-610 aurora-710 MODULE_DIR := modules UTILS_DIR := utils SERVICE_DIR := service @@ -31,6 +31,9 @@ override_dh_auto_install: $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko \ debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/sbin; \ + cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/*.sh \ + debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/sbin; \ dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \ cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service \ debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system; \ diff --git a/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.init b/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.init new file mode 100644 index 000000000000..973490cc96e0 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.init @@ -0,0 +1,40 @@ +#!/bin/bash + +### BEGIN INIT INFO +# Provides: setup-board +# Required-Start: +# Required-Stop: +# Should-Start: +# Should-Stop: +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Setup Aurora-710 board. +### END INIT INFO + +case "$1" in +start) + echo -n "Setting up board... " + + depmod -a + i2c_init.sh + + echo "done." + ;; + +stop) + + echo "done." + + ;; + +force-reload|restart) + echo "Not supported" + ;; + +*) + echo "Usage: /etc/init.d/sonic-platform-netberg-aurora-710.init {start|stop}" + exit 1 + ;; +esac + +exit 0 diff --git a/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.install b/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.install new file mode 100644 index 000000000000..e3d68e37d1f6 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.install @@ -0,0 +1 @@ +aurora-710/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-netberg_aurora_710-r0 diff --git a/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.postinst b/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.postinst new file mode 100755 index 000000000000..dba1e5e12013 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-netberg/debian/sonic-platform-netberg-aurora-710.postinst @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +PLATFORM_NAME=x86_64-netberg_aurora_710-r0 +SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl" +python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3} + +#DEBHELPER# + From eb9639edba4b26078923fba24fe72a10b8264a74 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Jul 2023 15:20:46 +0800 Subject: [PATCH 054/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15699) --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index a67f684f448d..ffce92658da0 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit a67f684f448d45c5b6c4a7be6ccd4218d0ccd57e +Subproject commit ffce92658da01e8a8f613dc1d89f9b439509d1be From 91fb7836fd6f5e9efc08f6d0e6f445d3f7fa7746 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Jul 2023 16:34:13 +0800 Subject: [PATCH 055/107] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#15697) #### Why I did it src/sonic-platform-common ``` * 10af810 - (HEAD -> master, origin/master, origin/HEAD) More prevention of fatal exception caused by VDM dictionary missing fields when a transceiver has just been pulled (#376) (5 hours ago) [snider-nokia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 4d270f07e040..10af810fa1d4 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 4d270f07e040e35b7fc90be6e38bd5feb6e163ed +Subproject commit 10af810fa1d40347ab8556e79374e6c94a99a22d From aa5164ef099a5979fc9a2f0939317c368236f847 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 1 Jul 2023 18:39:31 +0800 Subject: [PATCH 056/107] [ci/build]: Upgrade SONiC package versions (#15647) --- .../versions-deb-bullseye-arm64 | 2 ++ .../versions-py3-all-arm64 | 5 ++++ .../versions-py3-all-armhf | 1 + files/build/versions/default/versions-git | 6 ++-- files/build/versions/default/versions-mirror | 20 ++++++------- .../docker-config-engine-buster/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 20 ++++++------- .../versions-deb-bullseye | 8 +++--- .../sonic-slave-buster/versions-deb-buster | 28 ++++++++++--------- .../dockers/sonic-slave-buster/versions-py3 | 2 +- 10 files changed, 52 insertions(+), 42 deletions(-) create mode 100644 files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 index 3bad5a5352bd..90f712515be3 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -1 +1,3 @@ +libnl-3-200==3.5.0-1 +libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-arm64==5.10.140-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 new file mode 100644 index 000000000000..46df813bf748 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 @@ -0,0 +1,5 @@ +bcrypt==3.2.2 +bitarray==1.5.3 +click==7.0 +requests==2.31.0 +zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf index cd01abdaf741..46df813bf748 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-armhf @@ -2,3 +2,4 @@ bcrypt==3.2.2 bitarray==1.5.3 click==7.0 requests==2.31.0 +zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index bf87b6ba4461..5af180d0b622 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==90fed308660fd53ac4247b7242f280b01731b1c7 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==60c4b8810bdc3107a9a0c7046b79ee3a95df47fb https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==ea94c8b9f513f8a6ddc6ce1540fa41eaf4c8922a https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==1ee04cd5ac8bb636182d9d7c259110638b83c8b1 -https://github.com/FreeRADIUS/freeradius-server.git==14ddc663bc17ccdc6a7c860cfb188c58fb5536d1 +https://github.com/flashrom/flashrom.git==b66f4766b5d7dc614ad609f27dd2794e06b5e2a4 +https://github.com/FreeRADIUS/freeradius-server.git==dfd71b9085ec4dd5c89b8930f8ea1a9a951730bb https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 81b26f1d331e..eaf64e7c1340 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230625T000121Z -debian-security==20230625T000122Z +debian==20230630T000150Z +debian-security==20230630T000148Z download.docker.com_linux_debian_dists_bullseye==2023-06-09T17:17:20Z download.docker.com_linux_debian_dists_buster==2023-05-26T07:49:38Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230625T000122Z_dists_bullseye-security==2023-06-22T22:43:03Z -packages.trafficmanager.net_snapshot_debian-security_20230625T000122Z_dists_buster_updates==2023-06-22T22:43:03Z -packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_bullseye-backports==2023-06-24T20:43:09Z -packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_bullseye-updates==2023-06-24T20:43:09Z -packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_buster-backports==2023-06-24T20:43:09Z -packages.trafficmanager.net_snapshot_debian_20230625T000121Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230630T000148Z_dists_bullseye-security==2023-06-29T23:02:34Z +packages.trafficmanager.net_snapshot_debian-security_20230630T000148Z_dists_buster_updates==2023-06-29T23:02:34Z +packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_bullseye-backports==2023-06-29T20:50:17Z +packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_bullseye-updates==2023-06-29T20:50:17Z +packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_buster-backports==2023-06-29T20:50:17Z +packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index 70d81e6f2d3f..4498f4d58c33 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -15,6 +15,6 @@ redis-dump-load==1.1 regex==2023.6.3 six==1.16.0 tabulate==0.8.2 -typing_extensions==4.6.3 +typing_extensions==4.7.0 xmltodict==0.12.0 zipp==3.15.0 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 149586560650..c5e3f5966dcf 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -97,7 +97,7 @@ libblas3==3.8.0-2 libboost-atomic1.71.0==1.71.0-6~bpo10+1 libbrotli1==1.0.7-2+deb10u1 libbsd0==0.9.1-2+deb10u1 -libc-ares2==1.14.0-1+deb10u2 +libc-ares2==1.14.0-1+deb10u3 libc-dev-bin==2.28-10+deb10u2 libc6-dbg==2.28-10+deb10u2 libc6-dev==2.28-10+deb10u2 @@ -274,13 +274,13 @@ libnl-genl-3-200==3.4.0-1 libnl-nf-3-200==3.4.0-1 libnl-route-3-200==3.4.0-1 libnpth0==1.6-1 -libnss-systemd==241-7~deb10u9 +libnss-systemd==241-7~deb10u10 libogg0==1.3.2-1+b1 libopenjp2-7==2.3.0-2+deb10u2 libopts25==1:5.18.12-4 libopus0==1.3-1 liborc-0.4-0==1:0.4.28-3.1 -libpam-systemd==241-7~deb10u9 +libpam-systemd==241-7~deb10u10 libpango-1.0-0==1.42.4-8~deb10u1 libpangocairo-1.0-0==1.42.4-8~deb10u1 libpangoft2-1.0-0==1.42.4-8~deb10u1 @@ -357,7 +357,7 @@ libssl-dev==1.1.1n-0+deb10u5 libssl1.1==1.1.1n-0+deb10u5 libstdc++-8-dev==8.3.0-6 libsynctex2==2018.20181218.49446-1+deb10u2 -libsystemd0==241-7~deb10u9 +libsystemd0==241-7~deb10u10 libtacacs+1==4.0.4.27a-3 libtcl8.6==8.6.9+dfsg-2 libteam-utils==1.28-1 @@ -379,7 +379,7 @@ libtk8.6==8.6.9-2 libtry-tiny-perl==0.30-1 libtsan0==8.3.0-6 libubsan1==8.3.0-6 -libudev1==241-7~deb10u9 +libudev1==241-7~deb10u10 libunbound8==1.9.0-2+deb10u3 liburi-perl==1.76-1 libutempter0==1.1.6-3 @@ -406,10 +406,10 @@ libwscodecs2==2.6.20-0+deb10u7 libwsutil9==2.6.20-0+deb10u7 libwww-perl==6.36-2 libwww-robotrules-perl==6.02-1 -libx11-6==2:1.6.7-1+deb10u2 -libx11-data==2:1.6.7-1+deb10u2 +libx11-6==2:1.6.7-1+deb10u3 +libx11-data==2:1.6.7-1+deb10u3 libx11-protocol-perl==0.56-7 -libx11-xcb1==2:1.6.7-1+deb10u2 +libx11-xcb1==2:1.6.7-1+deb10u3 libxau6==1:1.0.8-1+b2 libxaw7==2:1.0.13-1+b2 libxcb-dri2-0==1.13.1-2 @@ -563,8 +563,8 @@ rsyslog==8.1901.0-1+deb10u2 sensible-utils==0.0.12 shared-mime-info==1.10-1 sntp==1:4.2.8p12+dfsg-4 -systemd==241-7~deb10u9 -systemd-sysv==241-7~deb10u9 +systemd==241-7~deb10u10 +systemd-sysv==241-7~deb10u10 t1utils==1.41-3 tacacs+==4.0.4.27a-3 tcpdump==4.9.3-1~deb10u2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index 16db332eb677..f00d84d22692 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -24,9 +24,9 @@ autopoint==0.21-4 autotools-dev==20180224.1+nmu1 bash-completion==1:2.11-2 bc==1.07.1-2+b2 -bind9-dnsutils==1:9.16.37-1~deb11u1 -bind9-host==1:9.16.37-1~deb11u1 -bind9-libs==1:9.16.37-1~deb11u1 +bind9-dnsutils==1:9.16.42-1~deb11u1 +bind9-host==1:9.16.42-1~deb11u1 +bind9-libs==1:9.16.42-1~deb11u1 binfmt-support==2.2.1-1+deb11u1 binutils==2.35.2-2 binutils-common==2.35.2-2 @@ -87,7 +87,7 @@ distro-info-data==0.51+deb11u3 dkms==2.8.4-3 dmeventd==2:1.02.175-2.1 dmsetup==2:1.02.175-2.1 -dnsutils==1:9.16.37-1~deb11u1 +dnsutils==1:9.16.42-1~deb11u1 docbook==4.5-6 docbook-dsssl==1.79-9.2 docbook-to-man==1:2.0.0-45 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 0ef357e93936..98d82e5678a9 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -338,8 +338,8 @@ libbsd-dev==0.9.1-2+deb10u1 libbsd0==0.9.1-2+deb10u1 libbsh-java==2.0b4-19 libbz2-dev==1.0.6-9.2~deb10u2 -libc-ares-dev==1.14.0-1+deb10u2 -libc-ares2==1.14.0-1+deb10u2 +libc-ares-dev==1.14.0-1+deb10u3 +libc-ares2==1.14.0-1+deb10u3 libc-dev-bin==2.28-10+deb10u2 libc-l10n==2.28-10+deb10u2 libc6-dbg==2.28-10+deb10u2 @@ -841,7 +841,7 @@ libnorm-dev==1.5.8+dfsg2-1 libnorm1==1.5.8+dfsg2-1 libnpth0==1.6-1 libnspr4==2:4.20-1 -libnss-systemd==241-7~deb10u9 +libnss-systemd==241-7~deb10u10 libnss3==2:3.42.1-1+deb10u6 libnuma-dev==2.0.12-1 libnuma1==2.0.12-1 @@ -878,7 +878,7 @@ libpackage-stash-perl==0.38-1 libpackage-stash-xs-perl==0.29-1 libpackagekit-glib2-18==1.1.12-5 libpadwalker-perl==2.3-1+b1 -libpam-systemd==241-7~deb10u9 +libpam-systemd==241-7~deb10u10 libpam0g-dev==1.3.1-5 libpango-1.0-0==1.42.4-8~deb10u1 libpango1.0-dev==1.42.4-8~deb10u1 @@ -1114,7 +1114,8 @@ libswresample3==7:4.1.11-0+deb10u1 libswscale5==7:4.1.11-0+deb10u1 libsynctex2==2018.20181218.49446-1+deb10u2 libsys-hostname-long-perl==1.5-1 -libsystemd-dev==241-7~deb10u9 +libsystemd-dev==241-7~deb10u10 +libsystemd0==241-7~deb10u10 libtag1v5==1.11.1+dfsg.1-0.3+deb10u1 libtag1v5-vanilla==1.11.1+dfsg.1-0.3+deb10u1 libtask-weaken-perl==1.06-1 @@ -1155,7 +1156,8 @@ libtype-tiny-xs-perl==0.014-1+b1 libtypes-serialiser-perl==1.0-1 libubsan1==8.3.0-6 libuchardet0==0.0.6-3 -libudev-dev==241-7~deb10u9 +libudev-dev==241-7~deb10u10 +libudev1==241-7~deb10u10 libunbound8==1.9.0-2+deb10u3 libunicode-utf8-perl==0.62-1 libunwind-dev==1.2.1-10~deb10u1 @@ -1216,12 +1218,12 @@ libwrap0==7.6.q-28 libwrap0-dev==7.6.q-28 libwww-perl==6.36-2 libwww-robotrules-perl==6.02-1 -libx11-6==2:1.6.7-1+deb10u2 -libx11-data==2:1.6.7-1+deb10u2 -libx11-dev==2:1.6.7-1+deb10u2 +libx11-6==2:1.6.7-1+deb10u3 +libx11-data==2:1.6.7-1+deb10u3 +libx11-dev==2:1.6.7-1+deb10u3 libx11-protocol-perl==0.56-7 -libx11-xcb-dev==2:1.6.7-1+deb10u2 -libx11-xcb1==2:1.6.7-1+deb10u2 +libx11-xcb-dev==2:1.6.7-1+deb10u3 +libx11-xcb1==2:1.6.7-1+deb10u3 libx264-155==2:0.155.2917+git0a84d98-2 libx265-165==2.9-4 libx32asan5==8.3.0-6 @@ -1704,8 +1706,8 @@ strace==4.26-0.2 sudo==1.8.27-1+deb10u5 swig==3.0.12-2 swig3.0==3.0.12-2 -systemd==241-7~deb10u9 -systemd-sysv==241-7~deb10u9 +systemd==241-7~deb10u10 +systemd-sysv==241-7~deb10u10 t1utils==1.41-3 tcl==8.6.9+1 tcl8.6==8.6.9+dfsg-2 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index db0d9fcfdbfa..3ce0c0f48250 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -73,7 +73,7 @@ setuptools==49.6.0 six==1.12.0 sphinx==1.8.4 sphinx-rtd-theme==0.4.3 -typing_extensions==4.6.3 +typing_extensions==4.7.0 unattended-upgrades==0.1 unidiff==0.5.4 urllib3==1.24.1 From 7ef59d556b29f765e604f7a565759ae9fcd841e8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 3 Jul 2023 19:18:54 +0800 Subject: [PATCH 057/107] [ci/build]: Upgrade SONiC package versions (#15706) --- .../versions-deb-bullseye-arm64 | 2 -- .../versions-py3-all-arm64 | 5 ----- files/build/versions/default/versions-mirror | 20 ++++++++--------- .../docker-base-buster/versions-deb-buster | 8 +++---- .../versions-deb-buster | 2 +- .../docker-config-engine-buster/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 20 ++++++++--------- .../sonic-slave-buster/versions-deb-buster | 22 +++++++++---------- .../dockers/sonic-slave-buster/versions-py3 | 2 +- 9 files changed, 38 insertions(+), 45 deletions(-) delete mode 100644 files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 index 90f712515be3..3bad5a5352bd 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -1,3 +1 @@ -libnl-3-200==3.5.0-1 -libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-arm64==5.10.140-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 deleted file mode 100644 index 46df813bf748..000000000000 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 +++ /dev/null @@ -1,5 +0,0 @@ -bcrypt==3.2.2 -bitarray==1.5.3 -click==7.0 -requests==2.31.0 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index eaf64e7c1340..e94fc9b36397 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230630T000150Z -debian-security==20230630T000148Z +debian==20230702T000215Z +debian-security==20230702T000635Z download.docker.com_linux_debian_dists_bullseye==2023-06-09T17:17:20Z download.docker.com_linux_debian_dists_buster==2023-05-26T07:49:38Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230630T000148Z_dists_bullseye-security==2023-06-29T23:02:34Z -packages.trafficmanager.net_snapshot_debian-security_20230630T000148Z_dists_buster_updates==2023-06-29T23:02:34Z -packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_bullseye-backports==2023-06-29T20:50:17Z -packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_bullseye-updates==2023-06-29T20:50:17Z -packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_buster-backports==2023-06-29T20:50:17Z -packages.trafficmanager.net_snapshot_debian_20230630T000150Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230702T000635Z_dists_bullseye-security==2023-06-30T18:02:52Z +packages.trafficmanager.net_snapshot_debian-security_20230702T000635Z_dists_buster_updates==2023-06-30T18:02:52Z +packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_bullseye-backports==2023-07-01T20:27:39Z +packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_bullseye-updates==2023-07-01T20:27:39Z +packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_buster-backports==2023-07-01T20:27:39Z +packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/docker-base-buster/versions-deb-buster b/files/build/versions/dockers/docker-base-buster/versions-deb-buster index 73cdf27b1c74..bf57849d20b0 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -33,8 +33,8 @@ libpgm-5.2-0==5.2.122~dfsg-3 libprocps7==2:3.3.15-2 libpsl5==0.20.2-2 libpython3-stdlib==3.7.3-1 -libpython3.7-minimal==3.7.3-2+deb10u4 -libpython3.7-stdlib==3.7.3-2+deb10u4 +libpython3.7-minimal==3.7.3-2+deb10u5 +libpython3.7-stdlib==3.7.3-2+deb10u5 libreadline7==7.0-5 librtmp1==2.4+20151223.gitfa8646d.1-2 libsasl2-2==2.1.27+dfsg-1+deb10u2 @@ -58,8 +58,8 @@ python3==3.7.3-1 python3-distutils==3.7.3-1 python3-lib2to3==3.7.3-1 python3-minimal==3.7.3-1 -python3.7==3.7.3-2+deb10u4 -python3.7-minimal==3.7.3-2+deb10u4 +python3.7==3.7.3-2+deb10u5 +python3.7-minimal==3.7.3-2+deb10u5 readline-common==7.0-5 redis-tools==5:6.0.6-1~bpo10+1 rsyslog==8.1901.0-1+deb10u2 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster index 67de9912f7b7..05c07be507e9 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -9,7 +9,7 @@ libnl-cli-3-200==3.5.0-1 libnl-genl-3-200==3.5.0-1 libnl-nf-3-200==3.5.0-1 libnl-route-3-200==3.5.0-1 -libpython3.7==3.7.3-2+deb10u4 +libpython3.7==3.7.3-2+deb10u5 libswsscommon==1.0.0 libyang==1.0.73 libyang-cpp==1.0.73 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 index 4498f4d58c33..34dccf18bf2d 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -15,6 +15,6 @@ redis-dump-load==1.1 regex==2023.6.3 six==1.16.0 tabulate==0.8.2 -typing_extensions==4.7.0 +typing_extensions==4.7.1 xmltodict==0.12.0 zipp==3.15.0 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index c5e3f5966dcf..4aa5c3dc84a4 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -110,9 +110,9 @@ libcgraph6==2.40.1-6+deb10u1 libcolord2==1.4.3-4 libcroco3==0.6.12-3 libcryptsetup12==2:2.1.0-5+deb10u2 -libcups2==2.2.10-6+deb10u7 +libcups2==2.2.10-6+deb10u8 libcupsfilters1==1.21.6-5+deb10u1 -libcupsimage2==2.2.10-6+deb10u7 +libcupsimage2==2.2.10-6+deb10u8 libcurl3-gnutls==7.64.0-4+deb10u6 libcurl4==7.64.0-4+deb10u6 libdaemon0==0.14-7 @@ -313,10 +313,10 @@ libpython2.7-minimal==2.7.16-2+deb10u2 libpython2.7-stdlib==2.7.16-2+deb10u2 libpython3-dev==3.7.3-1 libpython3-stdlib==3.7.3-1 -libpython3.7==3.7.3-2+deb10u4 -libpython3.7-dev==3.7.3-2+deb10u4 -libpython3.7-minimal==3.7.3-2+deb10u4 -libpython3.7-stdlib==3.7.3-2+deb10u4 +libpython3.7==3.7.3-2+deb10u5 +libpython3.7-dev==3.7.3-2+deb10u5 +libpython3.7-minimal==3.7.3-2+deb10u5 +libpython3.7-stdlib==3.7.3-2+deb10u5 libqt5core5a==5.11.3+dfsg1-1+deb10u5 libqt5dbus5==5.11.3+dfsg1-1+deb10u5 libqt5gui5==5.11.3+dfsg1-1+deb10u5 @@ -551,10 +551,10 @@ python3-venv==3.7.3-1 python3-wcwidth==0.1.7+dfsg1-3 python3-wheel==0.32.3-2 python3-xdg==0.25-5 -python3.7==3.7.3-2+deb10u4 -python3.7-dev==3.7.3-2+deb10u4 -python3.7-minimal==3.7.3-2+deb10u4 -python3.7-venv==3.7.3-2+deb10u4 +python3.7==3.7.3-2+deb10u5 +python3.7-dev==3.7.3-2+deb10u5 +python3.7-minimal==3.7.3-2+deb10u5 +python3.7-venv==3.7.3-2+deb10u5 qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 qttranslations5-l10n==5.11.3-2 readline-common==7.0-5 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 98d82e5678a9..bd236b2649cc 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -413,9 +413,9 @@ libcryptsetup12==2:2.1.0-5+deb10u2 libcrystalhd3==1:0.0~git20110715.fdd2f19-13 libcunit1==2.1-3-dfsg-2+b12 libcunit1-dev==2.1-3-dfsg-2+b12 -libcups2==2.2.10-6+deb10u7 +libcups2==2.2.10-6+deb10u8 libcupsfilters1==1.21.6-5+deb10u1 -libcupsimage2==2.2.10-6+deb10u7 +libcupsimage2==2.2.10-6+deb10u8 libcurl3-gnutls==7.64.0-4+deb10u6 libcurl4==7.64.0-4+deb10u6 libcurl4-openssl-dev==7.64.0-4+deb10u6 @@ -976,11 +976,11 @@ libpython3-all-dev==3.7.3-1 libpython3-dbg==3.7.3-1 libpython3-dev==3.7.3-1 libpython3-stdlib==3.7.3-1 -libpython3.7==3.7.3-2+deb10u4 -libpython3.7-dbg==3.7.3-2+deb10u4 -libpython3.7-dev==3.7.3-2+deb10u4 -libpython3.7-minimal==3.7.3-2+deb10u4 -libpython3.7-stdlib==3.7.3-2+deb10u4 +libpython3.7==3.7.3-2+deb10u5 +libpython3.7-dbg==3.7.3-2+deb10u5 +libpython3.7-dev==3.7.3-2+deb10u5 +libpython3.7-minimal==3.7.3-2+deb10u5 +libpython3.7-stdlib==3.7.3-2+deb10u5 libqdox-java==1.12.1-3 libqdox2-java==2.0~M10-1 libqt4-dbus==4:4.8.7+dfsg-18+deb10u1 @@ -1645,10 +1645,10 @@ python3-unidiff==0.5.4-1 python3-urllib3==1.24.1-1 python3-wheel==0.32.3-2 python3-xdg==0.25-5 -python3.7==3.7.3-2+deb10u4 -python3.7-dbg==3.7.3-2+deb10u4 -python3.7-dev==3.7.3-2+deb10u4 -python3.7-minimal==3.7.3-2+deb10u4 +python3.7==3.7.3-2+deb10u5 +python3.7-dbg==3.7.3-2+deb10u5 +python3.7-dev==3.7.3-2+deb10u5 +python3.7-minimal==3.7.3-2+deb10u5 qdbus==4:4.8.7+dfsg-18+deb10u1 qemu-kvm==1:3.1+dfsg-8+deb10u10 qemu-system-common==1:3.1+dfsg-8+deb10u10 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 3ce0c0f48250..870d7ad1938e 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -73,7 +73,7 @@ setuptools==49.6.0 six==1.12.0 sphinx==1.8.4 sphinx-rtd-theme==0.4.3 -typing_extensions==4.7.0 +typing_extensions==4.7.1 unattended-upgrades==0.1 unidiff==0.5.4 urllib3==1.24.1 From 1dfe35cadbb1bfd9d5e7b6c20b5c391f3597e503 Mon Sep 17 00:00:00 2001 From: kenneth-arista <93353051+kenneth-arista@users.noreply.github.com> Date: Mon, 3 Jul 2023 13:57:26 -0700 Subject: [PATCH 058/107] Add YANG model for FABRIC_PORT (#15629) #### Why I did it Introduce YANG model for FABRIC in CONFIG_DB, which was added in https://github.com/sonic-net/sonic-buildimage/pull/14170. #### How I did it This is a clone of @jfeng-arista's PR https://github.com/sonic-net/sonic-buildimage/pull/14282 to resolve conflicts with upstream changes. #### How to verify it Passing pipeline build is sufficient. --- .../tests/test_cfggen_from_yang.py | 11 ++++ .../tests/test_yang_data.json | 12 ++++ src/sonic-yang-models/doc/Configuration.md | 19 ++++++ src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 12 ++++ .../yang_model_tests/tests/fabric_port.json | 5 ++ .../tests_config/fabric_port.json | 16 +++++ .../yang-models/sonic-fabric-port.yang | 61 +++++++++++++++++++ 8 files changed, 138 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/fabric_port.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json create mode 100644 src/sonic-yang-models/yang-models/sonic-fabric-port.yang diff --git a/src/sonic-config-engine/tests/test_cfggen_from_yang.py b/src/sonic-config-engine/tests/test_cfggen_from_yang.py index 4f4cdb841465..5886b2cc882f 100644 --- a/src/sonic-config-engine/tests/test_cfggen_from_yang.py +++ b/src/sonic-config-engine/tests/test_cfggen_from_yang.py @@ -276,3 +276,14 @@ def test_fabric_monitor_data_table(self): "monPollThreshRecovery": "8" } }) + + def test_fabric_port_table(self): + arg = ["--var-json", "FABRIC_PORT"] + output = json.loads(self.run_script_with_yang_arg(arg)) + assert(output == {\ + "Fabric0": { + "alias": "Fabric0", + "isolateStatus": "False", + "lanes": "0" + } + }) diff --git a/src/sonic-config-engine/tests/test_yang_data.json b/src/sonic-config-engine/tests/test_yang_data.json index 51a1c6a94590..41aab043d4be 100644 --- a/src/sonic-config-engine/tests/test_yang_data.json +++ b/src/sonic-config-engine/tests/test_yang_data.json @@ -388,5 +388,17 @@ "monPollThreshRecovery": "8" } } + }, + "sonic-fabric-port:sonic-fabric-port": { + "sonic-fabric-port:FABRIC_PORT": { + "FABRIC_PORT_LIST": [ + { + "name": "Fabric0", + "alias": "Fabric0", + "isolateStatus": "False", + "lanes": "0" + } + ] + } } } diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 3590adea6b98..ab633a715850 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -34,6 +34,7 @@ Table of Contents * [FG_NHG_MEMBER](#fg_nhg_member) * [FG_NHG_PREFIX](#fg_nhg_prefix) * [FABRIC_MONITOR](#fabric-monitor) + * [FABRIC_PORT](#fabric-port) * [FLEX_COUNTER_TABLE](#flex_counter_table) * [Hash](#hash) * [IPv6 Link-local] (#ipv6-link-local) @@ -1063,6 +1064,24 @@ The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desi ``` +### FABRIC_PORT +``` +{ +"FABRIC_PORT": { + "Fabric0": { + "alias": "Fabric0", + "isolateStatus": "False", + "lanes": "0" + }, + "Fabric1": { + "alias": "Fabric1", + "isolateStatus": "False", + "lanes": "1" + } + } +} + +``` ### MPLS_TC_TO_TC_MAP ``` diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index d6aeb3e0d88e..b4bdc2da47f0 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -117,6 +117,7 @@ def run(self): './yang-models/sonic-events-syncd.yang', './yang-models/sonic-extension.yang', './yang-models/sonic-fabric-monitor.yang', + './yang-models/sonic-fabric-port.yang', './yang-models/sonic-flex_counter.yang', './yang-models/sonic-fine-grained-ecmp.yang', './yang-models/sonic-feature.yang', @@ -209,6 +210,7 @@ def run(self): './cvlyang-models/sonic-device_neighbor_metadata.yang', './cvlyang-models/sonic-extension.yang', './cvlyang-models/sonic-fabric-monitor.yang', + './cvlyang-models/sonic-fabric-port.yang', './cvlyang-models/sonic-flex_counter.yang', './cvlyang-models/sonic-feature.yang', './cvlyang-models/sonic-fine-grained-ecmp.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 37a8e024e4d4..2de693e58579 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1273,6 +1273,18 @@ "monPollThreshRecovery": "8" } }, + "FABRIC_PORT": { + "Fabric0": { + "alias": "Fabric0", + "isolateStatus": "False", + "lanes": "0" + }, + "Fabric1": { + "alias": "Fabric1", + "isolateStatus": "False", + "lanes": "1" + } + }, "FLEX_COUNTER_TABLE": { "PFCWD": { "FLEX_COUNTER_STATUS": "enable" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/fabric_port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/fabric_port.json new file mode 100644 index 000000000000..8c8db3ca1655 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/fabric_port.json @@ -0,0 +1,5 @@ +{ + "FABRIC_PORT_POSITIVE_CONFIG": { + "desc": "Configure FABRIC_PORT no failure." + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json new file mode 100644 index 000000000000..278834826120 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json @@ -0,0 +1,16 @@ +{ + "FABRIC_PORT_POSITIVE_CONFIG": { + "sonic-fabric-port:sonic-fabric-port": { + "sonic-fabric-port:FABRIC_PORT": { + "FABRIC_PORT_LIST": [ + { + "name": "Fabric0", + "alias": "Fabric0", + "isolateStatus": "False", + "lanes": "0" + } + ] + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-fabric-port.yang b/src/sonic-yang-models/yang-models/sonic-fabric-port.yang new file mode 100644 index 000000000000..f2266507deef --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-fabric-port.yang @@ -0,0 +1,61 @@ +module sonic-fabric-port{ + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-fabric-port"; + prefix fabric-port; + + import sonic-types { + prefix stypes; + } + + description "FABRIC_PORT yang Module for SONiC OS"; + + revision 2023-03-14 { + description "First Revision"; + } + + container sonic-fabric-port { + + container FABRIC_PORT { + + description "FABRIC_PORT part of config_db.json"; + + list FABRIC_PORT_LIST { + + key "name"; + + leaf name { + type string { + length 1..128; + } + } + + leaf isolateStatus { + description "Isolation status of a fabric port"; + type stypes:boolean_type; + default "False"; + } + + leaf alias { + description "Alias of a fabric port"; + type string { + length 1..128; + } + } + + leaf lanes { + description "Lanes of a fabric port"; + mandatory true; + type string { + length 1..128; + } + } + + } /* end of list FABRIC_PORT_LIST */ + + } /* end of container FABRIC_PORT */ + + } /* end of container sonic-fabric-port */ + +} /* end of module sonic-fabric-port */ From de656406336c3943cef7f5a88ab79f151ca0ee31 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:37:13 +0800 Subject: [PATCH 059/107] [ci/build]: Upgrade SONiC package versions (#15715) --- .../versions-deb-bullseye | 1 + .../versions-deb-bullseye-arm64 | 2 ++ .../versions-py3-all-arm64 | 5 ++++ files/build/versions/default/versions-docker | 24 +++++++++---------- files/build/versions/default/versions-git | 6 ++--- files/build/versions/default/versions-mirror | 20 ++++++++-------- .../dockers/docker-sonic-vs/versions-py3 | 2 +- .../versions-deb-bullseye | 14 +++++------ .../sonic-slave-buster/versions-deb-buster | 2 +- .../dockers/sonic-slave-buster/versions-py3 | 2 +- files/build/versions/host-image/versions-py3 | 2 +- 11 files changed, 44 insertions(+), 36 deletions(-) create mode 100644 files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye index 5142c35ba426..9832f9865917 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye @@ -1,6 +1,7 @@ applibs==1.mlnx.4.5.5142 applibs-dev==1.mlnx.4.5.5142 bfnplatform==1.0.0 +bfnsdk==1.0.0 isc-dhcp-relay==4.4.1-2.3+deb11u2 kernel-mft-dkms==4.22.1-15 libhiredis-dev==0.14.1-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 index 3bad5a5352bd..90f712515be3 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -1 +1,3 @@ +libnl-3-200==3.5.0-1 +libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-arm64==5.10.140-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 new file mode 100644 index 000000000000..46df813bf748 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 @@ -0,0 +1,5 @@ +bcrypt==3.2.2 +bitarray==1.5.3 +click==7.0 +requests==2.31.0 +zipp==1.2.0 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 9ed0e3d08b1b..6f36ba85377b 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,12 +1,12 @@ -amd64:amd64/debian:bullseye==sha256:1e8185ca8683c04e6c23cc7bb21b564d54faeb7e20852a6068c85cbdd7bac531 -amd64:amd64/debian:buster==sha256:108052254277ea53cd807d2782ed3cbe4b9242256af5c7519c6e5692ae2b5d97 -amd64:debian:bullseye==sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d -amd64:debian:buster==sha256:28842e4895d36e67c49015c0b41089fa3248e865c76994b19f706ab91e800b95 -arm64:arm64v8/debian:bullseye==sha256:0f56dd5a1687619972eeb539b273b4f3ec04431db69d4b569c2ce6ef48478538 -arm64:arm64v8/debian:buster==sha256:25bb297f257d6422b3aa44891469abc07e63096ea721da57002f0297ddcc599c -arm64:debian:bullseye==sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d -arm64:debian:buster==sha256:28842e4895d36e67c49015c0b41089fa3248e865c76994b19f706ab91e800b95 -armhf:arm32v7/debian:bullseye==sha256:93effc32fdca33aebfcef7225219dde573daebd3e1ddd09ab21e635887271096 -armhf:arm32v7/debian:buster==sha256:626ee3ce3a78f7a900fc5a99bfdbb44297f1c943a4fe261de4ec3fb4a23266bd -armhf:debian:bullseye==sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d -armhf:debian:buster==sha256:28842e4895d36e67c49015c0b41089fa3248e865c76994b19f706ab91e800b95 +amd64:amd64/debian:bullseye==sha256:3b6053ca925336c804e2d3f080af177efcdc9f51198a627569bfc7c7e730ef7e +amd64:amd64/debian:buster==sha256:5d6d56fd575caa578370f3d737116dc1aa3940c0e26f368ca36db72efa576570 +amd64:debian:bullseye==sha256:a648e10e02af129706b1fb89e1ac9694ae3db7f2b8439aa906321e68cc281bc0 +amd64:debian:buster==sha256:c21dbb23d41cb3f1c1a7f841e8642bf713934fb4dc5187979bd46f0b4b488616 +arm64:arm64v8/debian:bullseye==sha256:de3c0d12dd75f1a47595ff0ce78f2d30d6ca95c3ad66af06c8815d1f9b8e208d +arm64:arm64v8/debian:buster==sha256:3b830c5d210077d297956550caedf93430d5779fd786b4ac8e22a6bfe54ff162 +arm64:debian:bullseye==sha256:a648e10e02af129706b1fb89e1ac9694ae3db7f2b8439aa906321e68cc281bc0 +arm64:debian:buster==sha256:c21dbb23d41cb3f1c1a7f841e8642bf713934fb4dc5187979bd46f0b4b488616 +armhf:arm32v7/debian:bullseye==sha256:819b11bd0ade30fbc72f4b83593d0d126b2f3329b053495833219213fe37714d +armhf:arm32v7/debian:buster==sha256:d829b173cc834be382851eb0e3b6795fd6f3cbf1a47254409525d036de0dc0e7 +armhf:debian:bullseye==sha256:a648e10e02af129706b1fb89e1ac9694ae3db7f2b8439aa906321e68cc281bc0 +armhf:debian:buster==sha256:c21dbb23d41cb3f1c1a7f841e8642bf713934fb4dc5187979bd46f0b4b488616 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 5af180d0b622..ed1f62deab14 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==60c4b8810bdc3107a9a0c7046b79ee3a95df47fb +https://chromium.googlesource.com/chromium/tools/depot_tools.git==872ac9bd3d35f171a543731bfac1c8597518184e https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==ea94c8b9f513f8a6ddc6ce1540fa41eaf4c8922a https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 https://github.com/flashrom/flashrom.git==b66f4766b5d7dc614ad609f27dd2794e06b5e2a4 -https://github.com/FreeRADIUS/freeradius-server.git==dfd71b9085ec4dd5c89b8930f8ea1a9a951730bb +https://github.com/FreeRADIUS/freeradius-server.git==f43e7b256e2afbd44d07c8e90f0113371bbc8adb https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6 @@ -18,7 +18,7 @@ https://github.com/sflow/host-sflow==4dc68a95fa57758119d76e42965b32493ffd7094 https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d -https://salsa.debian.org/kernel-team/ethtool/==581ffbde5b349852a56fa581f7b512a755c33e26 +https://salsa.debian.org/kernel-team/ethtool/==d0578651310379629399dde060577d4b9b0bcab1 https://salsa.debian.org/kernel-team/initramfs-tools.git==193dfbb7929e518976f89f6c8dd9201982e56f80 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==74d15e80b8730335a9b13469ca6cafe4c1c8e485 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index e94fc9b36397..485e10ebf30c 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230702T000215Z -debian-security==20230702T000635Z +debian==20230704T000215Z +debian-security==20230704T000217Z download.docker.com_linux_debian_dists_bullseye==2023-06-09T17:17:20Z download.docker.com_linux_debian_dists_buster==2023-05-26T07:49:38Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230702T000635Z_dists_bullseye-security==2023-06-30T18:02:52Z -packages.trafficmanager.net_snapshot_debian-security_20230702T000635Z_dists_buster_updates==2023-06-30T18:02:52Z -packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_bullseye-backports==2023-07-01T20:27:39Z -packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_bullseye-updates==2023-07-01T20:27:39Z -packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_buster-backports==2023-07-01T20:27:39Z -packages.trafficmanager.net_snapshot_debian_20230702T000215Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230704T000217Z_dists_bullseye-security==2023-07-03T20:07:44Z +packages.trafficmanager.net_snapshot_debian-security_20230704T000217Z_dists_buster_updates==2023-07-03T20:07:43Z +packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_bullseye-backports==2023-07-03T20:15:50Z +packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_bullseye-updates==2023-07-03T20:15:49Z +packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_buster-backports==2023-07-03T20:15:50Z +packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index eea043b5daac..5f58f9cb9c2e 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -18,7 +18,7 @@ importlib-metadata==6.1.0 jsonpatch==1.33 jsonpointer==2.4 lazy-object-proxy==1.9.0 -m2crypto==0.38.0 +m2crypto==0.39.0 netifaces==0.10.9 packaging==23.1 paramiko==2.11.0 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index f00d84d22692..e5f84cdac4f5 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -143,7 +143,7 @@ gem2deb==1.4 gem2deb-test-runner==1.4 gettext==0.21-4 gettext-base==0.21-4 -ghostscript==9.53.3~dfsg-7+deb11u4 +ghostscript==9.53.3~dfsg-7+deb11u5 gir1.2-atk-1.0==2.36.0-2 gir1.2-atspi-2.0==2.38.0-4+deb11u1 gir1.2-freedesktop==1.66.1-1+b1 @@ -182,9 +182,9 @@ gsasl-common==1.10.0-4+deb11u1 gsettings-desktop-schemas==3.38.0-2 gsfonts==1:8.11+urwcyr1.0.7~pre44-4.5 gstreamer1.0-libav==1.18.4-3 -gstreamer1.0-plugins-base==1.18.4-2 -gstreamer1.0-plugins-good==1.18.4-2+deb11u1 -gstreamer1.0-x==1.18.4-2 +gstreamer1.0-plugins-base==1.18.4-2+deb11u1 +gstreamer1.0-plugins-good==1.18.4-2+deb11u2 +gstreamer1.0-x==1.18.4-2+deb11u1 gtk-update-icon-cache==3.24.24-4+deb11u3 guile-2.2-libs==2.2.7+1-6 hicolor-icon-theme==0.17-2 @@ -618,12 +618,12 @@ libgraphite2-3==1.3.14-1 libgraphite2-dev==1.3.14-1 libgrpc++1==1.30.2-3 libgrpc10==1.30.2-3 -libgs9==9.53.3~dfsg-7+deb11u4 -libgs9-common==9.53.3~dfsg-7+deb11u4 +libgs9==9.53.3~dfsg-7+deb11u5 +libgs9-common==9.53.3~dfsg-7+deb11u5 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 libgssrpc4==1.18.3-6+deb11u3 -libgstreamer-plugins-base1.0-0==1.18.4-2 +libgstreamer-plugins-base1.0-0==1.18.4-2+deb11u1 libgstreamer1.0-0==1.18.4-2.1 libgtest-dev==1.10.0.20201025-1.1 libgtk-3-0==3.24.24-4+deb11u3 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index bd236b2649cc..96af63974e6c 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -1342,7 +1342,7 @@ libxxf86vm-dev==1:1.1.4-1+b2 libxxf86vm1==1:1.1.4-1+b2 libxxhash0==0.6.5-2 libxz-java==1.8-2 -libyajl2==2.1.0-3 +libyajl2==2.1.0-3+deb10u1 libyaml-0-2==0.2.1-1 libyaml-dev==0.2.1-1 libyaml-libyaml-perl==0.76+repack-1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 870d7ad1938e..88949d47b256 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -25,7 +25,7 @@ jinja2==3.0.3 keyring==17.1.1 keyrings.alt==3.1.1 lxml==4.9.1 -m2crypto==0.38.0 +m2crypto==0.39.0 mako==1.0.7 markdown==3.0.1 markupsafe==2.0.1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 216ceea00ae1..49cf9f80a688 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -30,7 +30,7 @@ jsonpointer==2.4 jsonschema==2.6.0 lazy-object-proxy==1.9.0 lxml==4.9.1 -m2crypto==0.38.0 +m2crypto==0.39.0 markupsafe==2.1.3 natsort==6.2.1 netaddr==0.8.0 From 2f8994999bbe054e2f60fbc1217d6a49480ca4f9 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Thu, 6 Jul 2023 00:59:35 +0800 Subject: [PATCH 060/107] [dash-api]: Add dash-api and related protobuf library (#14515) Why I did it For the DASH scenario, the APP_DB will be optimized by protobuf message for less memory consumption. How I did it Download the Debian package of protobuf 3.21.12 and create a corresponding rule for building it. Add a submodule of sonic-dash-api and generated its Debian package which includes C++ library and Python library How to verify it Check artifacts of Azp that the protobuf-related and dash-api deb packages should be generated. Signed-off-by: Ze Gan --- .../azure-pipelines-build-ubuntu-2004.yml | 55 +++++++++++++++++++ .gitmodules | 3 + rules/protobuf.dep | 9 +++ rules/protobuf.mk | 36 ++++++++++++ rules/sonic-dash-api.dep | 12 ++++ rules/sonic-dash-api.mk | 20 +++++++ rules/swss.mk | 6 +- sonic-slave-bullseye/Dockerfile.j2 | 10 +++- src/protobuf/Makefile | 33 +++++++++++ src/sonic-dash-api/.gitignore | 2 + src/sonic-dash-api/Makefile | 47 ++++++++++++++++ src/sonic-dash-api/debian/changelog | 6 ++ src/sonic-dash-api/debian/compat | 1 + src/sonic-dash-api/debian/control | 13 +++++ src/sonic-dash-api/debian/rules | 8 +++ src/sonic-dash-api/pypkg/__init__.py | 5 ++ src/sonic-dash-api/sonic-dash-api | 1 + 17 files changed, 262 insertions(+), 5 deletions(-) create mode 100644 .azure-pipelines/azure-pipelines-build-ubuntu-2004.yml create mode 100644 rules/protobuf.dep create mode 100644 rules/protobuf.mk create mode 100644 rules/sonic-dash-api.dep create mode 100644 rules/sonic-dash-api.mk create mode 100644 src/protobuf/Makefile create mode 100644 src/sonic-dash-api/.gitignore create mode 100644 src/sonic-dash-api/Makefile create mode 100644 src/sonic-dash-api/debian/changelog create mode 100644 src/sonic-dash-api/debian/compat create mode 100644 src/sonic-dash-api/debian/control create mode 100755 src/sonic-dash-api/debian/rules create mode 100644 src/sonic-dash-api/pypkg/__init__.py create mode 160000 src/sonic-dash-api/sonic-dash-api diff --git a/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml new file mode 100644 index 000000000000..697c87b3c9ea --- /dev/null +++ b/.azure-pipelines/azure-pipelines-build-ubuntu-2004.yml @@ -0,0 +1,55 @@ +# C/C++ with GCC +# Build your C/C++ project with GCC using make. +# Add steps that publish test results, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc +pr: none + +trigger: + batch: true + branches: + include: + - master + +stages: +- stage: Build + + jobs: + - job: + displayName: "amd64/ubuntu-20.04" + pool: + vmImage: 'ubuntu-20.04' + + steps: + - checkout: self + submodules: true + - script: | + sudo apt-get update + sudo apt-get install -y make wget libtool m4 autoconf dh-exec libdebhelper-perl=13.6ubuntu1~bpo20.04.1 debhelper=13.6ubuntu1~bpo20.04.1 \ + cmake pkg-config python3-pip python cmake libgtest-dev libgmock-dev libyang-dev \ + debhelper-compat dh-elpa dh-sequence-python3 python3-all \ + libpython3-all-dev python3-six xmlto unzip rake-compiler gem2deb pkg-php-tools \ + ant default-jdk maven-repo-helper libguava-java + wget http://ftp.us.debian.org/debian/pool/main/libg/libgoogle-gson-java/libgoogle-gson-java_2.8.6-1+deb11u1_all.deb + sudo dpkg -i libgoogle-gson-java_2.8.6-1+deb11u1_all.deb + mkdir -p /tmp/artifacts + displayName: "Install dependencies" + - script: | + SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile + workingDirectory: src + displayName: "Build protobuf" + - script: | + sudo dpkg -i protobuf-compiler_3.21.12-3_amd64.deb libprotoc32_3.21.12-3_amd64.deb \ + libprotobuf32_3.21.12-3_amd64.deb libprotobuf-dev_3.21.12-3_amd64.deb \ + libprotobuf-lite32_3.21.12-3_amd64.deb + workingDirectory: /tmp/artifacts + displayName: "Install protobuf" + - script: | + dpkg-buildpackage -rfakeroot -b -us -uc + workingDirectory: src/sonic-dash-api + displayName: "Build sonic-dash-api" + - script: | + cp *.deb /tmp/artifacts + workingDirectory: src + - publish: /tmp/artifacts + artifact: sonic-buildimage.amd64.ubuntu20_04 + displayName: "Archive sonic-buildimage debian packages for ubuntu20.04" diff --git a/.gitmodules b/.gitmodules index 2715540c1f90..5455f6d7754e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -115,3 +115,6 @@ [submodule "src/dhcpmon"] path = src/dhcpmon url = https://github.com/sonic-net/sonic-dhcpmon.git +[submodule "src/sonic-dash-api/sonic-dash-api"] + path = src/sonic-dash-api/sonic-dash-api + url = https://github.com/sonic-net/sonic-dash-api.git diff --git a/rules/protobuf.dep b/rules/protobuf.dep new file mode 100644 index 000000000000..8761659deeed --- /dev/null +++ b/rules/protobuf.dep @@ -0,0 +1,9 @@ + +SPATH := $($(PROTOBUF)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/protobuf.mk rules/protobuf.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(PROTOBUF)_CACHE_MODE := GIT_CONTENT_SHA +$(PROTOBUF)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(PROTOBUF)_DEP_FILES := $(DEP_FILES) diff --git a/rules/protobuf.mk b/rules/protobuf.mk new file mode 100644 index 000000000000..8822d1357498 --- /dev/null +++ b/rules/protobuf.mk @@ -0,0 +1,36 @@ +# protobuf package + +PROTOBUF_VERSION = 3.21.12 +PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 + +export PROTOBUF_VERSION +export PROTOBUF_VERSION_FULL + +PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf +SONIC_MAKE_DEBS += $(PROTOBUF) + +PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) +$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) + +PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) + +PROTOC = libprotoc_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(PROTOC)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) +$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC))) + +PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) +$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) + +PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) +$(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC) +$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) + +PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) +$(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) +$(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) diff --git a/rules/sonic-dash-api.dep b/rules/sonic-dash-api.dep new file mode 100644 index 000000000000..6bf9209e499d --- /dev/null +++ b/rules/sonic-dash-api.dep @@ -0,0 +1,12 @@ + +SPATH := $($(LIB_SONIC_DASH_API)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-dash-api.mk rules/sonic-dash-api.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(LIB_SONIC_DASH_API)_CACHE_MODE := GIT_CONTENT_SHA +$(LIB_SONIC_DASH_API)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIB_SONIC_DASH_API)_DEP_FILES := $(DEP_FILES) +$(LIB_SONIC_DASH_API)_SMDEP_FILES := $(SMDEP_FILES) +$(LIB_SONIC_DASH_API)_SMDEP_PATHS := $(SPATH) + diff --git a/rules/sonic-dash-api.mk b/rules/sonic-dash-api.mk new file mode 100644 index 000000000000..eeea7271d8cc --- /dev/null +++ b/rules/sonic-dash-api.mk @@ -0,0 +1,20 @@ +# libdashsai package + +LIB_SONIC_DASH_API_VERSION = 1.0.0 + +LIB_SONIC_DASH_API = libdashapi_$(LIB_SONIC_DASH_API_VERSION)_$(CONFIGURED_ARCH).deb +$(LIB_SONIC_DASH_API)_SRC_PATH = $(SRC_PATH)/sonic-dash-api + +$(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) +$(LIB_SONIC_DASH_API)_RDEPENDS += $(LIBSWSSCOMMON) $(LIBNL3) $(LIBNL_GENL3) $(LIBNL_ROUTE3) $(PROTOBUF) $(PROTOBUF_LITE) + +SONIC_DPKG_DEBS += $(LIB_SONIC_DASH_API) + +LIB_SONIC_DASH_API_DBG = libdashapi-dbgsym_$(LIB_SONIC_DASH_API_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIB_SONIC_DASH_API),$(LIB_SONIC_DASH_API_DBG))) + +# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} +# are archived into debug one image to facilitate debugging. +# +DBG_SRC_ARCHIVE += sonic-dash-api + diff --git a/rules/swss.mk b/rules/swss.mk index e4d18cf2eb3d..df12ade5a479 100644 --- a/rules/swss.mk +++ b/rules/swss.mk @@ -4,11 +4,13 @@ SWSS = swss_1.0.0_$(CONFIGURED_ARCH).deb $(SWSS)_SRC_PATH = $(SRC_PATH)/sonic-swss $(SWSS)_DEPENDS += $(LIBSAIREDIS_DEV) $(LIBSAIMETADATA_DEV) $(LIBTEAM_DEV) \ $(LIBTEAMDCTL) $(LIBTEAM_UTILS) $(LIBSWSSCOMMON_DEV) \ - $(LIBSAIVS) $(LIBSAIVS_DEV) + $(LIBSAIVS) $(LIBSAIVS_DEV) \ + $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(LIB_SONIC_DASH_API) $(SWSS)_UNINSTALLS = $(LIBSAIVS_DEV) $(SWSS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBTEAM) \ - $(LIBTEAMDCTL) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) + $(LIBTEAMDCTL) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) \ + $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) $(LIB_SONIC_DASH_API) SONIC_DPKG_DEBS += $(SWSS) SWSS_DBG = swss-dbg_1.0.0_$(CONFIGURED_ARCH).deb diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 89b1240bb1b4..a8b40cb6b38c 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -344,8 +344,6 @@ RUN apt-get update && apt-get install -y \ libnetfilter-conntrack-dev \ libnftnl-dev \ # For SAI3.7 - protobuf-compiler \ - libprotobuf-dev \ xxd \ # For DHCP Monitor tool libexplain-dev \ @@ -408,7 +406,13 @@ RUN apt-get update && apt-get install -y \ pkg-config \ # For audisp-tacplus libauparse-dev \ - auditd + auditd \ +# For protobuf + dh-elpa \ + xmlto \ + rake-compiler \ + default-jdk \ + libgoogle-gson-java {%- if CROSS_BUILD_ENVIRON == "y" %} # Arm vs. amd64 versions conflict - remove amd64 packages diff --git a/src/protobuf/Makefile b/src/protobuf/Makefile new file mode 100644 index 000000000000..fc208af76779 --- /dev/null +++ b/src/protobuf/Makefile @@ -0,0 +1,33 @@ +SHELL = /bin/bash +.ONESHELL: +.SHELLFLAGS += -e + +MAIN_TARGET = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb +DERIVED_TARGETS = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # Remove any stale files + rm -rf protobuf-$(PROTOBUF_VERSION) + + wget -O protobuf_$(PROTOBUF_VERSION).orig.tar.gz http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_$(PROTOBUF_VERSION).orig.tar.gz + wget -O protobuf_$(PROTOBUF_VERSION_FULL).dsc http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_$(PROTOBUF_VERSION_FULL).dsc + wget -O protobuf_$(PROTOBUF_VERSION_FULL).debian.tar.xz http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_$(PROTOBUF_VERSION_FULL).debian.tar.xz + dpkg-source -x protobuf_$(PROTOBUF_VERSION_FULL).dsc + + pushd protobuf-$(PROTOBUF_VERSION) + +ifeq ($(CROSS_BUILD_ENVIRON), y) + dpkg-buildpackage -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + + popd + + mv $(DERIVED_TARGETS) $* $(DEST)/ + +$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/sonic-dash-api/.gitignore b/src/sonic-dash-api/.gitignore new file mode 100644 index 000000000000..ff64e429bd09 --- /dev/null +++ b/src/sonic-dash-api/.gitignore @@ -0,0 +1,2 @@ +build +debian/sonic-dash-api diff --git a/src/sonic-dash-api/Makefile b/src/sonic-dash-api/Makefile new file mode 100644 index 000000000000..0031800cced7 --- /dev/null +++ b/src/sonic-dash-api/Makefile @@ -0,0 +1,47 @@ +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -e + +RM := rm -rf +CP := cp -rf +MKDIR := mkdir +MV := mv +LIBDASHAPI := libdashapi.so +BUILD_DIR := build +PYPKG_DIR := pypkg +DESTDIR := +DASH_API_PROTO_DIR := sonic-dash-api/proto +INSTALLED_HEADER_DIR := $(DESTDIR)/usr/include/dash_api +INSTALLED_LIB_DIR := $(DESTDIR)/usr/lib +INSTALLED_PYTHON_DIR := $(DESTDIR)/usr/lib/python3/dist-packages/dash_api + +all: compile_cpp_proto dashapi.so compile_py_proto + +compile_cpp_proto: + $(MKDIR) -p $(BUILD_DIR) + protoc -I=$(DASH_API_PROTO_DIR) --cpp_out=$(BUILD_DIR) $(DASH_API_PROTO_DIR)/*.proto + +dashapi.so: compile_cpp_proto + g++ -std=c++14 -fPIC -shared -o $(BUILD_DIR)/$(LIBDASHAPI) $(wildcard $(BUILD_DIR)/*.pb.cc) -lprotobuf + +compile_py_proto: + protoc -I=$(DASH_API_PROTO_DIR) --python_out=$(PYPKG_DIR) $(DASH_API_PROTO_DIR)/*.proto + +clean: + $(RM) $(BUILD_DIR) + $(RM) $(PYPKG_DIR)/*_pb2.py + +install: + $(MKDIR) -p $(INSTALLED_HEADER_DIR) + $(CP) $(BUILD_DIR)/*.pb.h $(INSTALLED_HEADER_DIR) + $(MKDIR) -p $(INSTALLED_LIB_DIR) + $(CP) $(BUILD_DIR)/$(LIBDASHAPI) $(INSTALLED_LIB_DIR) + $(MKDIR) -p $(INSTALLED_PYTHON_DIR) + $(CP) $(PYPKG_DIR)/* $(INSTALLED_PYTHON_DIR) + +uninstall: + $(RM) $(INSTALLED_HEADER_DIR) + $(RM) $(INSTALLED_LIB_DIR)/$(LIBDASHAPI) + $(RM) $(INSTALLED_PYTHON_DIR) + +.PHONY: uninstall clean diff --git a/src/sonic-dash-api/debian/changelog b/src/sonic-dash-api/debian/changelog new file mode 100644 index 000000000000..e5cb52398c4c --- /dev/null +++ b/src/sonic-dash-api/debian/changelog @@ -0,0 +1,6 @@ +sonic (1.0.0) stable; urgency=medium + + * Initial release. + + -- Ze Gan Wed, 14 Jun 2023 12:00:00 -0800 + diff --git a/src/sonic-dash-api/debian/compat b/src/sonic-dash-api/debian/compat new file mode 100644 index 000000000000..9d607966b721 --- /dev/null +++ b/src/sonic-dash-api/debian/compat @@ -0,0 +1 @@ +11 \ No newline at end of file diff --git a/src/sonic-dash-api/debian/control b/src/sonic-dash-api/debian/control new file mode 100644 index 000000000000..545204fbe7da --- /dev/null +++ b/src/sonic-dash-api/debian/control @@ -0,0 +1,13 @@ +Source: sonic +Maintainer: Ze Gan +Section: net +Priority: optional +Build-Depends: dh-exec (>=0.3), debhelper (>= 12), autotools-dev, +Standards-Version: 1.0.0 + +Package: libdashapi +Architecture: any +Build-Depends: protobuf-compiler (>=3.21.12), libprotobuf-dev (>=3.21.12) +Depends: libprotobuf32 (>=3.21.12), libprotobuf-lite32 (>=3.21.12) +Section: libs +Description: DASH API definition for the SONiC project. diff --git a/src/sonic-dash-api/debian/rules b/src/sonic-dash-api/debian/rules new file mode 100755 index 000000000000..e661a7acd0bf --- /dev/null +++ b/src/sonic-dash-api/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +%: + dh $@ + +override_dh_auto_build: + make all diff --git a/src/sonic-dash-api/pypkg/__init__.py b/src/sonic-dash-api/pypkg/__init__.py new file mode 100644 index 000000000000..ade95c521abf --- /dev/null +++ b/src/sonic-dash-api/pypkg/__init__.py @@ -0,0 +1,5 @@ +import sys +import os + + +sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) diff --git a/src/sonic-dash-api/sonic-dash-api b/src/sonic-dash-api/sonic-dash-api new file mode 160000 index 000000000000..30415cd41ef2 --- /dev/null +++ b/src/sonic-dash-api/sonic-dash-api @@ -0,0 +1 @@ +Subproject commit 30415cd41ef2ae62841417b4a6a9113129cd718d From eaa795deb8296d6723394cced9da727dff12d8e1 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:42:46 -0700 Subject: [PATCH 061/107] Revert "[gearbox] use credo sai v0.9.0 (#14149)" (#15708) Reverts #14149 This SAI libsaicredo_0.9.0_amd64.deb causing packet forwarding issues on Linecards aristanetworks/sonic#92 This reverts commit c4c621c614df55c699eba95133dd4de029755957. --- platform/components/docker-gbsyncd-credo.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/components/docker-gbsyncd-credo.mk b/platform/components/docker-gbsyncd-credo.mk index d1961afe9a12..34f7101759eb 100644 --- a/platform/components/docker-gbsyncd-credo.mk +++ b/platform/components/docker-gbsyncd-credo.mk @@ -1,9 +1,9 @@ DOCKER_GBSYNCD_PLATFORM_CODE = credo -LIBSAI_CREDO = libsaicredo_0.9.0_amd64.deb -$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A10%3A11Z&se=2100-03-09T02%3A10%3A00Z&sr=b&sp=r&sig=mxOWttgAuOXVjvDI3zF5KHcrTHBgg6mv%2FOpTOxlCoVM%3D" -LIBSAI_CREDO_OWL = libsaicredo-owl_0.9.0_amd64.deb -$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A12%3A02Z&se=2100-03-09T02%3A12%3A00Z&sr=b&sp=r&sig=n4mqMVnZxC3u14EWRehfl6bqqUAi1VP1uUdHGg3%2B7H4%3D" +LIBSAI_CREDO = libsaicredo_0.8.2_amd64.deb +$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A24%3A23Z&se=2100-01-31T04%3A24%3A00Z&sr=b&sp=r&sig=RZPbmaIetvDRtwifrVT4s%2FaQxB%2FBTOyCqXtMtoNRjmY%3D" +LIBSAI_CREDO_OWL = libsaicredo-owl_0.8.2_amd64.deb +$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A25%3A43Z&se=2100-01-31T04%3A25%3A00Z&sr=b&sp=r&sig=%2BdSFujwy0gY%2FiH50Ffi%2FsqZOAHBOFPUcBdR06fHEZkI%3D" ifneq ($($(LIBSAI_CREDO)_URL),) include $(PLATFORM_PATH)/../template/docker-gbsyncd-base.mk From c6dbfa988eac95dadbb61c8d07a00de92bf0d14e Mon Sep 17 00:00:00 2001 From: leo lin Date: Thu, 6 Jul 2023 05:39:01 +0800 Subject: [PATCH 062/107] [Ufispace][PDDF] Add support for S9300-32D platform (#14922) --- .../UFISPACE-S9300-32D/hwsku.json | 140 + .../UFISPACE-S9300-32D/port_config.ini | 35 + .../UFISPACE-S9300-32D/sai.profile | 1 + .../td4-s9300-32x400G.config.yml | 671 +++ .../custom_led.bin | Bin 0 -> 356 bytes .../x86_64-ufispace_s9300_32d-r0/default_sku | 1 + .../x86_64-ufispace_s9300_32d-r0/fancontrol | 10 + .../installer.conf | 4 + .../led_proc_init.soc | 4 + .../x86_64-ufispace_s9300_32d-r0/pcie.yaml | 742 +++ .../pddf/pd-plugin.json | 86 + .../pddf/pddf-device.json | 5086 +++++++++++++++++ .../x86_64-ufispace_s9300_32d-r0/pddf_support | 0 .../platform.json | 659 +++ .../platform_asic | 1 + .../platform_env.conf | 2 + .../pmon_daemon_control.json | 9 + .../x86_64-ufispace_s9300_32d-r0/sensors.conf | 9 + .../system_health_monitoring_config.json | 15 + platform/broadcom/one-image.mk | 4 +- .../broadcom/platform-modules-ufispace.mk | 12 + platform/broadcom/rules.mk | 1 + .../sonic-platform-modules-ufispace/LICENSE | 674 +++ .../debian/changelog | 6 + .../debian/compat | 1 + .../debian/control | 11 + .../debian/rules | 88 + .../sonic-platform-ufispace-s9300-32d.install | 1 + ...sonic-platform-ufispace-s9300-32d.postinst | 3 + .../s9300-32d/modules/Makefile | 6 + .../modules/pddf_custom_sysstatus_module.c | 265 + .../modules/x86-64-ufispace-s9300-32d-cpld.c | 1638 ++++++ .../modules/x86-64-ufispace-s9300-32d-cpld.h | 251 + .../modules/x86-64-ufispace-s9300-32d-lpc.c | 816 +++ .../x86-64-ufispace-s9300-32d-sys-eeprom.c | 273 + .../service/pddf-platform-init.service | 1 + .../s9300-32d/sonic_platform/__init__.py | 4 + .../s9300-32d/sonic_platform/chassis.py | 177 + .../s9300-32d/sonic_platform/component.py | 139 + .../s9300-32d/sonic_platform/eeprom.py | 21 + .../s9300-32d/sonic_platform/fan.py | 168 + .../s9300-32d/sonic_platform/fan_drawer.py | 17 + .../s9300-32d/sonic_platform/platform.py | 25 + .../s9300-32d/sonic_platform/psu.py | 38 + .../s9300-32d/sonic_platform/sfp.py | 17 + .../s9300-32d/sonic_platform/thermal.py | 17 + .../s9300-32d/sonic_platform/watchdog.py | 23 + .../s9300-32d/sonic_platform_setup.py | 27 + .../utils/pddf_post_device_create.sh | 3 + .../utils/pddf_post_driver_install.sh | 2 + .../utils/pddf_pre_driver_install.sh | 11 + .../s9300-32d/utils/pddf_switch_svc.py | 86 + 52 files changed, 12300 insertions(+), 1 deletion(-) create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/hwsku.json create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/port_config.ini create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/sai.profile create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/custom_led.bin create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/default_sku create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/fancontrol create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/installer.conf create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/led_proc_init.soc create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/pcie.yaml create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/pddf/pd-plugin.json create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/pddf/pddf-device.json create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/pddf_support create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/platform.json create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/platform_asic create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/platform_env.conf create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/pmon_daemon_control.json create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/sensors.conf create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/system_health_monitoring_config.json create mode 100644 platform/broadcom/platform-modules-ufispace.mk create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/LICENSE create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/changelog create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/compat create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/control create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/debian/rules create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.install create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.postinst create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c create mode 120000 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/platform.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform_setup.py create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_driver_install.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_switch_svc.py diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/hwsku.json b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/hwsku.json new file mode 100644 index 000000000000..066985e74dd5 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/hwsku.json @@ -0,0 +1,140 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet8": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet16": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet24": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet32": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet40": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet48": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet56": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet64": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet72": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet80": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet88": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet96": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet104": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet112": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet120": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet128": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet136": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet144": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet152": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet160": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet168": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet176": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet184": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet192": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet200": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet208": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet216": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet224": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet232": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet240": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet248": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet256": { + "default_brkout_mode": "1x10G" + }, + + "Ethernet257": { + "default_brkout_mode": "1x10G" + } + } +} + diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/port_config.ini b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/port_config.ini new file mode 100644 index 000000000000..c573702b98bf --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/port_config.ini @@ -0,0 +1,35 @@ +# name lanes alias index speed +Ethernet0 1,2,3,4,5,6,7,8 Ethernet1/1 0 400000 +Ethernet8 9,10,11,12,13,14,15,16 Ethernet2/1 1 400000 +Ethernet16 17,18,19,20,21,22,23,24 Ethernet3/1 2 400000 +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 3 400000 +Ethernet32 33,34,35,36,37,38,39,40 Ethernet5/1 4 400000 +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 5 400000 +Ethernet48 49,50,51,52,53,54,55,56 Ethernet7/1 6 400000 +Ethernet56 57,58,59,60,61,62,63,64 Ethernet8/1 7 400000 +Ethernet64 65,66,67,68,69,70,71,72 Ethernet9/1 8 400000 +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 9 400000 +Ethernet80 81,82,83,84,85,86,87,88 Ethernet11/1 10 400000 +Ethernet88 89,90,91,92,93,94,95,96 Ethernet12/1 11 400000 +Ethernet96 97,98,99,100,101,102,103,104 Ethernet13/1 12 400000 +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 13 400000 +Ethernet112 113,114,115,116,117,118,119,120 Ethernet15/1 14 400000 +Ethernet120 121,122,123,124,125,126,127,128 Ethernet16/1 15 400000 +Ethernet128 129,130,131,132,133,134,135,136 Ethernet17/1 16 400000 +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 17 400000 +Ethernet144 145,146,147,148,149,150,151,152 Ethernet19/1 18 400000 +Ethernet152 153,154,155,156,157,158,159,160 Ethernet20/1 19 400000 +Ethernet160 161,162,163,164,165,166,167,168 Ethernet21/1 20 400000 +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 21 400000 +Ethernet176 177,178,179,180,181,182,183,184 Ethernet23/1 22 400000 +Ethernet184 185,186,187,188,189,190,191,192 Ethernet24/1 23 400000 +Ethernet192 193,194,195,196,197,198,199,200 Ethernet25/1 24 400000 +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 25 400000 +Ethernet208 209,210,211,212,213,214,215,216 Ethernet27/1 26 400000 +Ethernet216 217,218,219,220,221,222,223,224 Ethernet28/1 27 400000 +Ethernet224 225,226,227,228,229,230,231,232 Ethernet29/1 28 400000 +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 29 400000 +Ethernet240 241,242,243,244,245,246,247,248 Ethernet31/1 30 400000 +Ethernet248 249,250,251,252,253,254,255,256 Ethernet32/1 31 400000 +Ethernet256 257 Ethernet33 32 10000 +Ethernet257 259 Ethernet34 33 10000 diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/sai.profile b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/sai.profile new file mode 100644 index 000000000000..a7036707c012 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td4-s9300-32x400G.config.yml diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml new file mode 100644 index 000000000000..a661adfdc4a4 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml @@ -0,0 +1,671 @@ +#r1.0.0 +# +# BCM56880 32x400g port configuration. +# +# configuration yaml file +# device: +# : +# : +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +device: + 0: + DEVICE_CONFIG: + # CORE CLOCK FREQUENCY + CORE_CLK_FREQ: CLK_1350MHZ + # PP CLOCK FREQUENCY + PP_CLK_FREQ: CLK_1350MHZ + VARIANT: DNA_4_9_5_0 +... +--- +device: + 0: + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + TM_SCHEDULER_CONFIG: + NUM_MC_Q: NUM_MC_Q_4 +... +--- +bcm_device: + 0: + global: + sai_remap_prio_on_tnl_egress: 1 + global_flexctr_ing_action_num_reserved: 32 + global_flexctr_ing_group_num_reserved: 2 + global_flexctr_ing_pool_num_reserved: 12 + global_flexctr_ing_quant_num_reserved: 2 + global_flexctr_ing_op_profile_num_reserved: 32 + l3_intf_vlan_split_egress: 1 + pktio_mode: 1 + bcm_tunnel_term_compatible_mode: 1 + vlan_flooding_l2mc_num_reserved: 0 + l3_alpm_template: 1 + l3_alpm2_bnk_threshold: 100 + l2_hitbit_enable: 0 + uft_mode: 1 + l3_enable: 1 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + sai_tunnel_support: 0 + flexctr_action_reserved_ipmc_hitbit: 1 + sai_nbr_bcast_ifp_optimized: 1 + use_all_splithorizon_groups: 1 + riot_enable: 1 + riot_overlay_l3_intf_mem_size: 8192 + riot_overlay_l3_egress_mem_size: 32768 + l3_ecmp_levels: 2 + riot_overlay_ecmp_resilient_hash_size: 16384 + sai_feat_tail_timestamp: 1 + sai_port_queue_ecn_counter: 1 + sai_field_group_auto_prioritize: 1 +... +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + # CPU port + PORT_ID: 0 + : + PC_PHYS_PORT_ID: 0 + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 20 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 21 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 40 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 41 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 42 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 43 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 60 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 61 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 62 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 63 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 81 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 82 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 83 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 103 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 120 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 140 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 141 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 142 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 249 + ? + # management port + PORT_ID: 38 + : + PC_PHYS_PORT_ID: 257 + ? + # management port + PORT_ID: 118 + : + PC_PHYS_PORT_ID: 259 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: 0 + : + &port_mode_10g + ENABLE: 0 + SPEED: 10000 + NUM_LANES: 1 + ? + PORT_ID: [[1, 4], + [20, 23], + [40, 43], + [60, 63], + [80, 83], + [100, 103], + [120, 123], + [140, 143]] + : + &port_mode_400g + ENABLE: 0 + SPEED: 400000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + LINK_TRAINING: 1 + MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [38, # Management port 0 (Pipe 1) + 118] # Management port 1 (Pipe 3) + : + &port_mode_10g_xfi + ENABLE: 0 + SPEED: 10000 + NUM_LANES: 1 + MAX_FRAME_SIZE: 9416 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 +... +# +# $Copyright: (c) 2019 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM56880 PC_PM_CORE configuration for K board. +# +# $Copyright:.$ +# + +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x27413065 + TX_LANE_MAP: 0x46270513 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x4d + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02741365 + TX_LANE_MAP: 0x51306274 + RX_POLARITY_FLIP: 0xfd + TX_POLARITY_FLIP: 0x2c + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x65731402 + TX_LANE_MAP: 0x04731265 + RX_POLARITY_FLIP: 0xf5 + TX_POLARITY_FLIP: 0xba + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x01563427 + TX_LANE_MAP: 0x45231706 + RX_POLARITY_FLIP: 0x35 + TX_POLARITY_FLIP: 0xe4 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63047521 + TX_LANE_MAP: 0x41706253 + RX_POLARITY_FLIP: 0xf5 + TX_POLARITY_FLIP: 0xf2 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20643175 + TX_LANE_MAP: 0x65237410 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0x7f + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x64307521 + TX_LANE_MAP: 0x12650437 + RX_POLARITY_FLIP: 0xf5 + TX_POLARITY_FLIP: 0xde + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23417065 + TX_LANE_MAP: 0x46231705 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0xb5 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32406175 + TX_LANE_MAP: 0x16370425 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x45 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x74306521 + TX_LANE_MAP: 0x01352674 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x06 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x21743065 + TX_LANE_MAP: 0x41537062 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x37 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67042531 + TX_LANE_MAP: 0x74530162 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x42 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x10652437 + TX_LANE_MAP: 0x76051324 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0xc5 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x65037412 + TX_LANE_MAP: 0x04731562 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x08 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02741365 + TX_LANE_MAP: 0x60425371 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0xc4 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32506174 + TX_LANE_MAP: 0x01235764 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0xfc + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32416075 + TX_LANE_MAP: 0x15430627 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x4d + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x12740365 + TX_LANE_MAP: 0x61405372 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0x41 + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x65037412 + TX_LANE_MAP: 0x01247653 + RX_POLARITY_FLIP: 0xf5 + TX_POLARITY_FLIP: 0xf6 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x10652437 + TX_LANE_MAP: 0x41507263 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0xf7 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23561704 + TX_LANE_MAP: 0x62437051 + RX_POLARITY_FLIP: 0xf5 + TX_POLARITY_FLIP: 0x7a + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20743165 + TX_LANE_MAP: 0x42537160 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0xf7 + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x74206531 + TX_LANE_MAP: 0x03471562 + RX_POLARITY_FLIP: 0xf5 + TX_POLARITY_FLIP: 0xf9 + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23406175 + TX_LANE_MAP: 0x60217453 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0x75 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23506174 + TX_LANE_MAP: 0x75243016 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x04 + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x64307521 + TX_LANE_MAP: 0x57134602 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x0e + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x30742165 + TX_LANE_MAP: 0x30645172 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x25 + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76042531 + TX_LANE_MAP: 0x31657024 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x2a + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23651407 + TX_LANE_MAP: 0x26034715 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x47 + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17425603 + TX_LANE_MAP: 0x07431625 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x0c + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x12740365 + TX_LANE_MAP: 0x74503162 + RX_POLARITY_FLIP: 0x0a + TX_POLARITY_FLIP: 0x1f + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32406175 + TX_LANE_MAP: 0x32147605 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0x55 +... + + diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/custom_led.bin b/device/ufispace/x86_64-ufispace_s9300_32d-r0/custom_led.bin new file mode 100644 index 0000000000000000000000000000000000000000..1cbd43d6a5f1d6e1da31a2b34dbe7888311c98b0 GIT binary patch literal 356 zcmYkyJxBs!9LMqJQG3y;cPONM?lMq`kP0dqx=a6H&`@FYLfE|sS6f?+*${0xN>fdB z(oob8*dVtQEnbsBgH6&9*w|#hwuaC0<=eQ=&?+rbf*N;$ARFd#JjF-6;Uam$HucV3 zQZ$%Wca<%&2lAw^r3bHBoAtFBigi?vtrF=8KGU_|r%t*}$yc+bB(YIeX-Y{;U-8%e z9}ygXm5-m@`X=O9)#b9Y%>>t4Bvosda#~q)^j5)*ZlM@C!!ddUH;05`=1j*7$=yA4P*i<#ZRw@HKp7fSU)^P@)MrblRGI_=Iox0nQoo!Y>}STr2

+ Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog b/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog new file mode 100644 index 000000000000..a4e712e2a1aa --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog @@ -0,0 +1,6 @@ +sonic-ufispace-platform-modules (1.0.0) unstable; urgency=low + + * Add support for S9300-32D. + + -- Ufispace Thur, 27 Apr 2023 17:10:58 +0800 + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/compat b/platform/broadcom/sonic-platform-modules-ufispace/debian/compat new file mode 100644 index 000000000000..ec635144f600 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/compat @@ -0,0 +1 @@ +9 diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/control b/platform/broadcom/sonic-platform-modules-ufispace/debian/control new file mode 100644 index 000000000000..afee144752e2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/control @@ -0,0 +1,11 @@ +Source: sonic-ufispace-platform-modules +Section: main +Priority: extra +Maintainer: Leo Lin +Build-Depends: debhelper (>= 9), bzip2 +Standards-Version: 1.0.0 + +Package: sonic-platform-ufispace-s9300-32d +Architecture: amd64 +Description: This package contains s9300-32d platform driver utility for SONiC project. + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/rules b/platform/broadcom/sonic-platform-modules-ufispace/debian/rules new file mode 100755 index 000000000000..78a77f9b5b69 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/rules @@ -0,0 +1,88 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +include /usr/share/dpkg/pkg-info.mk + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export INSTALL_MOD_DIR:=extra + +PYTHON3 ?= python3 + +PACKAGE_PRE_NAME := sonic-platform-ufispace +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +MODULE_DIRS:= s9300-32d +MODULE_DIR := modules +UTILS_DIR := utils +SERVICE_DIR := service +CONF_DIR := conf + +%: + dh $@ --with systemd,python3 --buildsystem=pybuild + +clean: + dh_testdir + dh_testroot + dh_clean + (for mod in $(MODULE_DIRS); do \ + make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \ + done) + + + +build: + (for mod in $(MODULE_DIRS); do \ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ + cd -; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + if [ -f sonic_platform_setup.py ]; then \ + $(PYTHON3) sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ + echo "Finished makig whl package for $$mod"; \ + fi; \ + cd -; \ + done) + +binary: binary-arch binary-indep + +binary-arch: + +binary-indep: + dh_testdir + dh_installdirs + (for mod in $(MODULE_DIRS); do \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/local/bin; \ + cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin; \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \ + cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + cd -; \ + done) + + # Resuming debhelper scripts + dh_testroot + dh_install + dh_installchangelogs + dh_installdocs + dh_systemd_enable + dh_installinit + dh_systemd_start + dh_link + dh_fixperms + dh_compress + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +.PHONY: build binary binary-arch binary-indep clean diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.install b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.install new file mode 100644 index 000000000000..259b3fc53a0e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.install @@ -0,0 +1 @@ +s9300-32d/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-ufispace_s9300_32d-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.postinst b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.postinst new file mode 100644 index 000000000000..01666039ca26 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.postinst @@ -0,0 +1,3 @@ +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/Makefile b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/Makefile new file mode 100644 index 000000000000..4db5a53a1f2c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/Makefile @@ -0,0 +1,6 @@ + +MODULE_NAME = x86-64-ufispace-s9300-32d-cpld.o x86-64-ufispace-s9300-32d-sys-eeprom.o x86-64-ufispace-s9300-32d-lpc.o pddf_custom_sysstatus_module.o +obj-m := $(MODULE_NAME) + +CFLAGS_pddf_custom_sysstatus_module.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c new file mode 100644 index 000000000000..7a0b03a70d65 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c @@ -0,0 +1,265 @@ +/* + * Copyright 2019 Broadcom. + * The term ¡§Broadcom¡¨ refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + * A pddf kernel module for system status registers + */ + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" +#include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" + + +SYSSTATUS_DATA sysstatus_data = {0}; + +extern int board_i2c_cpld_read(unsigned short cpld_addr, u8 reg); +extern int board_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); + +static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count); +ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, char *buf); +ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count); + + +PDDF_DATA_ATTR(attr_name, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_CHAR, 32, + (void*)&sysstatus_data.sysstatus_addr_attr.aname, NULL); +PDDF_DATA_ATTR(attr_devaddr, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.devaddr , NULL); +PDDF_DATA_ATTR(attr_offset, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.offset, NULL); +PDDF_DATA_ATTR(attr_mask, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.mask , NULL); +PDDF_DATA_ATTR(attr_len, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.len , NULL); +PDDF_DATA_ATTR(attr_ops, S_IWUSR, NULL, do_attr_operation, PDDF_CHAR, 8, (void*)&sysstatus_data, NULL); + + + +static struct attribute *sysstatus_addr_attributes[] = { + &attr_attr_name.dev_attr.attr, + &attr_attr_devaddr.dev_attr.attr, + &attr_attr_offset.dev_attr.attr, + &attr_attr_mask.dev_attr.attr, + &attr_attr_len.dev_attr.attr, + &attr_attr_ops.dev_attr.attr, + NULL +}; + +PDDF_DATA_ATTR(board_info, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld1_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld2_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld3_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(mac_reset, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(mux_reset, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(psu_status, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(system_led_0, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(system_led_1, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(beacon_led, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(port_led_clr_ctrl, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); + +static struct attribute *sysstatus_data_attributes[] = { + &attr_board_info.dev_attr.attr, + &attr_cpld1_version.dev_attr.attr, + &attr_cpld2_version.dev_attr.attr, + &attr_cpld3_version.dev_attr.attr, + &attr_mac_reset.dev_attr.attr, + &attr_mux_reset.dev_attr.attr, + &attr_psu_status.dev_attr.attr, + &attr_system_led_0.dev_attr.attr, + &attr_system_led_1.dev_attr.attr, + &attr_beacon_led.dev_attr.attr, + &attr_port_led_clr_ctrl.dev_attr.attr, + NULL +}; + + +static const struct attribute_group pddf_sysstatus_addr_group = { + .attrs = sysstatus_addr_attributes, +}; + + +static const struct attribute_group pddf_sysstatus_data_group = { + .attrs = sysstatus_data_attributes, +}; + + +static struct kobject *sysstatus_addr_kobj; +static struct kobject *sysstatus_data_kobj; + + + +ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, char *buf) +{ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + + SYSSTATUS_DATA *data = &sysstatus_data; + struct SYSSTATUS_ADDR_ATTR *sysstatus_addr_attrs = NULL; + int i, status ; + + + for (i=0;isysstatus_addr_attrs[i].aname, attr->dev_attr.attr.name) == 0 ) + { + sysstatus_addr_attrs = &data->sysstatus_addr_attrs[i]; + + } + } + + if (sysstatus_addr_attrs==NULL ) + { + printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + status = 0; + } + else + { + status = board_i2c_cpld_read( sysstatus_addr_attrs->devaddr, sysstatus_addr_attrs->offset); + } + + return sprintf(buf, "0x%x\n", (status&sysstatus_addr_attrs->mask)); + +} + +ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + + SYSSTATUS_DATA *data = &sysstatus_data; + struct SYSSTATUS_ADDR_ATTR *sysstatus_addr_attrs = NULL; + int i, status ; + u8 reg_val; + + for (i=0;isysstatus_addr_attrs[i].aname, attr->dev_attr.attr.name) == 0 ) + { + sysstatus_addr_attrs = &data->sysstatus_addr_attrs[i]; + } + } + + if (sysstatus_addr_attrs==NULL) + { + printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + return -EINVAL; + } + else + { + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + status = board_i2c_cpld_write(sysstatus_addr_attrs->devaddr, sysstatus_addr_attrs->offset, reg_val); + + if (status!=0) + { + printk(KERN_DEBUG "store_sysstatus_data() %s failed, status=%d\n",data->sysstatus_addr_attrs[i].aname, status); + return status; + } + } + + return count; +} + + + +static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + PDDF_ATTR *ptr = (PDDF_ATTR *)da; + SYSSTATUS_DATA *pdata = (SYSSTATUS_DATA *)(ptr->addr); + + pdata->sysstatus_addr_attrs[pdata->len] = pdata->sysstatus_addr_attr; + pdata->len++; + pddf_dbg(SYSSTATUS, KERN_ERR "%s: Populating the data for %s\n", __FUNCTION__, pdata->sysstatus_addr_attr.aname); +#ifdef __STDC_LIB_EXT1__ + memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr), 0, sizeof(pdata->sysstatus_addr_attr)); +#else + memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); +#endif + + return count; +} + + + + +int __init sysstatus_data_init(void) +{ + struct kobject *device_kobj; + int ret = 0; + + + pddf_dbg(SYSSTATUS, "PDDF SYSSTATUS MODULE.. init\n"); + + device_kobj = get_device_i2c_kobj(); + if(!device_kobj) + return -ENOMEM; + + sysstatus_addr_kobj = kobject_create_and_add("sysstatus", device_kobj); + if(!sysstatus_addr_kobj) + return -ENOMEM; + + sysstatus_data_kobj = kobject_create_and_add("sysstatus_data", sysstatus_addr_kobj); + if(!sysstatus_data_kobj) + return -ENOMEM; + + + ret = sysfs_create_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + if (ret) + { + kobject_put(sysstatus_addr_kobj); + return ret; + } + + ret = sysfs_create_group(sysstatus_data_kobj, &pddf_sysstatus_data_group); + if (ret) + { + sysfs_remove_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + kobject_put(sysstatus_data_kobj); + kobject_put(sysstatus_addr_kobj); + return ret; + } + + + return ret; +} + +void __exit sysstatus_data_exit(void) +{ + pddf_dbg(SYSSTATUS, "PDDF SYSSTATUS MODULE.. exit\n"); + sysfs_remove_group(sysstatus_data_kobj, &pddf_sysstatus_data_group); + sysfs_remove_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + kobject_put(sysstatus_data_kobj); + kobject_put(sysstatus_addr_kobj); + pddf_dbg(SYSSTATUS, KERN_ERR "%s: Removed the kobjects for 'SYSSTATUS'\n",__FUNCTION__); + return; +} + +module_init(sysstatus_data_init); +module_exit(sysstatus_data_exit); + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("SYSSTATUS platform data"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c new file mode 100644 index 000000000000..39f6694140e2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c @@ -0,0 +1,1638 @@ +/* + * A i2c cpld driver for the ufispace_s9300_32d + * + * Copyright (C) 2017-2019 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "x86-64-ufispace-s9300-32d-cpld.h" + +#ifdef DEBUG +#define DEBUG_PRINT(fmt, args...) \ + printk(KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#else +#define DEBUG_PRINT(fmt, args...) +#endif + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define I2C_READ_BYTE_DATA(ret, lock, i2c_client, reg) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_read_byte_data(i2c_client, reg); \ + mutex_unlock(lock); \ + BSP_LOG_R("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, ret); \ +} +#define I2C_WRITE_BYTE_DATA(ret, lock, i2c_client, reg, val) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_write_byte_data(i2c_client, reg, val); \ + mutex_unlock(lock); \ + BSP_LOG_W("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, val); \ +} + +/* CPLD sysfs attributes index */ +enum s9300_cpld_sysfs_attributes { + /* CPLD1 */ + CPLD_ACCESS_REG, + CPLD_REGISTER_VAL, + CPLD_SKU_ID, + CPLD_HW_REV, + CPLD_DEPH_REV, + CPLD_BUILD_REV, + CPLD_ID_TYPE, + CPLD_MAJOR_VER, + CPLD_MINOR_VER, + CPLD_BUILD_VER, + CPLD_VERION_H, + CPLD_ID, + CPLD_MAC_INTR, + CPLD_10G_PHY_INTR, + CPLD_CPLD_FRU_INTR, + CPLD_THERMAL_ALERT_INTR, + CPLD_MISC_INTR, + CPLD_SYSTEM_INTR, + CPLD_MAC_INTR_MASK, + CPLD_10G_PHY_INTR_MASK, + CPLD_CPLD_FRU_INTR_MASK, + CPLD_THERMAL_ALERT_INTR_MASK, + CPLD_MISC_INTR_MASK, + CPLD_MAC_INTR_EVENT, + CPLD_10G_PHY_INTR_EVENT, + CPLD_CPLD_FRU_INTR_EVENT, + CPLD_THERMAL_ALERT_INTR_EVENT, + CPLD_MISC_INTR_EVENT, + CPLD_MAC_RST, + CPLD_10G_PHY_RST, + CPLD_BMC_RST, + CPLD_USB_RST, + CPLD_MUX_RST, + CPLD_MISC_RST, + CPLD_BMC_WATCHDOG, + CPLD_DAU_BD_PRES, + CPLD_PSU_STATUS, + CPLD_SYS_PW_STATUS, + CPLD_MISC, + CPLD_MUX_CTRL, + CPLD_MAC_QSFP_SEL_CTRL, + CPLD_SYS_LED_CTRL_1, + CPLD_SYS_LED_CTRL_2, + CPLD_BEACON_LED_CTRL, + CPLD_PORT_LED_CLR_CTRL, + CPLD_EVENT_DETECT_CTRL, + /* CPLD2 */ + CPLD_QSFPDD_MOD_INT_G0, + CPLD_QSFPDD_MOD_INT_G1, + CPLD_QSFPDD_MOD_INT_G2, + CPLD_QSFPDD_MOD_INT_G3, + CPLD_QSFPDD_PRES_G0, + CPLD_QSFPDD_PRES_G1, + CPLD_QSFPDD_PRES_G2, + CPLD_QSFPDD_PRES_G3, + CPLD_QSFPDD_FUSE_INT_G0, + CPLD_QSFPDD_FUSE_INT_G1, + CPLD_QSFPDD_FUSE_INT_G2, + CPLD_QSFPDD_FUSE_INT_G3, + CPLD_SFP_TXFAULT, + CPLD_SFP_ABS, + CPLD_SFP_RXLOS, + CPLD_QSFPDD_MOD_INT_MASK_G0, + CPLD_QSFPDD_MOD_INT_MASK_G1, + CPLD_QSFPDD_MOD_INT_MASK_G2, + CPLD_QSFPDD_MOD_INT_MASK_G3, + CPLD_QSFPDD_PRES_MASK_G0, + CPLD_QSFPDD_PRES_MASK_G1, + CPLD_QSFPDD_PRES_MASK_G2, + CPLD_QSFPDD_PRES_MASK_G3, + CPLD_QSFPDD_FUSE_INT_MASK_G0, + CPLD_QSFPDD_FUSE_INT_MASK_G1, + CPLD_QSFPDD_FUSE_INT_MASK_G2, + CPLD_QSFPDD_FUSE_INT_MASK_G3, + CPLD_SFP_TXFAULT_MASK, + CPLD_SFP_ABS_MASK, + CPLD_SFP_RXLOS_MASK, + CPLD_QSFPDD_MOD_INT_EVENT_G0, + CPLD_QSFPDD_MOD_INT_EVENT_G1, + CPLD_QSFPDD_MOD_INT_EVENT_G2, + CPLD_QSFPDD_MOD_INT_EVENT_G3, + CPLD_QSFPDD_PRES_EVENT_G0, + CPLD_QSFPDD_PRES_EVENT_G1, + CPLD_QSFPDD_PRES_EVENT_G2, + CPLD_QSFPDD_PRES_EVENT_G3, + CPLD_QSFPDD_FUSE_INT_EVENT_G0, + CPLD_QSFPDD_FUSE_INT_EVENT_G1, + CPLD_QSFPDD_FUSE_INT_EVENT_G2, + CPLD_QSFPDD_FUSE_INT_EVENT_G3, + CPLD_SFP_TXFAULT_EVENT, + CPLD_SFP_ABS_EVENT, + CPLD_SFP_RXLOS_EVENT, + CPLD_QSFPDD_RESET_CTRL_G0, + CPLD_QSFPDD_RESET_CTRL_G1, + CPLD_QSFPDD_RESET_CTRL_G2, + CPLD_QSFPDD_RESET_CTRL_G3, + CPLD_QSFPDD_LP_MODE_G0, + CPLD_QSFPDD_LP_MODE_G1, + CPLD_QSFPDD_LP_MODE_G2, + CPLD_QSFPDD_LP_MODE_G3, + CPLD_SFP_TX_DIS, + CPLD_SFP_RS, + CPLD_SFP_TS, + CPLD_PORT_INT_STATUS, + + //BSP DEBUG + BSP_DEBUG +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +/* CPLD sysfs attributes hook functions */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf); +// cpld access api +static ssize_t read_cpld_reg(struct device *dev, char *buf, u8 reg); +static ssize_t write_cpld_reg(struct device *dev, const char *buf, size_t count, u8 reg); +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno); +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val); +// bsp debug api +static ssize_t read_bsp(char *buf, char *str); +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count); +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); + +static LIST_HEAD(cpld_client_list); /* client list for cpld */ +static struct mutex list_lock; /* mutex for client list */ + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +struct cpld_data { + int index; /* CPLD index */ + struct mutex access_lock; /* mutex for cpld access */ + u8 access_reg; /* register to access */ +}; + +/* CPLD device id and data */ +static const struct i2c_device_id s9300_cpld_id[] = { + { "s9300_32d_cpld1", cpld1 }, + { "s9300_32d_cpld2", cpld2 }, + { "s9300_32d_cpld3", cpld3 }, + {} +}; + +char bsp_debug[2]="0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; + +/* Addresses scanned for s9300_cpld */ +static const unsigned short cpld_i2c_addr[] = { 0x30, 0x31, 0x32, I2C_CLIENT_END }; + +/* define all support register access of cpld in attribute */ +/* CPLD1 */ +static SENSOR_DEVICE_ATTR(cpld_access_register, S_IWUSR | S_IRUGO, \ + read_access_register, write_access_register, CPLD_ACCESS_REG); +static SENSOR_DEVICE_ATTR(cpld_register_value, S_IWUSR | S_IRUGO, \ + read_register_value, write_register_value, CPLD_REGISTER_VAL); +static SENSOR_DEVICE_ATTR(cpld_sku_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SKU_ID); +static SENSOR_DEVICE_ATTR(cpld_hw_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_HW_REV); +static SENSOR_DEVICE_ATTR(cpld_deph_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_DEPH_REV); +static SENSOR_DEVICE_ATTR(cpld_build_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_BUILD_REV); +static SENSOR_DEVICE_ATTR(cpld_id_type, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_ID_TYPE); +static SENSOR_DEVICE_ATTR(cpld_major_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MAJOR_VER); +static SENSOR_DEVICE_ATTR(cpld_minor_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MINOR_VER); +static SENSOR_DEVICE_ATTR(cpld_build_ver, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_BUILD_VER); +static SENSOR_DEVICE_ATTR(cpld_version_h, S_IRUGO, \ + read_cpld_version_h_cb, NULL, CPLD_VERION_H); +static SENSOR_DEVICE_ATTR(cpld_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_ID); +static SENSOR_DEVICE_ATTR(cpld_mac_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR); +static SENSOR_DEVICE_ATTR(cpld_misc_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR); +static SENSOR_DEVICE_ATTR(cpld_system_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYSTEM_INTR); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_CPLD_FRU_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_THERMAL_ALERT_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_mac_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_RST); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_RST); +static SENSOR_DEVICE_ATTR(cpld_usb_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_USB_RST); +static SENSOR_DEVICE_ATTR(cpld_mux_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_RST); +static SENSOR_DEVICE_ATTR(cpld_misc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_watchdog, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_WATCHDOG); +static SENSOR_DEVICE_ATTR(cpld_dau_bd_pres, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_DAU_BD_PRES); +static SENSOR_DEVICE_ATTR(cpld_psu_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PSU_STATUS); +static SENSOR_DEVICE_ATTR(cpld_sys_pw_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_PW_STATUS); +static SENSOR_DEVICE_ATTR(cpld_misc, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC); +static SENSOR_DEVICE_ATTR(cpld_mux_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_CTRL); +static SENSOR_DEVICE_ATTR(cpld_mac_qsfp_sel_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_QSFP_SEL_CTRL); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_1); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_2); +static SENSOR_DEVICE_ATTR(cpld_beacon_led_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BEACON_LED_CTRL); +static SENSOR_DEVICE_ATTR(cpld_port_led_clr_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_PORT_LED_CLR_CTRL); +static SENSOR_DEVICE_ATTR(cpld_event_detect_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_EVENT_DETECT_CTRL); +/* CPLD2 */ +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TXFAULT_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_ABS_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RXLOS_MASK); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g3, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g3, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_tx_dis, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TX_DIS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rs, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RS); +static SENSOR_DEVICE_ATTR(cpld_sfp_ts, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TS); +static SENSOR_DEVICE_ATTR(cpld_port_int_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PORT_INT_STATUS); +//BSP DEBUG +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, \ + read_bsp_callback, write_bsp_callback, BSP_DEBUG); + +/* define support attributes of cpldx , total 3 */ +/* cpld 1 */ +static struct attribute *s9300_cpld1_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_sku_id.dev_attr.attr, + &sensor_dev_attr_cpld_hw_rev.dev_attr.attr, + &sensor_dev_attr_cpld_deph_rev.dev_attr.attr, + &sensor_dev_attr_cpld_build_rev.dev_attr.attr, + &sensor_dev_attr_cpld_id_type.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr.dev_attr.attr, + &sensor_dev_attr_cpld_system_intr.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_mac_rst.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_usb_rst.dev_attr.attr, + &sensor_dev_attr_cpld_mux_rst.dev_attr.attr, + &sensor_dev_attr_cpld_misc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_watchdog.dev_attr.attr, + &sensor_dev_attr_cpld_dau_bd_pres.dev_attr.attr, + &sensor_dev_attr_cpld_psu_status.dev_attr.attr, + &sensor_dev_attr_cpld_sys_pw_status.dev_attr.attr, + &sensor_dev_attr_cpld_misc.dev_attr.attr, + &sensor_dev_attr_cpld_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_mac_qsfp_sel_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_1.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_2.dev_attr.attr, + &sensor_dev_attr_cpld_beacon_led_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_port_led_clr_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_event_detect_ctrl.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + NULL +}; + +/* cpld 2 */ +static struct attribute *s9300_cpld2_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_mask.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_event.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_tx_dis.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_ts.dev_attr.attr, + &sensor_dev_attr_cpld_port_int_status.dev_attr.attr, + NULL +}; + +/* cpld 3 */ +static struct attribute *s9300_cpld3_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + NULL +}; + +/* cpld 1 attributes group */ +static const struct attribute_group s9300_cpld1_group = { + .attrs = s9300_cpld1_attributes, +}; +/* cpld 2 attributes group */ +static const struct attribute_group s9300_cpld2_group = { + .attrs = s9300_cpld2_attributes, +}; +/* cpld 3 attributes group */ +static const struct attribute_group s9300_cpld3_group = { + .attrs = s9300_cpld3_attributes, +}; + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if ((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write)) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + len=sprintf(buf, "%s", str); + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + snprintf(str, str_len, "%s", buf); + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch (attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + ssize_t ret = 0; + u8 bsp_debug_u8 = 0; + + switch (attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(str); + ret = write_bsp(buf, str, str_len, count); + + if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if (_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + return ret; + default: + return -EINVAL; + } + return 0; +} + +/* read access register from cpld data */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + + return sprintf(buf, "0x%x\n", reg); +} + +/* write access register to cpld data */ +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg; + + if (kstrtou8(buf, 0, ®) < 0) + return -EINVAL; + + data->access_reg = reg; + return count; +} + +/* read the value of access register in cpld data */ +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + int reg_val; + + I2C_READ_BYTE_DATA(reg_val, &data->access_lock, client, reg); + + if (reg_val < 0) + return reg_val; + + return sprintf(buf, "0x%x\n", reg_val); +} + +/* wrtie the value to access register in cpld data */ +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + int ret = -EIO; + u8 reg = data->access_reg; + u8 reg_val; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, client, reg, reg_val); + + if (unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* get cpld register value */ +static ssize_t read_cpld_reg(struct device *dev, + char *buf, + u8 reg) +{ + int reg_val; + + if (read_cpld_reg_raw_int(dev, reg, ®_val)) + return sprintf(buf, "0x%02x\n", reg_val); + else + return reg_val; +} + +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + I2C_READ_BYTE_DATA(*val, &data->access_lock, client, reg); + if (unlikely(*val < 0)) { + dev_err(dev, "read_cpld_reg_raw_int() error, return=%d\n", *val); + return false; + } + return true; +} + +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno) +{ + int reg_val; + + if (read_cpld_reg_raw_int(dev, reg, ®_val)) { + *val = (u8)reg_val; + return true; + } else { + *errno = reg_val; + return false; + } +} + +/* handle read for attributes */ +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch (attr->index) { + case CPLD_SKU_ID: + reg = CPLD_SKU_ID_REG; + break; + case CPLD_ID: + reg = CPLD_ID_REG; + break; + case CPLD_BUILD_VER: + reg = CPLD_BUILD_VER_REG; + break; + case CPLD_MAC_INTR: + reg = CPLD_MAC_INTR_REG; + break; + case CPLD_10G_PHY_INTR: + reg = CPLD_10G_PHY_INTR_REG; + break; + case CPLD_CPLD_FRU_INTR: + reg = CPLD_CPLD_FRU_INTR_REG; + break; + case CPLD_THERMAL_ALERT_INTR: + reg = CPLD_THERMAL_ALERT_INTR_REG; + break; + case CPLD_MISC_INTR: + reg = CPLD_MISC_INTR_REG; + break; + case CPLD_SYSTEM_INTR: + reg = CPLD_SYSTEM_INTR_REG; + break; + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_INTR_EVENT: + reg = CPLD_MAC_INTR_EVENT_REG; + break; + case CPLD_10G_PHY_INTR_EVENT: + reg = CPLD_10G_PHY_INTR_EVENT_REG; + break; + case CPLD_CPLD_FRU_INTR_EVENT: + reg = CPLD_CPLD_FRU_INTR_EVENT_REG; + break; + case CPLD_THERMAL_ALERT_INTR_EVENT: + reg = CPLD_THERMAL_ALERT_INTR_EVENT_REG; + break; + case CPLD_MISC_INTR_EVENT: + reg = CPLD_MISC_INTR_EVENT_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_DAU_BD_PRES: + reg = CPLD_DAU_BD_PRES_REG; + break; + case CPLD_PSU_STATUS: + reg = CPLD_PSU_STATUS_REG; + break; + case CPLD_SYS_PW_STATUS: + reg = CPLD_SYS_PW_STATUS_REG; + break; + case CPLD_MISC: + reg = CPLD_MISC_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_SYS_LED_CTRL_1: + reg = CPLD_SYS_LED_CTRL_1_REG; + break; + case CPLD_SYS_LED_CTRL_2: + reg = CPLD_SYS_LED_CTRL_2_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFPDD_MOD_INT_G0: + reg = CPLD_QSFPDD_MOD_INT_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_G1: + reg = CPLD_QSFPDD_MOD_INT_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_G2: + reg = CPLD_QSFPDD_MOD_INT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_G3: + reg = CPLD_QSFPDD_MOD_INT_G3_REG; + break; + case CPLD_QSFPDD_PRES_G0: + reg = CPLD_QSFPDD_PRES_G0_REG; + break; + case CPLD_QSFPDD_PRES_G1: + reg = CPLD_QSFPDD_PRES_G1_REG; + break; + case CPLD_QSFPDD_PRES_G2: + reg = CPLD_QSFPDD_PRES_G2_REG; + break; + case CPLD_QSFPDD_PRES_G3: + reg = CPLD_QSFPDD_PRES_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G0: + reg = CPLD_QSFPDD_FUSE_INT_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G1: + reg = CPLD_QSFPDD_FUSE_INT_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G2: + reg = CPLD_QSFPDD_FUSE_INT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G3: + reg = CPLD_QSFPDD_FUSE_INT_G3_REG; + break; + case CPLD_SFP_TXFAULT: + reg = CPLD_SFP_TXFAULT_REG; + break; + case CPLD_SFP_ABS: + reg = CPLD_SFP_ABS_REG; + break; + case CPLD_SFP_RXLOS: + reg = CPLD_SFP_RXLOS_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G0: + reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G1: + reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G2: + reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G3: + reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G0: + reg = CPLD_QSFPDD_PRES_MASK_G0_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G1: + reg = CPLD_QSFPDD_PRES_MASK_G1_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G2: + reg = CPLD_QSFPDD_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G3: + reg = CPLD_QSFPDD_PRES_MASK_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G0: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G1: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G2: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G3: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G0: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G1: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G2: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G3: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G3_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G0: + reg = CPLD_QSFPDD_PRES_EVENT_G0_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G1: + reg = CPLD_QSFPDD_PRES_EVENT_G1_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G2: + reg = CPLD_QSFPDD_PRES_EVENT_G2_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G3: + reg = CPLD_QSFPDD_PRES_EVENT_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G0: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G1: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G2: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G3: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG; + break; + case CPLD_SFP_TXFAULT_EVENT: + reg = CPLD_SFP_TXFAULT_EVENT_REG; + break; + case CPLD_SFP_ABS_EVENT: + reg = CPLD_SFP_ABS_EVENT_REG; + break; + case CPLD_SFP_RXLOS_EVENT: + reg = CPLD_SFP_RXLOS_EVENT_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G0: + reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G1: + reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G2: + reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G3: + reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; + break; + case CPLD_QSFPDD_LP_MODE_G0: + reg = CPLD_QSFPDD_LP_MODE_G0_REG; + break; + case CPLD_QSFPDD_LP_MODE_G1: + reg = CPLD_QSFPDD_LP_MODE_G1_REG; + break; + case CPLD_QSFPDD_LP_MODE_G2: + reg = CPLD_QSFPDD_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE_G3: + reg = CPLD_QSFPDD_LP_MODE_G3_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + case CPLD_PORT_INT_STATUS: + reg = CPLD_PORT_INT_STATUS_REG; + break; + default: + return -EINVAL; + } + return read_cpld_reg(dev, buf, reg); +} + +/* handle read for hw_rev attributes */ +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_HW_REV_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch (attr->index) { + case CPLD_HW_REV: + HW_REV_GET(reg_val, res); + break; + case CPLD_DEPH_REV: + DEPH_REV_GET(reg_val, res); + break; + case CPLD_BUILD_REV: + BUILD_REV_GET(reg_val, res); + break; + case CPLD_ID_TYPE: + ID_TYPE_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read for cpld_version attributes */ +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch (attr->index) { + case CPLD_MAJOR_VER: + CPLD_MAJOR_VERSION_GET(reg_val, res); + break; + case CPLD_MINOR_VER: + CPLD_MINOR_VERSION_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read human-readable string for cpld_version attributes */ +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 major, minor, build; + + //get major/minor register value + if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + CPLD_MAJOR_VERSION_GET(reg_val, major); + CPLD_MINOR_VERSION_GET(reg_val, minor); + + //get build register value + reg = CPLD_BUILD_VER_REG; + if(!read_cpld_reg_raw_byte(dev, reg, &build, &errno)) + return errno; + + //version string format : xx.xx.xxx + return sprintf(buf, "%d.%02d.%03d\n", major, minor, build); +} + +/* handle write for attributes */ +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch (attr->index) { + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G0: + reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G1: + reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G2: + reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G3: + reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G0: + reg = CPLD_QSFPDD_PRES_MASK_G0_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G1: + reg = CPLD_QSFPDD_PRES_MASK_G1_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G2: + reg = CPLD_QSFPDD_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G3: + reg = CPLD_QSFPDD_PRES_MASK_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G0: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G1: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G2: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G3: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G0: + reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G1: + reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G2: + reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G3: + reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; + break; + case CPLD_QSFPDD_LP_MODE_G0: + reg = CPLD_QSFPDD_LP_MODE_G0_REG; + break; + case CPLD_QSFPDD_LP_MODE_G1: + reg = CPLD_QSFPDD_LP_MODE_G1_REG; + break; + case CPLD_QSFPDD_LP_MODE_G2: + reg = CPLD_QSFPDD_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE_G3: + reg = CPLD_QSFPDD_LP_MODE_G3_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + default: + return -EINVAL; + } + return write_cpld_reg(dev, buf, count, reg); +} + +/* set cpld register value */ +static ssize_t write_cpld_reg(struct device *dev, + const char *buf, + size_t count, + u8 reg) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg_val; + int ret; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + client, reg, reg_val); + + if (unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* add valid cpld client to list */ +static void s9300_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = NULL; + + node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + if (!node) { + dev_info(&client->dev, + "Can't allocate cpld_client_node for index %d\n", + client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +/* remove exist cpld client in list */ +static void s9300_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + + if (cpld_node->client == client) { + found = 1; + break; + } + } + + if (found) { + list_del(list_node); + kfree(cpld_node); + } + mutex_unlock(&list_lock); +} + +/* cpld drvier probe */ +static int s9300_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + int status; + struct cpld_data *data = NULL; + int ret = -EPERM; + int idx; + + data = kzalloc(sizeof(struct cpld_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* init cpld data for client */ + i2c_set_clientdata(client, data); + mutex_init(&data->access_lock); + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA)) { + dev_info(&client->dev, + "i2c_check_functionality failed (0x%x)\n", + client->addr); + status = -EIO; + goto exit; + } + + /* get cpld id from device */ + ret = i2c_smbus_read_byte_data(client, CPLD_ID_REG); + + if (ret < 0) { + dev_info(&client->dev, + "fail to get cpld id (0x%x) at addr (0x%x)\n", + CPLD_ID_REG, client->addr); + status = -EIO; + goto exit; + } + + CPLD_ID_ID_GET(ret, idx); + + if (INVALID(idx, cpld1, cpld3)) { + dev_info(&client->dev, + "cpld id %d(device) not valid\n", idx); + //status = -EPERM; + //goto exit; + } + + data->index = dev_id->driver_data; + + /* register sysfs hooks for different cpld group */ + dev_info(&client->dev, "probe cpld with index %d\n", data->index); + switch (data->index) { + case cpld1: + status = sysfs_create_group(&client->dev.kobj, + &s9300_cpld1_group); + break; + case cpld2: + status = sysfs_create_group(&client->dev.kobj, + &s9300_cpld2_group); + break; + case cpld3: + status = sysfs_create_group(&client->dev.kobj, + &s9300_cpld3_group); + break; + default: + status = -EINVAL; + } + + if (status) + goto exit; + + dev_info(&client->dev, "chip found\n"); + + /* add probe chip to client list */ + s9300_cpld_add_client(client); + + return 0; +exit: + switch (data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld3_group); + break; + default: + break; + } + return status; +} + +/* cpld drvier remove */ +static int s9300_cpld_remove(struct i2c_client *client) +{ + struct cpld_data *data = i2c_get_clientdata(client); + + switch (data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld3_group); + break; + } + + s9300_cpld_remove_client(client); + return 0; +} + +MODULE_DEVICE_TABLE(i2c, s9300_cpld_id); + +static struct i2c_driver s9300_cpld_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "x86_64_ufispace_s9300_32d_cpld", + }, + .probe = s9300_cpld_probe, + .remove = s9300_cpld_remove, + .id_table = s9300_cpld_id, + .address_list = cpld_i2c_addr, +}; + +/* provide cpld register read */ +/* cpld_idx indicate the index of cpld device */ +int s9300_cpld_read(u8 cpld_idx, + u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + if (data->index == cpld_idx) { + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x", + cpld_idx, reg); + I2C_READ_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, reg); + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x = 0x%02x", + cpld_idx, reg, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9300_cpld_read); + +/* provide cpld register write */ +/* cpld_idx indicate the index of cpld device */ +int s9300_cpld_write(u8 cpld_idx, + u8 reg, + u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + + if (data->index == cpld_idx) { + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, + reg, value); + DEBUG_PRINT("cpld_idx=%d, write reg 0x%02x val 0x%02x, ret=%d", + cpld_idx, reg, value, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9300_cpld_write); + +static int __init s9300_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&s9300_cpld_driver); +} + +static void __exit s9300_cpld_exit(void) +{ + i2c_del_driver(&s9300_cpld_driver); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9300_cpld driver"); +MODULE_LICENSE("GPL"); + +module_init(s9300_cpld_init); +module_exit(s9300_cpld_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h new file mode 100644 index 000000000000..d135e476e8cd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h @@ -0,0 +1,251 @@ +/* header file for i2c cpld driver of ufispace_s9300_32d + * + * Copyright (C) 2017 UfiSpace Technology Corporation. + * Leo Lin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef UFISPACE_S9300_I2C_CPLD_H +#define UFISPACE_S9300_I2C_CPLD_H + +/* CPLD device index value */ +enum cpld_id { + cpld1, + cpld2, + cpld3, +}; + +enum LED_BLINK { + NOBLINK, + BLINK, +}; + +enum LED_BLINK_SPEED { + BLINK_1X, // 0.5hz + BLINK_4X, // 2hz +}; + +enum LED_STATUS { + OFF, + ON, +}; + +enum LED_YELLOW { + YELLOW_OFF, + YELLOW_ON, +}; + +enum LED_GREEN { + GREEN_OFF, + GREEN_ON, +}; + +/* QSFPDD port number */ +#define QSFPDD_MAX_PORT_NUM 32 +#define QSFPDD_MIN_PORT_NUM 1 + +/* SFP+ port number */ +#define SFP_MAX_PORT_NUM 4 +#define SFP_MIN_PORT_NUM 1 + + +/* CPLD registers */ +/* CPLD 1 */ +#define CPLD_SKU_ID_REG 0x00 +#define CPLD_HW_REV_REG 0x01 +#define CPLD_VERSION_REG 0x02 +#define CPLD_ID_REG 0x03 +#define CPLD_BUILD_VER_REG 0x04 +// Interrupt status +#define CPLD_MAC_INTR_REG 0x10 +#define CPLD_10G_PHY_INTR_REG 0x13 +#define CPLD_CPLD_FRU_INTR_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_REG 0x16 +#define CPLD_MISC_INTR_REG 0x1B +#define CPLD_SYSTEM_INTR_REG 0x1D +// Interrupt mask +#define CPLD_MAC_INTR_MASK_REG 0x20 +#define CPLD_10G_PHY_INTR_MASK_REG 0x23 +#define CPLD_CPLD_FRU_INTR_MASK_REG 0x24 +#define CPLD_THERMAL_ALERT_INTR_MASK_REG 0x26 +#define CPLD_MISC_INTR_MASK_REG 0x2B +// Interrupt event +#define CPLD_MAC_INTR_EVENT_REG 0x30 +#define CPLD_10G_PHY_INTR_EVENT_REG 0x33 +#define CPLD_CPLD_FRU_INTR_EVENT_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_EVENT_REG 0x16 +#define CPLD_MISC_INTR_EVENT_REG 0x1B +// Reset ctrl +#define CPLD_MAC_RST_REG 0x40 +#define CPLD_10G_PHY_RST_REG 0x42 +#define CPLD_BMC_RST_REG 0x43 +#define CPLD_USB_RST_REG 0x44 +#define CPLD_MUX_RST_REG 0x46 +#define CPLD_MISC_RST_REG 0x48 +#define CPLD_BMC_WATCHDOG_REG 0x4D +// Sys status +#define CPLD_DAU_BD_PRES_REG 0x50 +#define CPLD_PSU_STATUS_REG 0x51 +#define CPLD_SYS_PW_STATUS_REG 0x52 +#define CPLD_MISC_REG 0x5B +// Mux ctrl +#define CPLD_MUX_CTRL_REG 0x5C +#define CPLD_MAC_QSFP_SEL_CTRL_REG 0x5F +// Led ctrl +#define CPLD_SYS_LED_CTRL_1_REG 0x80 +#define CPLD_SYS_LED_CTRL_2_REG 0x81 +#define CPLD_BEACON_LED_CTRL_REG 0x84 +#define CPLD_PORT_LED_CLR_CTRL_REG 0x85 +// Event Detect Ctrl +#define CPLD_EVENT_DETECT_CTRL_REG 0x5D + +/* CPLD 2 */ +/* G0 - port 0 ~ 7 + G1 - port 8 ~ 15 + G2 - port 16 ~ 23 + G3 - port 24 ~ 31 + */ +// Interrupt status +#define CPLD_QSFPDD_MOD_INT_G0_REG 0x10 +#define CPLD_QSFPDD_MOD_INT_G1_REG 0x11 +#define CPLD_QSFPDD_MOD_INT_G2_REG 0x12 +#define CPLD_QSFPDD_MOD_INT_G3_REG 0x13 +#define CPLD_QSFPDD_PRES_G0_REG 0x14 +#define CPLD_QSFPDD_PRES_G1_REG 0x15 +#define CPLD_QSFPDD_PRES_G2_REG 0x16 +#define CPLD_QSFPDD_PRES_G3_REG 0x17 +#define CPLD_QSFPDD_FUSE_INT_G0_REG 0x18 +#define CPLD_QSFPDD_FUSE_INT_G1_REG 0x19 +#define CPLD_QSFPDD_FUSE_INT_G2_REG 0x1A +#define CPLD_QSFPDD_FUSE_INT_G3_REG 0x1B +#define CPLD_SFP_TXFAULT_REG 0x1D +#define CPLD_SFP_ABS_REG 0x1E +#define CPLD_SFP_RXLOS_REG 0x1F +// Interrupt mask +#define CPLD_QSFPDD_MOD_INT_MASK_G0_REG 0x20 +#define CPLD_QSFPDD_MOD_INT_MASK_G1_REG 0x21 +#define CPLD_QSFPDD_MOD_INT_MASK_G2_REG 0x22 +#define CPLD_QSFPDD_MOD_INT_MASK_G3_REG 0x23 +#define CPLD_QSFPDD_PRES_MASK_G0_REG 0x24 +#define CPLD_QSFPDD_PRES_MASK_G1_REG 0x25 +#define CPLD_QSFPDD_PRES_MASK_G2_REG 0x26 +#define CPLD_QSFPDD_PRES_MASK_G3_REG 0x27 +#define CPLD_QSFPDD_FUSE_INT_MASK_G0_REG 0x28 +#define CPLD_QSFPDD_FUSE_INT_MASK_G1_REG 0x29 +#define CPLD_QSFPDD_FUSE_INT_MASK_G2_REG 0x2A +#define CPLD_QSFPDD_FUSE_INT_MASK_G3_REG 0x2B +#define CPLD_SFP_TXFAULT_MASK_REG 0x2D +#define CPLD_SFP_ABS_MASK_REG 0x2E +#define CPLD_SFP_RXLOS_MASK_REG 0x2F +// Interrupt event +#define CPLD_QSFPDD_MOD_INT_EVENT_G0_REG 0x30 +#define CPLD_QSFPDD_MOD_INT_EVENT_G1_REG 0x31 +#define CPLD_QSFPDD_MOD_INT_EVENT_G2_REG 0x32 +#define CPLD_QSFPDD_MOD_INT_EVENT_G3_REG 0x33 +#define CPLD_QSFPDD_PRES_EVENT_G0_REG 0x34 +#define CPLD_QSFPDD_PRES_EVENT_G1_REG 0x35 +#define CPLD_QSFPDD_PRES_EVENT_G2_REG 0x36 +#define CPLD_QSFPDD_PRES_EVENT_G3_REG 0x37 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG 0x38 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG 0x39 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG 0x3A +#define CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG 0x3B +#define CPLD_SFP_TXFAULT_EVENT_REG 0x3D +#define CPLD_SFP_ABS_EVENT_REG 0x3E +#define CPLD_SFP_RXLOS_EVENT_REG 0x3F +// Port ctrl +#define CPLD_QSFPDD_RESET_CTRL_G0_REG 0x40 +#define CPLD_QSFPDD_RESET_CTRL_G1_REG 0x41 +#define CPLD_QSFPDD_RESET_CTRL_G2_REG 0x42 +#define CPLD_QSFPDD_RESET_CTRL_G3_REG 0x43 +#define CPLD_QSFPDD_LP_MODE_G0_REG 0x44 +#define CPLD_QSFPDD_LP_MODE_G1_REG 0x45 +#define CPLD_QSFPDD_LP_MODE_G2_REG 0x46 +#define CPLD_QSFPDD_LP_MODE_G3_REG 0x47 +#define CPLD_SFP_TX_DIS_REG 0x55 +#define CPLD_SFP_RS_REG 0x56 +#define CPLD_SFP_TS_REG 0x57 +// Port status +#define CPLD_PORT_INT_STATUS_REG 0x58 + + +/* bit field structure for register value */ +struct cpld_reg_sku_id_t { + u8 model_id:8; +}; + +struct cpld_reg_hw_rev_t { + u8 hw_rev:2; + u8 deph_rev:1; + u8 build_rev:3; + u8 reserved:1; + u8 id_type:1; +}; + +struct cpld_reg_version_t { + u8 minor:6; + u8 major:2; +}; + +struct cpld_reg_id_t { + u8 id:3; + u8 release:5; +}; + +struct cpld_reg_beacon_led_ctrl_t { + u8 reserve:5; + u8 speed:1; + u8 blink:1; + u8 onoff:1; +}; + +/* common manipulation */ +#define INVALID(i, min, max) ((i < min) || (i > max) ? 1u : 0u) +#define READ_BIT(val, bit) ((0u == (val & (1<bf_name) +#define READ_BF_1(bf_struct, val, bf_name, bf_value) \ + bf_struct bf; \ + bf.data = val; \ + bf_value = bf.bf_name +#define HW_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, hw_rev, res) +#define DEPH_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, deph_rev, res) +#define BUILD_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, build_rev, res) +#define ID_TYPE_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, id_type, res) +#define CPLD_MAJOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, major, res) +#define CPLD_MINOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, minor, res) +#define CPLD_ID_ID_GET(val, res) \ + READ_BF(cpld_reg_id_t, val, id, res) + +/* CPLD access functions */ +extern int s9300_cpld_read(u8 cpld_idx, u8 reg); +extern int s9300_cpld_write(u8 cpld_idx, u8 reg, u8 value); + +#endif + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c new file mode 100644 index 000000000000..a00d8320221b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c @@ -0,0 +1,816 @@ +/* + * A lpc driver for the ufispace_s9300_32d + * + * Copyright (C) 2017-2020 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define DRIVER_NAME "x86_64_ufispace_s9300_32d_lpc" +#define CPU_BDE 0 +#define CPU_SKY 1 +#define CPU_TYPE CPU_SKY + +/* LPC registers */ + +#define REG_BASE_CPU 0x600 + +#if CPU_TYPE == CPU_SKY +#define REG_BASE_MB 0xE00 +#define REG_BASE_I2C_ALERT 0x700 +#else +#define REG_BASE_MB 0x700 +#define REG_BASE_I2C_ALERT 0xF000 +#endif + +//CPU CPLD +#define REG_CPU_CPLD_VERSION (REG_BASE_CPU + 0x00) +#define REG_CPU_STATUS_0 (REG_BASE_CPU + 0x01) +#define REG_CPU_STATUS_1 (REG_BASE_CPU + 0x02) +#define REG_CPU_CTRL_0 (REG_BASE_CPU + 0x03) +#define REG_CPU_CTRL_1 (REG_BASE_CPU + 0x04) +#define REG_CPU_CPLD_BUILD (REG_BASE_CPU + 0xE0) + +//MB CPLD +//TBD, need to change after CPLD spec release +#define REG_MB_BRD_ID_0 (REG_BASE_MB + 0x00) +#define REG_MB_BRD_ID_1 (REG_BASE_MB + 0x01) +#define REG_MB_CPLD_VERSION (REG_BASE_MB + 0x02) +#define REG_MB_CPLD_BUILD (REG_BASE_MB + 0x04) +#define REG_MB_MUX_RESET (REG_BASE_MB + 0x46) +#define REG_MB_MUX_CTRL (REG_BASE_MB + 0x5c) + +//I2C Alert +#if CPU_TYPE == CPU_SKY +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x80) +#else +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x00) +#define REG_ALERT_DISABLE (REG_BASE_I2C_ALERT + 0x11) +#endif + +#define MASK_ALL (0xFF) +#define LPC_MDELAY (5) + +/* LPC sysfs attributes index */ +enum lpc_sysfs_attributes { + //CPU CPLD + ATT_CPU_CPLD_VERSION, + ATT_CPU_CPLD_VERSION_H, + ATT_CPU_BIOS_BOOT_ROM, + ATT_CPU_BIOS_BOOT_CFG, + ATT_CPU_CPLD_BUILD, + //MB CPLD + ATT_MB_BRD_ID_0, + ATT_MB_BRD_ID_1, + ATT_MB_CPLD_1_VERSION, + ATT_MB_CPLD_1_VERSION_H, + ATT_MB_CPLD_1_BUILD, + ATT_MB_MUX_CTRL, + ATT_MB_MUX_RESET, + ATT_MB_BRD_SKU_ID, + ATT_MB_BRD_HW_ID, + ATT_MB_BRD_ID_TYPE, + ATT_MB_BRD_BUILD_ID, + ATT_MB_BRD_DEPH_ID, + //I2C Alert + ATT_ALERT_STATUS, +#if CPU_TYPE == CPU_BDE + ATT_ALERT_DISABLE, +#endif + //BSP + ATT_BSP_VERSION, + ATT_BSP_DEBUG, + ATT_BSP_REG, + ATT_MAX +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +struct lpc_data_s { + struct mutex access_lock; +}; + +struct lpc_data_s *lpc_data; +char bsp_version[16]=""; +char bsp_debug[2]="0"; +char bsp_reg[8]="0x0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; + +/* reg shift */ +static u8 _shift(u8 mask) +{ + int i=0, mask_one=1; + + for(i=0; i<8; ++i) { + if ((mask & mask_one) == 1) + return i; + else + mask >>= 1; + } + + return -1; +} + +/* reg mask and shift */ +static u8 _mask_shift(u8 val, u8 mask) +{ + int shift=0; + + shift = _shift(mask); + + return (val & mask) >> shift; +} + +static u8 _bit_operation(u8 reg_val, u8 bit, u8 bit_val) +{ + if (bit_val == 0) + reg_val = reg_val & ~(1 << bit); + else + reg_val = reg_val | (1 << bit); + return reg_val; +} + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if ((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write)) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get lpc register value */ +static u8 _read_lpc_reg(u16 reg, u8 mask) +{ + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return reg_val; +} + +/* get lpc register value */ +static ssize_t read_lpc_reg(u16 reg, u8 mask, char *buf) +{ + u8 reg_val; + int len=0; + + reg_val = _read_lpc_reg(reg, mask); + len=sprintf(buf,"0x%x\n", reg_val); + + return len; +} + +/* set lpc register value */ +static ssize_t write_lpc_reg(u16 reg, u8 mask, const char *buf, size_t count) +{ + u8 reg_val, reg_val_now, shift; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + //apply SINGLE BIT operation if mask is specified, multiple bits are not supported + if (mask != MASK_ALL) { + reg_val_now = _read_lpc_reg(reg, 0x0); + shift = _shift(mask); + reg_val = _bit_operation(reg_val_now, shift, reg_val); + } + + mutex_lock(&lpc_data->access_lock); + + outb(reg_val, reg); + mdelay(LPC_MDELAY); + + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return count; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + mutex_lock(&lpc_data->access_lock); + len=sprintf(buf, "%s", str); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + mutex_lock(&lpc_data->access_lock); + snprintf(str, str_len, "%s", buf); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get cpu cpld version in human readable format */ +static ssize_t read_cpu_cpld_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_CPU_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_CPU_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mb cpld version in human readable format */ +static ssize_t read_mb_cpld_1_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_MB_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_MB_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mux_reset register value */ +static ssize_t read_mux_reset_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + int len = 0; + u16 reg = REG_MB_MUX_RESET; + u8 mask = 0b00011111; + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + len=sprintf(buf, "%d\n", reg_val); + mutex_unlock(&lpc_data->access_lock); + + return len; +} + +/* set mux_reset register value */ +static ssize_t write_mux_reset_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + u8 val = 0; + u16 reg = REG_MB_MUX_RESET; + u8 reg_val = 0; + u8 mask = 0b00011111; + static int mux_reset_flag = 0; + + if (kstrtou8(buf, 0, &val) < 0) + return -EINVAL; + + if (mux_reset_flag == 0) { + if (val == 0) { + mutex_lock(&lpc_data->access_lock); + mux_reset_flag = 1; + BSP_LOG_W("i2c mux reset is triggered..."); + + reg_val = inb(reg); + outb((reg_val & ~mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val & ~mask); + mdelay(500); + outb((reg_val | mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val | mask); + mdelay(500); + mux_reset_flag = 0; + mutex_unlock(&lpc_data->access_lock); + } else { + return -EINVAL; + } + } else { + BSP_LOG_W("i2c mux is resetting... (ignore)"); + mutex_lock(&lpc_data->access_lock); + mutex_unlock(&lpc_data->access_lock); + } + + return count; +} + +/* get lpc register value */ +static ssize_t read_lpc_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch (attr->index) { + //CPU CPLD + case ATT_CPU_CPLD_VERSION: + reg = REG_CPU_CPLD_VERSION; + break; + case ATT_CPU_BIOS_BOOT_ROM: + reg = REG_CPU_STATUS_1; + mask = 0x80; + break; + case ATT_CPU_BIOS_BOOT_CFG: + reg = REG_CPU_CTRL_1; + mask = 0x80; + break; + case ATT_CPU_CPLD_BUILD: + reg = REG_CPU_CPLD_BUILD; + break; + //MB CPLD + case ATT_MB_BRD_ID_0: + reg = REG_MB_BRD_ID_0; + break; + case ATT_MB_BRD_ID_1: + reg = REG_MB_BRD_ID_1; + break; + case ATT_MB_CPLD_1_VERSION: + reg = REG_MB_CPLD_VERSION; + break; + case ATT_MB_CPLD_1_BUILD: + reg = REG_MB_CPLD_BUILD; + break; + case ATT_MB_BRD_SKU_ID: + reg = REG_MB_BRD_ID_0; + mask = 0xFF; + break; + case ATT_MB_BRD_HW_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x03; + break; + case ATT_MB_BRD_ID_TYPE: + reg = REG_MB_BRD_ID_1; + mask = 0x80; + break; + case ATT_MB_BRD_BUILD_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x38; + break; + case ATT_MB_BRD_DEPH_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x04; + break; + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + //I2C Alert + case ATT_ALERT_STATUS: + reg = REG_ALERT_STATUS; + mask = 0x20; + break; +#if CPU_TYPE == CPU_BDE + case ATT_ALERT_DISABLE: + reg = REG_ALERT_DISABLE; + mask = 0x04; + break; +#endif + //BSP + case ATT_BSP_REG: + if (kstrtou16(bsp_reg, 0, ®) < 0) + return -EINVAL; + break; + default: + return -EINVAL; + } + return read_lpc_reg(reg, mask, buf); +} + +/* set lpc register value */ +static ssize_t write_lpc_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch (attr->index) { + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + default: + return -EINVAL; + } + return write_lpc_reg(reg, mask, buf, count); +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch (attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + u16 reg = 0; + u8 bsp_debug_u8 = 0; + + switch (attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(str); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(str); + break; + case ATT_BSP_REG: + if (kstrtou16(buf, 0, ®) < 0) + return -EINVAL; + + str = bsp_reg; + str_len = sizeof(str); + break; + default: + return -EINVAL; + } + + if (attr->index == ATT_BSP_DEBUG) { + if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if (_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + } + + return write_bsp(buf, str, str_len, count); +} + +//SENSOR_DEVICE_ATTR - CPU +static SENSOR_DEVICE_ATTR(cpu_cpld_version, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_VERSION); +static SENSOR_DEVICE_ATTR(cpu_cpld_version_h, S_IRUGO, read_cpu_cpld_version_h, NULL, ATT_CPU_CPLD_VERSION_H); +static SENSOR_DEVICE_ATTR(boot_rom, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_ROM); +static SENSOR_DEVICE_ATTR(boot_cfg, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_CFG); +static SENSOR_DEVICE_ATTR(cpu_cpld_build, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_BUILD); +//SENSOR_DEVICE_ATTR - MB +static SENSOR_DEVICE_ATTR(board_id_0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_0); +static SENSOR_DEVICE_ATTR(board_id_1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_1); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_VERSION); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version_h, S_IRUGO, read_mb_cpld_1_version_h, NULL, ATT_MB_CPLD_1_VERSION_H); +static SENSOR_DEVICE_ATTR(mb_cpld_1_build, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_BUILD); +static SENSOR_DEVICE_ATTR(mux_ctrl, S_IRUGO | S_IWUSR, read_lpc_callback, write_lpc_callback, ATT_MB_MUX_CTRL); +static SENSOR_DEVICE_ATTR(mux_reset, S_IRUGO | S_IWUSR, read_mux_reset_callback, write_mux_reset_callback, ATT_MB_MUX_RESET); +static SENSOR_DEVICE_ATTR(board_sku_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_SKU_ID); +static SENSOR_DEVICE_ATTR(board_hw_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_HW_ID); +static SENSOR_DEVICE_ATTR(board_id_type, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_TYPE); +static SENSOR_DEVICE_ATTR(board_build_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_BUILD_ID); +static SENSOR_DEVICE_ATTR(board_deph_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_DEPH_ID); +//SENSOR_DEVICE_ATTR - I2C Alert +static SENSOR_DEVICE_ATTR(alert_status, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_STATUS); +#if CPU_TYPE == CPU_BDE +static SENSOR_DEVICE_ATTR(alert_disable, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_DISABLE); +#endif +//SENSOR_DEVICE_ATTR - BSP +static SENSOR_DEVICE_ATTR(bsp_version, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_VERSION); +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_DEBUG); +static SENSOR_DEVICE_ATTR(bsp_reg, S_IRUGO | S_IWUSR, read_lpc_callback, write_bsp_callback, ATT_BSP_REG); + +static struct attribute *cpu_cpld_attrs[] = { + &sensor_dev_attr_cpu_cpld_version.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_build.dev_attr.attr, + NULL, +}; + +static struct attribute *mb_cpld_attrs[] = { + &sensor_dev_attr_board_id_0.dev_attr.attr, + &sensor_dev_attr_board_id_1.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_build.dev_attr.attr, + &sensor_dev_attr_board_sku_id.dev_attr.attr, + &sensor_dev_attr_board_hw_id.dev_attr.attr, + &sensor_dev_attr_board_id_type.dev_attr.attr, + &sensor_dev_attr_board_build_id.dev_attr.attr, + &sensor_dev_attr_board_deph_id.dev_attr.attr, + &sensor_dev_attr_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_mux_reset.dev_attr.attr, + NULL, +}; + +static struct attribute *bios_attrs[] = { + &sensor_dev_attr_boot_rom.dev_attr.attr, + &sensor_dev_attr_boot_cfg.dev_attr.attr, + NULL, +}; + +static struct attribute *i2c_alert_attrs[] = { + &sensor_dev_attr_alert_status.dev_attr.attr, +#if CPU_TYPE == CPU_BDE + &sensor_dev_attr_alert_disable.dev_attr.attr, +#endif + NULL, +}; + +static struct attribute *bsp_attrs[] = { + &sensor_dev_attr_bsp_version.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + &sensor_dev_attr_bsp_reg.dev_attr.attr, + NULL, +}; + +static struct attribute_group cpu_cpld_attr_grp = { + .name = "cpu_cpld", + .attrs = cpu_cpld_attrs, +}; + +static struct attribute_group mb_cpld_attr_grp = { + .name = "mb_cpld", + .attrs = mb_cpld_attrs, +}; + +static struct attribute_group bios_attr_grp = { + .name = "bios", + .attrs = bios_attrs, +}; + +static struct attribute_group i2c_alert_attr_grp = { + .name = "i2c_alert", + .attrs = i2c_alert_attrs, +}; + +static struct attribute_group bsp_attr_grp = { + .name = "bsp", + .attrs = bsp_attrs, +}; + +static void lpc_dev_release( struct device * dev) +{ + return; +} + +static struct platform_device lpc_dev = { + .name = DRIVER_NAME, + .id = -1, + .dev = { + .release = lpc_dev_release, + } +}; + +static int lpc_drv_probe(struct platform_device *pdev) +{ + int i = 0, grp_num = 5; + int err[5] = {0}; + struct attribute_group *grp; + + lpc_data = devm_kzalloc(&pdev->dev, sizeof(struct lpc_data_s), + GFP_KERNEL); + if (!lpc_data) + return -ENOMEM; + + mutex_init(&lpc_data->access_lock); + + for (i=0; idev.kobj, grp); + if (err[i]) { + printk(KERN_ERR "Cannot create sysfs for group %s\n", grp->name); + goto exit; + } else { + continue; + } + } + + return 0; + +exit: + for (i=0; idev.kobj, grp); + if (!err[i]) { + //remove previous successful cases + continue; + } else { + //remove first failed case, then return + return err[i]; + } + } + return 0; +} + +static int lpc_drv_remove(struct platform_device *pdev) +{ + sysfs_remove_group(&pdev->dev.kobj, &cpu_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &mb_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bios_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &i2c_alert_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bsp_attr_grp); + + return 0; +} + +static struct platform_driver lpc_drv = { + .probe = lpc_drv_probe, + .remove = __exit_p(lpc_drv_remove), + .driver = { + .name = DRIVER_NAME, + }, +}; + +int lpc_init(void) +{ + int err = 0; + + err = platform_driver_register(&lpc_drv); + if (err) { + printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", + __func__, __LINE__, err); + + return err; + } + + err = platform_device_register(&lpc_dev); + if (err) { + printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", + __func__, __LINE__, err); + platform_driver_unregister(&lpc_drv); + return err; + } + + return err; +} + +void lpc_exit(void) +{ + platform_driver_unregister(&lpc_drv); + platform_device_unregister(&lpc_dev); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9300_32d_lpc driver"); +MODULE_LICENSE("GPL"); + +module_init(lpc_init); +module_exit(lpc_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c new file mode 100644 index 000000000000..225a8c50d636 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c @@ -0,0 +1,273 @@ +/* + * Copyright (C) 1998, 1999 Frodo Looijaard and + * Philip Edelbrock + * Copyright (C) 2003 Greg Kroah-Hartman + * Copyright (C) 2003 IBM Corp. + * Copyright (C) 2004 Jean Delvare + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/* enable dev_dbg print out */ +//#define DEBUG + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include + +/* Addresses to scan */ +static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57,*/ I2C_CLIENT_END }; + +/* Size of EEPROM in bytes */ +#define EEPROM_SIZE 512 + +#define SLICE_BITS (6) +#define SLICE_SIZE (1 << SLICE_BITS) +#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE) + +/* Each client has this additional data */ +struct eeprom_data { + struct mutex update_lock; + u8 valid; /* bitfield, bit!=0 if slice is valid */ + unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */ + u8 data[EEPROM_SIZE]; /* Register values */ +}; + + +static void sys_eeprom_update_client(struct i2c_client *client, u8 slice) +{ + struct eeprom_data *data = i2c_get_clientdata(client); + int i, j; + int ret; + int addr; + + mutex_lock(&data->update_lock); + + if (!(data->valid & (1 << slice)) || + time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { + dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice); + + addr = slice << SLICE_BITS; + + ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF)); + /* select the eeprom address */ + if (ret < 0) { + dev_err(&client->dev, "address set failed\n"); + goto exit; + } + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) { + goto exit; + } + + for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) { + for (j = i; j < (i+SLICE_SIZE); j++) { + int res; + + res = i2c_smbus_read_byte(client); + if (res < 0) { + goto exit; + } + + data->data[j] = res & 0xFF; + } + } + + data->last_updated[slice] = jiffies; + data->valid |= (1 << slice); + } +exit: + mutex_unlock(&data->update_lock); +} + +static ssize_t sys_eeprom_read(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + u8 slice; + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + /* Only refresh slices which contain requested bytes */ + for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) { + sys_eeprom_update_client(client, slice); + } + + memcpy(buf, &data->data[off], count); + + return count; +} + +static ssize_t sys_eeprom_write(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + int ret; + int i; + u8 cmd; + u16 value16; + + dev_dbg(&client->dev, "sys_eeprom_write off=%d, count=%d\n", (int)off, (int)count); + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + mutex_lock(&data->update_lock); + + for(i=0; i < count; i++) { + /* write command */ + cmd = (off >> 8) & 0xff; + value16 = off & 0xff; + value16 |= buf[i] << 8; + ret = i2c_smbus_write_word_data(client, cmd, value16); + + if (ret < 0) { + dev_err(&client->dev, "write address failed at %d \n", (int)off); + goto exit; + } + + off++; + + /* need to wait for write complete */ + udelay(10000); + } +exit: + mutex_unlock(&data->update_lock); + /* force to update client when reading */ + for(i=0; i < SLICE_NUM; i++) { + data->last_updated[i] = 0; + } + + return count; +} + +static struct bin_attribute sys_eeprom_attr = { + .attr = { + .name = "eeprom", + .mode = S_IRUGO | S_IWUSR, + }, + .size = EEPROM_SIZE, + .read = sys_eeprom_read, + .write = sys_eeprom_write, +}; + +/* Return 0 if detection is successful, -ENODEV otherwise */ +static int sys_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info) +{ + struct i2c_adapter *adapter = client->adapter; + + /* EDID EEPROMs are often 24C00 EEPROMs, which answer to all + addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline + attaching to addresses >= 0x56 on DDC buses */ + if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) { + return -ENODEV; + } + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE) + && !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { + return -ENODEV; + } + + strlcpy(info->type, "eeprom", I2C_NAME_SIZE); + + return 0; +} + +static int sys_eeprom_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct eeprom_data *data; + int err; + + if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { + err = -ENOMEM; + goto exit; + } + +#ifdef __STDC_LIB_EXT1__ + memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); +#else + memset(data->data, 0xff, EEPROM_SIZE); +#endif + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + + /* create the sysfs eeprom file */ + err = sysfs_create_bin_file(&client->dev.kobj, &sys_eeprom_attr); + if (err) { + goto exit_kfree; + } + + return 0; + +exit_kfree: + kfree(data); +exit: + return err; +} + +static int sys_eeprom_remove(struct i2c_client *client) +{ + sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); + kfree(i2c_get_clientdata(client)); + + return 0; +} + +static const struct i2c_device_id sys_eeprom_id[] = { + { "sys_eeprom", 0 }, + { } +}; + +static struct i2c_driver sys_eeprom_driver = { + .driver = { + .name = "sys_eeprom", + }, + .probe = sys_eeprom_probe, + .remove = sys_eeprom_remove, + .id_table = sys_eeprom_id, + + .class = I2C_CLASS_DDC | I2C_CLASS_SPD, + .detect = sys_eeprom_detect, + .address_list = normal_i2c, +}; + +module_i2c_driver(sys_eeprom_driver); + +MODULE_AUTHOR("Wade "); +MODULE_DESCRIPTION("UfiSpace Mother Board EEPROM driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/service/pddf-platform-init.service new file mode 120000 index 000000000000..0fd9f25b6c5e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/__init__.py new file mode 100644 index 000000000000..593867d31c9d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/__init__.py @@ -0,0 +1,4 @@ +# All the derived classes for PDDF +__all__ = ["platform", "chassis", "sfp", "psu", "thermal", "fan"] +from . import platform + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py new file mode 100644 index 000000000000..267add0756d1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Chassis API +# +############################################################################# + +try: + import time + from sonic_platform_pddf_base.pddf_chassis import PddfChassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_COMPONENT = 5 + +class Chassis(PddfChassis): + """ + PDDF Platform-specific Chassis class + """ + + port_dict = {} + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) + self._initialize_components() + + def _initialize_components(self): + from sonic_platform.component import Component + for index in range(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + # Provide the functions/variables below for which implementation is to be overwritten + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.platform_name_str() + + def initizalize_system_led(self): + return True + + def get_status_led(self): + return self.get_system_led("SYS_LED") + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + Returns: + (bool, dict): + - bool: True if call successful, False if not; + - dict: A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, where device_id is the device ID + for this device and device_event. + The known devices's device_id and device_event was defined as table below. + ----------------------------------------------------------------- + device | device_id | device_event | annotate + ----------------------------------------------------------------- + 'sfp' '' '0' Sfp removed + '1' Sfp inserted + '2' I2C bus stuck + '3' Bad eeprom + '4' Unsupported cable + '5' High Temperature + '6' Bad cable + -------------------------------------------------------------------- + Ex. 'sfp':{'11':'0', '12':'1'}, + Indicates that: + sfp 11 has been removed, sfp 12 has been inserted. + Note: For sfp, when event 3-6 happened, the module will not be avalaible, + XCVRD shall stop to read eeprom before SFP recovered from error status. + """ + + change_event_dict = {"sfp": {}} + + start_time = time.time() + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_change_event:Invalid timeout value", timeout) + return False, change_event_dict + + end_time = start_time + timeout + if start_time > end_time: + print( + "get_change_event:" "time wrap / invalid timeout value", + timeout, + ) + return False, change_event_dict # Time wrap or possibly incorrect timeout + try: + while timeout >= 0: + # check for sfp + sfp_change_dict = self.get_transceiver_change_event() + + if sfp_change_dict: + change_event_dict["sfp"] = sfp_change_dict + return True, change_event_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, change_event_dict + except Exception as e: + print(e) + print("get_change_event: Should not reach here.") + return False, change_event_dict + + def get_transceiver_change_event(self, timeout=0): + current_port_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index in range(self.platform_inventory['num_ports']): + if self._sfp_list[index].get_presence(): + current_port_dict[index] = self.plugin_data['XCVR']['plug_status']['inserted'] + else: + current_port_dict[index] = self.plugin_data['XCVR']['plug_status']['removed'] + + if len(self.port_dict) == 0: # first time + self.port_dict = current_port_dict + return {} + + if current_port_dict == self.port_dict: + return {} + + # Update reg value + for index, status in current_port_dict.items(): + if self.port_dict[index] != status: + ret_dict[index] = status + #ret_dict[str(index)] = status + self.port_dict = current_port_dict + for index, status in ret_dict.items(): + if int(status) == 1: + pass + #self._sfp_list[int(index)].check_sfp_optoe_type() + return ret_dict + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = self.plugin_data['REBOOT_CAUSE']['reboot_cause_file'] + + try: + with open(reboot_cause_path, 'r', errors='replace') as fd: + data = fd.read() + sw_reboot_cause = data.strip() + except IOError: + sw_reboot_cause = "Unknown" + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py new file mode 100644 index 000000000000..f3346725c667 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py @@ -0,0 +1,139 @@ +############################################################################# +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_SYSFS = { + "CPLD1": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld1_version", + "CPLD2": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld2_version", + "CPLD3": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld3_version", +} + +BMC_CMDS = { + "VER1": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f1", + "VER2": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f2", + "VER3": "echo $((`ipmitool mc info | grep 'Aux Firmware Rev Info' -A 2 | sed -n '2p'` + 0))", +} + +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System"), + ("BMC", "BMC"), + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self.index = component_index + self.name = self.get_name() + + def _run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def _get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def _get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_SYSFS: + cmd = "cat {}".format(CPLD_SYSFS[cpld_name]) + status, value = subprocess.getstatusoutput(cmd) + if not status: + cpld_version_raw = value.rstrip() + cpld_version_int = int(cpld_version_raw,16) + cpld_version[cpld_name] = "{}.{:02d}".format(cpld_version_int >> 6, + cpld_version_int & 0b00111111) + + return cpld_version + + def _get_bmc_version(self): + # Retrieves the BMC firmware version + bmc_ver = dict() + for ver in BMC_CMDS: + status, value = subprocess.getstatusoutput(BMC_CMDS[ver]) + if not status: + bmc_ver[ver] = int(value.rstrip()) + else: + return None + + bmc_version = "{}.{}.{}".format(bmc_ver["VER1"], bmc_ver["VER2"], bmc_ver["VER3"]) + + return bmc_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self._get_bios_version() + elif "CPLD" in self.name: + cpld_version = self._get_cpld_version() + fw_version = cpld_version.get(self.name) + elif self.name == "BMC": + fw_version = self._get_bmc_version() + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/eeprom.py new file mode 100644 index 000000000000..90ab1c779a48 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/eeprom.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(PddfEeprom): + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + + def platform_name_str(self): + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_PLATFORM_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py new file mode 100644 index 000000000000..6b99493ecb41 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan import PddfFan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Fan(PddfFan): + """PDDF Platform-Specific Fan class""" + + def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): + # idx is 0-based + PddfFan.__init__(self, tray_idx, fan_idx, pddf_data, pddf_plugin_data, is_psu_fan, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten + # Since psu_fan airflow direction cant be read from sysfs, it is fixed as 'F2B' or 'intake' + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + speed_percentage = 0 + if self.is_psu_fan: + attr = "psu_fan{}_speed_rpm".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + max_speed = int(self.plugin_data['PSU']['PSU_FAN_MAX_SPEED']) + else: + if self.fan_index == 1: + pos = "f" + max_speed = int(self.plugin_data['FAN']['FAN_F_MAX_SPEED']) + else: + pos = "r" + max_speed = int(self.plugin_data['FAN']['FAN_R_MAX_SPEED']) + attr = "fan{}_{}_speed_rpm".format(self.fantray_index, pos) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return speed_percentage + + output['status'] = output['status'].rstrip() + if output['status'].isalpha(): + return speed_percentage + else: + speed = int(float(output['status'])) + + speed_percentage = round((speed*100)/max_speed) + + return min(speed_percentage, 100) + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in RPM + + Returns: + An integer, Speed of fan in RPM + """ + rpm_speed = 0 + if self.is_psu_fan: + attr = "psu_fan{}_speed_rpm".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + else: + if self.fan_index == 1: + pos = "f" + else: + pos = "r" + attr = "fan{}_{}_speed_rpm".format(self.fantray_index, pos) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + + if output is None: + return rpm_speed + + output['status'] = output['status'].rstrip() + if output['status'].isalpha(): + return rpm_speed + else: + rpm_speed = int(float(output['status'])) + + return rpm_speed + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + direction = self.FAN_DIRECTION_INTAKE + if self.is_psu_fan: + attr = "psu_fan{}_dir".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + else: + attr = "fan{}_dir".format(self.fantray_index) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return direction + + mode = output['mode'] + val = output['status'].strip() + vmap = self.plugin_data['FAN']['direction'][mode]['valmap'] + + if val in vmap: + direction = vmap[val] + + return direction + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + presence = False + if self.is_psu_fan: + attr = "psu_present" + device = "PSU{}".format(self.fans_psu_index) + else: + attr = "fan{}_present".format(self.fantray_index) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return presence + + + mode = output['mode'] + val = output['status'].strip() + vmap = self.plugin_data['FAN']['present'][mode]['valmap'] + + if val in vmap: + presence = vmap[val] + + return presence + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed() + + def set_speed(self, speed): + """ + Sets the fan speed + + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + + Returns: + A boolean, True if speed is set successfully, False if not + """ + + print("Setting Fan speed is not allowed") + return False + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/platform.py new file mode 100644 index 000000000000..406b1179ae1b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/platform.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + + +try: + from sonic_platform_pddf_base.pddf_platform import PddfPlatform +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PddfPlatform): + """ + PDDF Platform-Specific Platform Class + """ + + def __init__(self): + PddfPlatform.__init__(self) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py new file mode 100644 index 000000000000..29319e424b4d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_psu import PddfPsu +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Psu(PddfPsu): + """PDDF Platform-Specific PSU class""" + + PLATFORM_PSU_CAPACITY = 2000 + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return float(self.PLATFORM_PSU_CAPACITY) + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + + # power is returned in micro watts + return round(float(self.get_voltage()*self.get_current()), 2) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py new file mode 100644 index 000000000000..d9b6e491bef4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_sfp import PddfSfp +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Sfp(PddfSfp): + """ + PDDF Platform-Specific Sfp class + """ + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/thermal.py new file mode 100644 index 000000000000..77d6ec7ae886 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/thermal.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_thermal import PddfThermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + + +class Thermal(PddfThermal): + """PDDF Platform-Specific Thermal class""" + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py new file mode 100644 index 000000000000..88660b1a1faa --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of platform specific watchdog API's +# +############################################################################# + +try: + from sonic_platform_pddf_base.pddf_watchdog import PddfWatchdog +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Watchdog(PddfWatchdog): + """ + PDDF Platform-specific Chassis class + """ + + def __init__(self): + PddfWatchdog.__init__(self) + self.timeout= 180 + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform_setup.py new file mode 100644 index 000000000000..3661c84a0cd6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform_setup.py @@ -0,0 +1,27 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on ufispace platform', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Leo Lin', + maintainer_email='leo.yt.lin@ufispace.com', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh new file mode 100755 index 000000000000..69e75aeef28d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh @@ -0,0 +1,3 @@ +#!/bin/bash +echo 1 > /sys/kernel/pddf/devices/sysstatus/sysstatus_data/port_led_clr_ctrl +echo "PDDF device post-create completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_driver_install.sh new file mode 100755 index 000000000000..ed2559977e42 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_driver_install.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "PDDF driver post-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh new file mode 100755 index 000000000000..52bcb3962ea3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +#rmmod gpio_ich +if [ ! -f /tmp/._pddf_pre_driver_init_completion ]; then + # make sure igb/i40e init in correct order + rmmod i40e + rmmod igb + modprobe igb + modprobe i40e + date > /tmp/._pddf_pre_driver_init_completion +fi +echo "PDDF driver pre-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_switch_svc.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_switch_svc.py new file mode 100755 index 000000000000..0a226ae66a32 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_switch_svc.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# Script to stop and start the respective platforms default services. +# This will be used while switching the pddf->non-pddf mode and vice versa +import commands + +def check_pddf_support(): + return True + +def stop_platform_svc(): + + ''' + status, output = commands.getstatusoutput("systemctl stop s9300-32d-platform-monitor-fan.service") + if status: + print "Stop s9300-32d-platform-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl stop s9300-32d-platform-monitor-psu.service") + if status: + print "Stop s9300-32d-platform-psu.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl stop s9300-32d-platform-monitor.service") + if status: + print "Stop s9300-32d-platform-init.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl disable s9300-32d-platform-monitor.service") + if status: + print "Disable s9300-32d-platform-monitor.service failed %d"%status + return False + ''' + + status, output = commands.getstatusoutput("/usr/local/bin/platform_utility.py deinit") + if status: + print "platform_utility.py deinit command failed %d"%status + return False + + # HACK , stop the pddf-platform-init service if it is active + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service along with other platform serives failed %d"%status + return False + + return True + +def start_platform_svc(): + + status, output = commands.getstatusoutput("/usr/local/bin/platform_utility.py init") + if status: + print "platform_utility.py init command failed %d"%status + return False + + ''' + status, output = commands.getstatusoutput("systemctl enable s9300-32d-platform-monitor.service") + if status: + print "Enable s9300-32d-platform-monitor.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start s9300-32d-platform-monitor-fan.service") + if status: + print "Start s9300-32d-platform-monitor-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl start s9300-32d-platform-monitor-psu.service") + if status: + print "Start s9300-32d-platform-monitor-psu.service failed %d"%status + return False + ''' + return True + +def start_platform_pddf(): + + status, output = commands.getstatusoutput("systemctl start pddf-platform-init.service") + if status: + print "Start pddf-platform-init.service failed %d"%status + return False + + return True + +def stop_platform_pddf(): + + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service failed %d"%status + return False + + return True + From 4e78f58b538e9a4b5e9cbaf6bbcff48461fc3cc3 Mon Sep 17 00:00:00 2001 From: Eric Seifert Date: Wed, 5 Jul 2023 14:41:44 -0700 Subject: [PATCH 063/107] Use execle instead of popen in tacas nss to avoid shell escape exploits (#15284) Why I did it Tacacs nss library uses popen to execute useradd and usermod commands. Popen executes using a shell (/bin/sh) which is passed the command string with "-c". This means that if untrusted user input is supplied, unexpected shell escapes can occur. In this case the username supplied can be untrusted user input when logging in via ssh or other methods when tacacs is enabled. Debian has very little limitation on usernames and as such characters such as quotes, braces, $, >, | etc are all allowed. Since the nss library is run by root, any shell escape will be ran as root. In the current community version of tacacs nss library, the issue is mitigated by the fact that the useradd command is only ran if the user is found to exist on the tacacs server, so the bad username would have to already exists there which is unlikely. However, internally (at Dell) we had to modify this behavior to support other tacacs servers that do not allow authorization messages to verify user existence prior to a successful authentication. These servers include Cisco ISE and Aruba ClearPass. In order to support these tacacs+ servers, we have to create a temporary user immediately, which means this would be a much bigger issue. I also plan to supply the patch to support ISE and ClearPass and as such, I would suggest taking this patch to remediate this issue first. How I did it Replace call to popen with fork/execl of the useradd/usermod binary directly. How to verify it Install patched version of libnss-tacplus and verify that tacacs+ user login still works as expected. --- ...en-shell-execution-with-safer-execle.patch | 108 ++++++++++++++++++ src/tacacs/nss/patch/series | 1 + 2 files changed, 109 insertions(+) create mode 100644 src/tacacs/nss/patch/0011-Replace-popen-shell-execution-with-safer-execle.patch diff --git a/src/tacacs/nss/patch/0011-Replace-popen-shell-execution-with-safer-execle.patch b/src/tacacs/nss/patch/0011-Replace-popen-shell-execution-with-safer-execle.patch new file mode 100644 index 000000000000..dfef93db17b7 --- /dev/null +++ b/src/tacacs/nss/patch/0011-Replace-popen-shell-execution-with-safer-execle.patch @@ -0,0 +1,108 @@ +From 99ff134e88ee698623ac5c09cbcd0e88e0fdfa40 Mon Sep 17 00:00:00 2001 +From: Eric Seifert +Date: Mon, 26 Jun 2023 09:18:44 -0700 +Subject: [PATCH] Replace popen shell execution with safer execle + +--- + nss_tacplus.c | 63 ++++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 52 insertions(+), 11 deletions(-) + +diff --git a/nss_tacplus.c b/nss_tacplus.c +index cd73870..7574374 100644 +--- a/nss_tacplus.c ++++ b/nss_tacplus.c +@@ -34,6 +34,8 @@ + #include + #include + #include ++#include ++#include + + #include + +@@ -439,6 +441,39 @@ static int delete_conf_line(const char *name) + return 0; + } + ++int user_mod_add(const char* cmd, const char* name, char* gid, char* sec_grp, char* gecos, char* home, char* shell) { ++ ++ pid_t pid; ++ int wstatus; ++ ++ pid = fork(); ++ ++ if(pid > 0) { ++ do { ++ if (waitpid(pid, &wstatus, WUNTRACED | WCONTINUED) == -1) { ++ int errsv = errno; ++ char serr[256] = {0}; ++ strerror_r(errsv, serr, 256); ++ syslog(LOG_ERR, "%s: exec of %s failed with error %d: %s", nssname, cmd, errsv, serr); ++ return -1; ++ } ++ } while (!WIFEXITED(wstatus) && !WIFSIGNALED(wstatus)); ++ if WIFEXITED(wstatus) ++ return WEXITSTATUS(wstatus); ++ else ++ return -1; ++ // Child ++ } else if(pid == 0) { ++ execl(cmd, cmd, "-G", sec_grp, name, "-g", gid, "-c", gecos, "-d", home, "-m", "-s", shell, NULL); ++ syslog(LOG_ERR, "%s: exec of %s failed with errno=%d", nssname, cmd, errno); ++ exit(EXIT_FAILURE); ++ // Error ++ } else { ++ syslog(LOG_ERR, "%s: error forking the child\n", nssname); ++ return -1; ++ } ++} ++ + /* + * If not found in local, look up in tacacs user conf. If user name is not in + * conf, it will be written in conf and created by command 'useradd'. When +@@ -454,6 +489,11 @@ static int create_or_modify_local_user(const char *name, int level, bool existin + bool found = false; + const char* command = existing_user ? "/usr/sbin/usermod": "/usr/sbin/useradd"; + ++ if(strlen(name) > 32) { ++ syslog(LOG_ERR, "%s: Username too long", nssname); ++ return -1; ++ } ++ + fp = fopen(user_conf, "ab+"); + if(!fp) { + syslog(LOG_ERR, "%s: %s fopen failed", nssname, user_conf); +@@ -495,18 +535,19 @@ static int create_or_modify_local_user(const char *name, int level, bool existin + while(lvl >= MIN_TACACS_USER_PRIV) { + user = &useradd_grp_list[lvl]; + if(user->info && user->secondary_grp && user->shell) { +- snprintf(buf, len, "%s -G %s \"%s\" -g %d -c \"%s\" -d /home/%s -m -s %s", +- command, user->secondary_grp, name, user->gid, user->info, name, user->shell); +- if(debug) syslog(LOG_DEBUG, "%s", buf); +- fp = popen(buf, "r"); +- if(!fp || -1 == pclose(fp)) { +- syslog(LOG_ERR, "%s: %s popen failed errno=%d %s", +- nssname, command, errno, strerror(errno)); +- delete_conf_line(name); +- return -1; +- } +- if(debug) ++ char sgid[10] = {0}; ++ char home[64] = {0}; ++ snprintf(sgid, 10, "%d", user->gid); ++ snprintf(home, 63, "/home/%s", name); ++ if(0 != user_mod_add(command, name, sgid, user->secondary_grp, user->info, home, user->shell)) { ++ if(debug) ++ syslog(LOG_ERR, "%s: %s %s failed", nssname, command, name); ++ delete_conf_line(name); ++ return -1; ++ } ++ if(debug) + syslog(LOG_DEBUG, "%s: %s %s success", nssname, command, name); ++ + delete_conf_line(name); + return 0; + } +-- +2.39.3 + diff --git a/src/tacacs/nss/patch/series b/src/tacacs/nss/patch/series index 7b9b5c5779a9..c348ae6f5dcb 100644 --- a/src/tacacs/nss/patch/series +++ b/src/tacacs/nss/patch/series @@ -8,3 +8,4 @@ 0008-do-not-create-or-modify-local-user-if-there-is-no-pr.patch 0009-fix-compile-error-strncpy.patch 0010-Send-remote-address-in-TACACS-authorization-message.patch +0011-Replace-popen-shell-execution-with-safer-execle.patch From ca2919718410cae58a54e4bcc1da5a873a9f69ad Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Thu, 6 Jul 2023 05:44:48 +0800 Subject: [PATCH 064/107] Move k8s script to docker-config-engine (#14788) Why I did it To reduce the container's dependency from host system Work item tracking Microsoft ADO (number only): 17713469 How I did it Move the k8s container startup script to config engine container, other than mount it from host. How to verify it Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container. Signed-off-by: Yun Li Co-authored-by: Qi Luo --- dockers/docker-config-engine-bullseye/Dockerfile.j2 | 1 + dockers/docker-config-engine-buster/Dockerfile.j2 | 1 + files/build_templates/docker_image_ctl.j2 | 1 - files/build_templates/sonic_debian_extension.j2 | 6 ------ rules/docker-config-engine-bullseye.mk | 1 + rules/docker-config-engine-buster.mk | 1 + rules/docker-dhcp-relay.mk | 1 - rules/docker-lldp.mk | 1 - rules/docker-platform-monitor.mk | 1 - rules/docker-router-advertiser.mk | 1 - rules/docker-snmp.mk | 1 - rules/docker-telemetry.mk | 1 - src/sonic-ctrmgrd/ctrmgr/container | 4 ++-- src/sonic-ctrmgrd/ctrmgr/container_startup.py | 3 +++ src/sonic-ctrmgrd/tests/container_startup_test.py | 7 +++++++ src/sonic-ctrmgrd/tests/container_test.py | 2 +- 16 files changed, 17 insertions(+), 16 deletions(-) diff --git a/dockers/docker-config-engine-bullseye/Dockerfile.j2 b/dockers/docker-config-engine-bullseye/Dockerfile.j2 index 84c4df100ec5..57631df95c3e 100644 --- a/dockers/docker-config-engine-bullseye/Dockerfile.j2 +++ b/dockers/docker-config-engine-bullseye/Dockerfile.j2 @@ -44,6 +44,7 @@ RUN pip3 install redis==4.5.4 # Copy files COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"] +COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"] ## Clean up RUN apt-get purge -y \ diff --git a/dockers/docker-config-engine-buster/Dockerfile.j2 b/dockers/docker-config-engine-buster/Dockerfile.j2 index 9b8fefeed9f2..ccadb6e43957 100644 --- a/dockers/docker-config-engine-buster/Dockerfile.j2 +++ b/dockers/docker-config-engine-buster/Dockerfile.j2 @@ -44,6 +44,7 @@ RUN pip3 install redis==4.5.4 # Copy files COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"] +COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"] ## Clean up RUN apt-get purge -y \ diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index c14bedfd6f32..ba260dbfb648 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -579,7 +579,6 @@ start() { {%- endif -%} {%- if docker_container_name == "bgp" %} -v /etc/sonic/frr/$DEV:/etc/frr:rw \ - -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro \ {%- endif %} {%- if docker_container_name == "database" %} $DB_OPT \ diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 2849437ad8d8..6723670490c3 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -503,12 +503,6 @@ sudo cp {{sonic_ctrmgmt_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_CTRMGMT_WHEEL_N sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_CTRMGMT_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$SONIC_CTRMGMT_WHEEL_NAME -# Copy remote container mangement files -# File called from each container upon start/stop to record the state -sudo mkdir -p ${FILESYSTEM_ROOT_USR_SHARE_SONIC_SCRIPTS} -sudo cp ${files_path}/container_startup.py ${FILESYSTEM_ROOT_USR_SHARE_SONIC_SCRIPTS}/ -sudo chmod a+x ${FILESYSTEM_ROOT_USR_SHARE_SONIC_SCRIPTS}/container_startup.py - # Config file used by container mgmt scripts/service fl="${files_path}/remote_ctr.config.json" use_k8s_as_http_proxy=$(python3 -c 'import json diff --git a/rules/docker-config-engine-bullseye.mk b/rules/docker-config-engine-bullseye.mk index 9548391a6917..808905496e8f 100644 --- a/rules/docker-config-engine-bullseye.mk +++ b/rules/docker-config-engine-bullseye.mk @@ -19,6 +19,7 @@ $(DOCKER_CONFIG_ENGINE_BULLSEYE)_LOAD_DOCKERS += $(DOCKER_BASE_BULLSEYE) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $(SWSS_VARS_TEMPLATE) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $(RSYSLOG_PLUGIN_CONF_J2) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT) +$(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS = $($(DOCKER_BASE_BULLSEYE)_DBG_DEPENDS) \ $(LIBSWSSCOMMON_DBG) \ diff --git a/rules/docker-config-engine-buster.mk b/rules/docker-config-engine-buster.mk index cd6d6f43b46d..474617bbbd94 100644 --- a/rules/docker-config-engine-buster.mk +++ b/rules/docker-config-engine-buster.mk @@ -18,6 +18,7 @@ $(DOCKER_CONFIG_ENGINE_BUSTER)_LOAD_DOCKERS += $(DOCKER_BASE_BUSTER) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $(SWSS_VARS_TEMPLATE) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $(RSYSLOG_PLUGIN_CONF_J2) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT) +$(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT) $(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS = $($(DOCKER_BASE_BUSTER)_DBG_DEPENDS) \ $(LIBSWSSCOMMON_DBG) \ diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index f5d58f2de45b..06dd0f137fb6 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -48,7 +48,6 @@ $(DOCKER_DHCP_RELAY)_CONTAINER_NAME = dhcp_relay $(DOCKER_DHCP_RELAY)_CONTAINER_PRIVILEGED = true $(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /etc/sonic:/etc/sonic:ro $(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /etc/timezone:/etc/timezone:ro -$(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_DHCP_RELAY)_CONTAINER_TMPFS += /tmp/ $(DOCKER_DHCP_RELAY)_CONTAINER_TMPFS += /var/tmp/ diff --git a/rules/docker-lldp.mk b/rules/docker-lldp.mk index 9f6a4d2e711d..95172d6cf368 100644 --- a/rules/docker-lldp.mk +++ b/rules/docker-lldp.mk @@ -31,7 +31,6 @@ $(DOCKER_LLDP)_CONTAINER_NAME = lldp $(DOCKER_LLDP)_RUN_OPT += --privileged -t $(DOCKER_LLDP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_LLDP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro -$(DOCKER_LLDP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_LLDP)_BASE_IMAGE_FILES += lldpctl:/usr/bin/lldpctl $(DOCKER_LLDP)_BASE_IMAGE_FILES += lldpcli:/usr/bin/lldpcli diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index daa19336fb6f..1bfd256ef579 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -51,7 +51,6 @@ $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --privileged -t $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro -$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /var/run/platform_cache:/var/run/platform_cache:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/device/pddf:/usr/share/sonic/device/pddf:ro diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index e3f561be93dc..aa41696f78af 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -32,5 +32,4 @@ $(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --privileged -t $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro -$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_ROUTER_ADVERTISER)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-snmp.mk b/rules/docker-snmp.mk index 085eadf7eab3..d350540dbe2f 100644 --- a/rules/docker-snmp.mk +++ b/rules/docker-snmp.mk @@ -31,7 +31,6 @@ $(DOCKER_SNMP)_CONTAINER_NAME = snmp $(DOCKER_SNMP)_RUN_OPT += --privileged -t $(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_SNMP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro -$(DOCKER_SNMP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 5b66ff588b64..97b621fe9a96 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -31,7 +31,6 @@ $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry $(DOCKER_TELEMETRY)_RUN_OPT += --privileged -t $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro -$(DOCKER_TELEMETRY)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro ifneq ($(INCLUDE_SYSTEM_GNMI), y) $(DOCKER_TELEMETRY)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw endif diff --git a/src/sonic-ctrmgrd/ctrmgr/container b/src/sonic-ctrmgrd/ctrmgr/container index 74212ee310e3..29e91a3c4e22 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container +++ b/src/sonic-ctrmgrd/ctrmgr/container @@ -11,7 +11,7 @@ import datetime import docker from swsscommon import swsscommon -CTR_STATE_SCR_PATH = '/usr/share/sonic/scripts/container_startup.py' +CTRMGRD_SERVICE_PATH = '/lib/systemd/system/ctrmgrd.service' state_db = None @@ -62,7 +62,7 @@ def init(): cfg_db = swsscommon.DBConnector("CONFIG_DB", 0) state_db = swsscommon.DBConnector("STATE_DB", 0) - remote_ctr_enabled = os.path.exists(CTR_STATE_SCR_PATH) + remote_ctr_enabled = os.path.exists(CTRMGRD_SERVICE_PATH) def get_config_data(fld, dflt): diff --git a/src/sonic-ctrmgrd/ctrmgr/container_startup.py b/src/sonic-ctrmgrd/ctrmgr/container_startup.py index 0388258c140a..7e1df7ac8769 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container_startup.py +++ b/src/sonic-ctrmgrd/ctrmgr/container_startup.py @@ -221,6 +221,9 @@ def container_up(feature, owner, version): debug_msg("args: feature={}, owner={}, version={} DB: set_owner={} state_data={}".format( feature, owner, version, set_owner, json.dumps(state_data, indent=4))) + if state_data[SYSTEM_STATE] == '': + return + if owner == "local": update_state(state_db, feature, owner, version) else: diff --git a/src/sonic-ctrmgrd/tests/container_startup_test.py b/src/sonic-ctrmgrd/tests/container_startup_test.py index 23523f66b106..98901a4c6095 100755 --- a/src/sonic-ctrmgrd/tests/container_startup_test.py +++ b/src/sonic-ctrmgrd/tests/container_startup_test.py @@ -23,6 +23,13 @@ "set_owner": "local" } } + }, + common_test.STATE_DB_NO: { + common_test.FEATURE_TABLE: { + "snmp": { + "system_state": "up" + } + } } }, common_test.POST: { diff --git a/src/sonic-ctrmgrd/tests/container_test.py b/src/sonic-ctrmgrd/tests/container_test.py index f88ce58433b4..57fffe7af669 100755 --- a/src/sonic-ctrmgrd/tests/container_test.py +++ b/src/sonic-ctrmgrd/tests/container_test.py @@ -468,7 +468,7 @@ class TestContainer(object): def init(self): - container.CTR_STATE_SCR_PATH = __file__ + container.CTRMGRD_SERVICE_PATH = __file__ container.SONIC_CTR_CONFIG = ( common_test.create_remote_ctr_config_json()) From 673b8b86ffe48e1b8f5091b3a7109e3c7c38a4e0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:39:13 +0800 Subject: [PATCH 065/107] [submodule] Update submodule sonic-dash-api/sonic-dash-api to the latest HEAD automatically (#15725) #### Why I did it src/sonic-dash-api/sonic-dash-api ``` * 3f728d1 - (HEAD -> master, origin/master, origin/HEAD) Update vnet_direct in route.proto (#4) (11 days ago) [Ze Gan] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-dash-api/sonic-dash-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-dash-api/sonic-dash-api b/src/sonic-dash-api/sonic-dash-api index 30415cd41ef2..3f728d1bbf65 160000 --- a/src/sonic-dash-api/sonic-dash-api +++ b/src/sonic-dash-api/sonic-dash-api @@ -1 +1 @@ -Subproject commit 30415cd41ef2ae62841417b4a6a9113129cd718d +Subproject commit 3f728d1bbf65d2e8c41bdc023d5c07702a7f848b From 39cb2545e68c48253dc4c9568ec775cf077cfdea Mon Sep 17 00:00:00 2001 From: Sachin Holla <51310506+sachinholla@users.noreply.github.com> Date: Fri, 7 Jul 2023 01:09:57 +0530 Subject: [PATCH 066/107] Submodule update for sonic-mgmt-common and sonic-gnmi (#15519) --- src/sonic-gnmi | 2 +- src/sonic-mgmt-common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index a600dc954ca2..01fe667e7d44 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit a600dc954ca253b2acb4dadb52c85ce44e07ff8e +Subproject commit 01fe667e7d44cdfb2d046064c18e4d14ac6c0b4d diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index b64a80e9253e..38eef098a374 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit b64a80e9253eaf49315aa4bf7dfd4423f848ae80 +Subproject commit 38eef098a374d5af87008fd6de473d150f09d3cb From e46be54f140b9d1324d09d8442ba9bcd72308bc8 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 6 Jul 2023 14:44:29 -0700 Subject: [PATCH 067/107] Update the docker daemon to 24.0.2 (#15652) Signed-off-by: Saikrishna Arcot --- build_debian.sh | 4 ++-- sonic-slave-bullseye/Dockerfile.j2 | 4 ++-- sonic-slave-buster/Dockerfile.j2 | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index e4df940db732..7b215772e77d 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -31,8 +31,8 @@ set -x -e CONFIGURED_ARCH=$([ -f .arch ] && cat .arch || echo amd64) ## docker engine version (with platform) -DOCKER_VERSION=5:20.10.14~3-0~debian-$IMAGE_DISTRO -CONTAINERD_IO_VERSION=1.5.11-1 +DOCKER_VERSION=5:24.0.2-1~debian.11~$IMAGE_DISTRO +CONTAINERD_IO_VERSION=1.6.21-1 LINUX_KERNEL_VERSION=5.10.0-18-2 ## Working directory to prepare the file system diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index a8b40cb6b38c..401d3651164b 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -580,7 +580,7 @@ ENV PATH /usr/share/depot_tools:$PATH RUN pip3 install parameterized==0.8.1 RUN pip3 install pyfakefs -# Install docker engine 20.10 inside docker and enable experimental feature +# Install docker engine 24 inside docker and enable experimental feature RUN apt-get update RUN apt-get install -y \ apt-transport-https \ @@ -601,7 +601,7 @@ RUN add-apt-repository \ $(lsb_release -cs) \ stable" RUN apt-get update -RUN apt-get install -y docker-ce=5:20.10.14~3-0~debian-bullseye docker-ce-cli=5:20.10.14~3-0~debian-bullseye containerd.io=1.5.11-1 +RUN apt-get install -y docker-ce=5:24.0.2-1~debian.11~bullseye docker-ce-cli=5:24.0.2-1~debian.11~bullseye containerd.io=1.6.21-1 docker-buildx-plugin=0.10.5-1~debian.11~bullseye docker-compose-plugin=2.18.1-1~debian.11~bullseye RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker RUN update-alternatives --set iptables /usr/sbin/iptables-legacy diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 8c292e2105a0..7e0bf6d06bcf 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -596,7 +596,7 @@ ENV PATH /usr/share/depot_tools:$PATH RUN pip3 install parameterized==0.8.1 RUN pip3 install pyfakefs -# Install docker engine 17.03.2~ce-0 inside docker and enable experimental feature +# Install docker engine 24 inside docker and enable experimental feature RUN apt-get update RUN apt-get install -y \ apt-transport-https \ @@ -617,7 +617,7 @@ RUN add-apt-repository \ $(lsb_release -cs) \ stable" RUN apt-get update -RUN apt-get install -y docker-ce=5:20.10.21~3-0~debian-buster docker-ce-cli=5:20.10.21~3-0~debian-buster +RUN apt-get install -y docker-ce=5:24.0.2-1~debian.10~buster docker-ce-cli=5:24.0.2-1~debian.10~buster containerd.io=1.6.21-1 docker-buildx-plugin=0.10.5-1~debian.10~buster docker-compose-plugin=2.18.1-1~debian.10~buster RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker RUN update-alternatives --set iptables /usr/sbin/iptables-legacy From 6f6218a920d42f25a8889b214b2d2a473853f458 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Fri, 7 Jul 2023 02:29:24 +0300 Subject: [PATCH 068/107] [FRR]Fixing the advertisement of static ipv6 route (#15688) Co-authored-by: dgsudharsan Co-authored-by: Liat Grozovik <44433539+liat-grozovik@users.noreply.github.com> --- ...tes-async-notification-do-not-need-t.patch | 46 +++++++++++++++++++ src/sonic-frr/patch/series | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch diff --git a/src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch b/src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch new file mode 100644 index 000000000000..aab240f018ab --- /dev/null +++ b/src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch @@ -0,0 +1,46 @@ +From cb89515f7751c23368bc8dcaf0bcf768a42a0c11 Mon Sep 17 00:00:00 2001 +From: dgsudharsan +Date: Wed, 28 Jun 2023 19:42:16 +0000 +Subject: [PATCH] zebra: Static routes async notification do not need this test + When using asic_offload with an asynchronous notification the + rib_route_match_ctx function is testing for distance and tag being correct + against the re. This is no longer necessary. + +Normal route notification for static routes is this(well really all routes): a) zebra dplane generates a ctx to send to the dplane for route install b) dplane installs it in the kernel +c) if the dplane_fpm_nl.c module is being used it installs it. d) The context's success code is set to it worked and passes the context back up to zebra for processing. +e) Zebra master receives this and checks the distance and tag are correct for static routes and accepts the route and marks it installed. + +If the operator is using a wait for install mechansim where the dplane is asynchronously sending the result back up at a future time and it is using the dplane_fpm_nl.c code where it uses the rt_netlink.c route parsing code, then there is no way to set distance as that we do not pass distance to the kernel. + +As such static routes were never being properly handled since the re and context would not match and the route would still be marked as queued. + +This code is historical in nature and is no longer necessary. rib_route_match_ctx is only ever used with dplane notifications. Additionally static routes are now handled more intelligently from staticd and the distance changes are held in staticd not zebra, thus it can be removed. + +diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c +index a8dbe4470..e021ed142 100644 +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -1385,15 +1385,12 @@ static bool rib_route_match_ctx(const struct route_entry *re, + (re->instance == dplane_ctx_get_instance(ctx))) { + result = true; + +- /* We use an extra test for statics, and another for +- * kernel routes. ++ /* ++ * We use different tests for kernel and for ++ * connected routes. + */ +- if (re->type == ZEBRA_ROUTE_STATIC && +- (re->distance != dplane_ctx_get_distance(ctx) || +- re->tag != dplane_ctx_get_tag(ctx))) { +- result = false; +- } else if (re->type == ZEBRA_ROUTE_KERNEL && +- re->metric != dplane_ctx_get_metric(ctx)) { ++ if (re->type == ZEBRA_ROUTE_KERNEL && ++ re->metric != dplane_ctx_get_metric(ctx)) { + result = false; + } else if (re->type == ZEBRA_ROUTE_CONNECT) { + result = nexthop_group_equal_no_recurse( +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index db97b2ea823f..0de573f3a596 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -28,4 +28,4 @@ cross-compile-changes.patch 0027-bgpd-Ensure-FRR-has-enough-data-to-read-in-peek_for_as4_capability-and-bgp_open_option_parse.patch 0028-bgpd-Ensure-that-bgp-open-message-stream-has-enough-data-to-read.patch 0029-bgpd-Change-log-level-for-graceful-restart-events.patch - +0030-zebra-Static-routes-async-notification-do-not-need-t.patch From ddb30866204a9284099d78577da81c0693954971 Mon Sep 17 00:00:00 2001 From: Vaibhav Hemant Dixit Date: Thu, 6 Jul 2023 17:34:35 -0700 Subject: [PATCH 069/107] Revert "Revert "Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933)" (#15464)" (#15684) This reverts commit 9649a44470151f62cae4ce79eff68a5782fa27ea. --- files/build_templates/docker_image_ctl.j2 | 16 ++++++++++++---- files/image_config/config-setup/config-setup | 13 +++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index ba260dbfb648..01a52fb7a0d3 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -257,10 +257,18 @@ function postStartAction() $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" fi - if [[ -x /usr/local/bin/db_migrator.py ]]; then - # Migrate the DB to the latest schema version if needed - if [ -z "$DEV" ]; then - /usr/local/bin/db_migrator.py -o migrate + if [ -e /tmp/pending_config_migration ]; then + # this is first boot to a new image, config-setup execution is pending. + # For fast/cold reboot case, DB contains nothing at this point + # Call db_migrator after config-setup loads the config (from old config or minigraph) + echo "Delaying db_migrator until config migration is over" + else + # this is not a first time boot to a new image. Datbase container starts w/ old pre-existing config + if [[ -x /usr/local/bin/db_migrator.py ]]; then + # Migrate the DB to the latest schema version if needed + if [ -z "$DEV" ]; then + /usr/local/bin/db_migrator.py -o migrate + fi fi fi # Add redis UDS to the redis group and give read/write access to the group diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 0f5a248b05f8..28a3a4373a42 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -304,6 +304,16 @@ check_all_config_db_present() return 0 } +# DB schema is subject to change between two images +# Perform DB schema migration after loading backup config from previous image +do_db_migration() +{ + if [[ -x /usr/local/bin/db_migrator.py ]]; then + # Migrate the DB to the latest schema version if needed + /usr/local/bin/db_migrator.py -o migrate + fi +} + # Perform configuration migration from backup copy. # - This step is performed when a new image is installed and SONiC switch boots into it do_config_migration() @@ -326,16 +336,19 @@ do_config_migration() if [ x"${WARM_BOOT}" == x"true" ]; then echo "Warm reboot detected..." disable_updategraph + do_db_migration rm -f /tmp/pending_config_migration exit 0 elif check_all_config_db_present; then echo "Use config_db.json from old system..." reload_configdb + do_db_migration # Disable updategraph disable_updategraph elif [ -r ${MINGRAPH_FILE} ]; then echo "Use minigraph.xml from old system..." reload_minigraph + do_db_migration # Disable updategraph disable_updategraph else From 74e3917eae0896e6e9382095d2dbdf3e33b19733 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 7 Jul 2023 15:57:10 +0800 Subject: [PATCH 070/107] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#15739) --- 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 dffd76a857e7..00db81f68b55 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit dffd76a857e74321917080d75e62568ff3a480e3 +Subproject commit 00db81f68b5520df6b32acab9d5834b0320eae3a From a86a0264e0718130c838b397efba3f2594894c07 Mon Sep 17 00:00:00 2001 From: Baorong Liu Date: Fri, 7 Jul 2023 10:12:20 -0700 Subject: [PATCH 071/107] [staticroutebfd] fix static route uninstall issue when all nexthops are not reachable (#15575) fix static route uninstall issue when all nexthops are not reachable. the feature was working but the bug was introduced when support dynamic bfd enable/disable. Added UT testcase to guard this. --- .../bgpcfgd/managers_static_rt.py | 15 +- src/sonic-bgpcfgd/tests/test_static_rt.py | 161 ++++++++++++++++++ 2 files changed, 174 insertions(+), 2 deletions(-) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py b/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py index c5c55406d6f0..3f6a979eb0b1 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py @@ -88,7 +88,7 @@ def skip_appl_del(self, vrf, ip_prefix): so need this checking (skip appl_db deletion) to avoid race condition between StaticRouteMgr(appl_db) and StaticRouteMgr(config_db) For more detailed information: https://github.com/sonic-net/SONiC/blob/master/doc/static-route/SONiC_static_route_bfd_hld.md#bfd-field-changes-from-true-to-false - + but if the deletion is caused by no nexthop available (bfd field is true but all the sessions are down), need to allow this deletion. :param vrf: vrf from the split_key(key) return :param ip_prefix: ip_prefix from the split_key(key) return :return: True if the deletion comes from APPL_DB and the vrf|ip_prefix exists in CONFIG_DB, otherwise return False @@ -102,6 +102,17 @@ def skip_appl_del(self, vrf, ip_prefix): #just pop local cache if the route exist in config_db cfg_key = "STATIC_ROUTE|" + vrf + "|" + ip_prefix + if vrf == "default": + default_key = "STATIC_ROUTE|" + ip_prefix + bfd = self.config_db.get(self.config_db.CONFIG_DB, default_key, "bfd") + if bfd == "true": + log_debug("skip_appl_del: {}, key {}, bfd flag {}".format(self.db_name, default_key, bfd)) + return False + bfd = self.config_db.get(self.config_db.CONFIG_DB, cfg_key, "bfd") + if bfd == "true": + log_debug("skip_appl_del: {}, key {}, bfd flag {}".format(self.db_name, cfg_key, bfd)) + return False + nexthop = self.config_db.get(self.config_db.CONFIG_DB, cfg_key, "nexthop") if nexthop and len(nexthop)>0: self.static_routes.setdefault(vrf, {}).pop(ip_prefix, None) @@ -121,7 +132,7 @@ def del_handler(self, key): is_ipv6 = TemplateFabric.is_ipv6(ip_prefix) if self.skip_appl_del(vrf, ip_prefix): - log_debug("{} ignore appl_db static route deletion because of key {} exist in config_db".format(self.db_name, key)) + log_debug("{} ignore appl_db static route deletion because of key {} exist in config_db and bfd is not true".format(self.db_name, key)) return ip_nh_set = IpNextHopSet(is_ipv6) diff --git a/src/sonic-bgpcfgd/tests/test_static_rt.py b/src/sonic-bgpcfgd/tests/test_static_rt.py index 3d947a47ac73..422a3451c4fb 100644 --- a/src/sonic-bgpcfgd/tests/test_static_rt.py +++ b/src/sonic-bgpcfgd/tests/test_static_rt.py @@ -73,6 +73,167 @@ def test_set(): ] ) +@patch('bgpcfgd.managers_static_rt.log_debug') +def test_del_for_appl(mocked_log_debug): + class MockRedisConfigDbGet: + def __init__(self, cache=dict()): + self.cache = cache + self.CONFIG_DB = "CONFIG_DB" + + def get(self, db, key, field): + if key in self.cache: + if field in self.cache[key]["value"]: + return self.cache[key]["value"][field] + return None # return nil + + mgr = constructor() + + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", { + "nexthop": "PortChannel0001", + }), + True, + [ + "ip route 10.1.0.0/24 PortChannel0001 tag 1", + "route-map STATIC_ROUTE_FILTER permit 10", + " match tag 1", + "router bgp 65100", + " address-family ipv4", + " redistribute static route-map STATIC_ROUTE_FILTER", + " address-family ipv6", + " redistribute static route-map STATIC_ROUTE_FILTER" + ] + ) + + #from "APPL_DB" instance, static route can not be uninstalled if the static route exists in config_db and "bfd"="false" (or no bfd field) + mgr.db_name = "APPL_DB" + cfg_db_cache = { + "STATIC_ROUTE|10.1.0.0/24": { + "value": { + "advertise": "false", + "nexthop": "PortChannel0001" + } + } + } + mgr.config_db = MockRedisConfigDbGet(cfg_db_cache) + + set_del_test( + mgr, + "DEL", + ("10.1.0.0/24",), + True, + [] + ) + mocked_log_debug.assert_called_with("{} ignore appl_db static route deletion because of key {} exist in config_db and bfd is not true".format(mgr.db_name, "10.1.0.0/24")) + + cfg_db_cache = { + "STATIC_ROUTE|10.1.0.0/24": { + "value": { + "advertise": "false", + "bfd": "false", + "nexthop": "PortChannel0001" + } + } + } + mgr.db_name = "APPL_DB" + mgr.config_db = MockRedisConfigDbGet(cfg_db_cache) + + set_del_test( + mgr, + "DEL", + ("10.1.0.0/24",), + True, + [] + ) + mocked_log_debug.assert_called_with("{} ignore appl_db static route deletion because of key {} exist in config_db and bfd is not true".format(mgr.db_name, "10.1.0.0/24")) + + #From "APPL_DB" instance, static route can be deleted if bfd field is true in config_db + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", { + "nexthop": "PortChannel0001", + }), + True, + [ + "ip route 10.1.0.0/24 PortChannel0001 tag 1", + "route-map STATIC_ROUTE_FILTER permit 10", + " match tag 1", + "router bgp 65100", + " address-family ipv4", + " redistribute static route-map STATIC_ROUTE_FILTER", + " address-family ipv6", + " redistribute static route-map STATIC_ROUTE_FILTER" + ] + ) + cfg_db_cache = { + "STATIC_ROUTE|10.1.0.0/24": { + "value": { + "advertise": "false", + "bfd": "true", + "nexthop": "PortChannel0001" + } + } + } + mgr.db_name = "APPL_DB" + mgr.config_db = MockRedisConfigDbGet(cfg_db_cache) + set_del_test( + mgr, + "DEL", + ("10.1.0.0/24",), + True, + [ + "no ip route 10.1.0.0/24 PortChannel0001 tag 1", + "router bgp 65100", + " address-family ipv4", + " no redistribute static route-map STATIC_ROUTE_FILTER", + " address-family ipv6", + " no redistribute static route-map STATIC_ROUTE_FILTER", + "no route-map STATIC_ROUTE_FILTER" + ] + ) + + #From "APPL_DB" instance, static route can be deleted if the static route does not in config_db + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", { + "nexthop": "PortChannel0001", + }), + True, + [ + "ip route 10.1.0.0/24 PortChannel0001 tag 1", + "route-map STATIC_ROUTE_FILTER permit 10", + " match tag 1", + "router bgp 65100", + " address-family ipv4", + " redistribute static route-map STATIC_ROUTE_FILTER", + " address-family ipv6", + " redistribute static route-map STATIC_ROUTE_FILTER" + ] + ) + + cfg_db_cache = {} + mgr.db_name = "APPL_DB" + mgr.config_db = MockRedisConfigDbGet(cfg_db_cache) + set_del_test( + mgr, + "DEL", + ("10.1.0.0/24",), + True, + [ + "no ip route 10.1.0.0/24 PortChannel0001 tag 1", + "router bgp 65100", + " address-family ipv4", + " no redistribute static route-map STATIC_ROUTE_FILTER", + " address-family ipv6", + " no redistribute static route-map STATIC_ROUTE_FILTER", + "no route-map STATIC_ROUTE_FILTER" + ] + ) + def test_set_nhportchannel(): mgr = constructor() set_del_test( From 87066abcf81612c3ff055a2c6793071c6b2b6e27 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Fri, 7 Jul 2023 11:10:35 -0700 Subject: [PATCH 072/107] Enable BFD for Static Route for chassis-packet. (#15383) *What I did: Enable BFD for Static Route for chassis-packet. This will trigger the use of the feature as defined in here: #13789 Signed-off-by: Abhishek Dosi --- src/sonic-config-engine/minigraph.py | 4 ++++ src/sonic-config-engine/tests/test_cfggen.py | 4 ++-- src/sonic-yang-models/yang-models/sonic-static-route.yang | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 558c7e24e929..625e11c012c3 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1982,6 +1982,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw port['mux_cable'] = "true" if static_routes: + # Enable static Route BFD by default for static route in chassis-packet + if switch_type == "chassis-packet": + for pfx, data in static_routes.items(): + data.update({"bfd":"true"}) results['STATIC_ROUTE'] = static_routes for nghbr in list(neighbors.keys()): diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 50e3c2758a1e..9c1c56d28fce 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -1032,14 +1032,14 @@ def test_minigraph_bgp_packet_chassis_static_route(self): output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), - utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false'}}") + utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false', 'bfd':'true'}}") ) argument = ['-m', self.packet_chassis_graph, '-p', self.packet_chassis_port_ini, '-n', "asic1", '-v', "STATIC_ROUTE"] output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), - utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false'}}") + utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false', 'bfd':'true'}}") ) def test_minigraph_bgp_packet_chassis_vlan_subintf(self): diff --git a/src/sonic-yang-models/yang-models/sonic-static-route.yang b/src/sonic-yang-models/yang-models/sonic-static-route.yang index 019825b78881..0134d5fe6cd5 100644 --- a/src/sonic-yang-models/yang-models/sonic-static-route.yang +++ b/src/sonic-yang-models/yang-models/sonic-static-route.yang @@ -54,6 +54,12 @@ module sonic-static-route { } default "false"; } + leaf bfd { + type string { + pattern "((true|false),)*(true|false)"; + } + default "false"; + } } list STATIC_ROUTE_LIST { key "vrf_name prefix"; From f6282b8259879ca49c0d760ac14d8c9faefea01b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jul 2023 15:57:02 +0800 Subject: [PATCH 073/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15756) --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index ffce92658da0..7fa01d250689 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit ffce92658da01e8a8f613dc1d89f9b439509d1be +Subproject commit 7fa01d250689cbfb4e617e2104f9c5901fc2d25f From cd3cdee221b3ed82510481e9265a7f3116b379ac Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jul 2023 16:34:46 +0800 Subject: [PATCH 074/107] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#15521) #### Why I did it src/sonic-mgmt-common ``` * 341fd73 - (HEAD -> master, origin/master, origin/HEAD) Remove invalid db type definitions: ERROR_DB, USER_DB (#94) (3 days ago) [Sachin Holla] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 38eef098a374..341fd734b1ff 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 38eef098a374d5af87008fd6de473d150f09d3cb +Subproject commit 341fd734b1ff8486e6c7ceecdc9a50cd5500bb92 From e57692c30d00ab9b4537e918ec8cb0772d6d7c97 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:34:00 +0800 Subject: [PATCH 075/107] [ci/build]: Upgrade SONiC package versions (#15757) --- .../versions-deb-bullseye | 13 ++-- .../build-sonic-slave-bullseye/versions-py3 | 2 +- .../versions-py3-all-arm64 | 1 - files/build/versions/default/versions-git | 4 +- files/build/versions/default/versions-mirror | 24 +++---- files/build/versions/default/versions-web | 7 ++- .../versions-deb-bullseye | 4 +- .../docker-macsec/versions-deb-bullseye | 4 ++ .../dockers/docker-macsec/versions-py3 | 1 + .../docker-platform-monitor/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 1 + .../docker-sonic-mgmt-framework/versions-py3 | 6 +- .../dockers/docker-sonic-vs/versions-py3 | 2 +- .../versions-deb-bullseye | 4 ++ .../docker-swss-layer-bullseye/versions-py3 | 1 + .../versions-deb-bullseye | 63 ++++++++++++++++--- .../versions-deb-bullseye-arm64 | 1 + .../versions-deb-bullseye-armhf | 1 + .../dockers/sonic-slave-bullseye/versions-py3 | 1 + .../sonic-slave-buster/versions-deb-buster | 11 ++-- .../versions/host-image/versions-deb-bullseye | 6 +- files/build/versions/host-image/versions-py3 | 2 +- 22 files changed, 113 insertions(+), 48 deletions(-) create mode 100644 files/build/versions/dockers/docker-macsec/versions-py3 create mode 100644 files/build/versions/dockers/docker-swss-layer-bullseye/versions-py3 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye index 9832f9865917..55ab22200759 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye @@ -1,9 +1,9 @@ applibs==1.mlnx.4.5.5142 applibs-dev==1.mlnx.4.5.5142 bfnplatform==1.0.0 -bfnsdk==1.0.0 isc-dhcp-relay==4.4.1-2.3+deb11u2 kernel-mft-dkms==4.22.1-15 +libdashapi==1.0.0 libhiredis-dev==0.14.1-1 libhiredis0.14==0.14.1-1 libnl-3-dev==3.5.0-1 @@ -14,13 +14,16 @@ libnl-genl-3-dev==3.5.0-1 libnl-nf-3-200==3.5.0-1 libnl-nf-3-dev==3.5.0-1 libnl-route-3-dev==3.5.0-1 +libprotobuf-dev==3.21.12-3 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 +libprotoc32==3.21.12-3 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 libsairedis==1.0.0 libsairedis-dev==1.0.0 libsaithrift-dev==0.9.4 libsaivs==1.0.0 -libsaivs-dev==1.0.0 libswsscommon==1.0.0 libswsscommon-dev==1.0.0 libtac-dev==1.4.1-1 @@ -30,7 +33,7 @@ libteam-utils==1.30-1 libteam5==1.30-1 libteamdctl0==1.30-1 libthrift-0.11.0==0.11.0-4 -libthrift-dev==0.11.0-4 +libthrift-dev==0.14.1 libthrift0==0.14.1 libyang==1.0.73 libyang-cpp==1.0.73 @@ -40,7 +43,9 @@ linux-headers-5.10.0-18-2-common==5.10.140-1 lldpd==1.0.4-1 lm-sensors==1:3.6.0-7 mft==4.22.1-15 +mlnx-sai==1.mlnx.SAIBuild2305.24.0.1 net-tools==1.60+git20181103.0eebece-1 +protobuf-compiler==3.21.12-3 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 python3-thrift==0.14.1 @@ -69,7 +74,7 @@ sxd-libs==1.mlnx.4.5.5142 sxd-libs-dev==1.mlnx.4.5.5142 syncd==1.0.0 syncd-vs==1.0.0 -thrift-compiler==0.11.0-4 +thrift-compiler==0.14.1 wjh-libs==1.mlnx.4.5.5142 wjh-libs-dev==1.mlnx.4.5.5142 wpasupplicant==2:2.9.0-14 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 index c7bad22e6156..2a19509593ea 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -1,6 +1,6 @@ blessed==1.20.0 cffi==1.15.1 -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 click-log==0.4.0 colorful==0.5.5 docker==6.1.3 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 index 46df813bf748..cd01abdaf741 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 @@ -2,4 +2,3 @@ bcrypt==3.2.2 bitarray==1.5.3 click==7.0 requests==2.31.0 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index ed1f62deab14..ae358adf44e1 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==872ac9bd3d35f171a543731bfac1c8597518184e +https://chromium.googlesource.com/chromium/tools/depot_tools.git==247429efd9e04d492ff5fe756818661d7feb7889 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==ea94c8b9f513f8a6ddc6ce1540fa41eaf4c8922a https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 https://github.com/flashrom/flashrom.git==b66f4766b5d7dc614ad609f27dd2794e06b5e2a4 -https://github.com/FreeRADIUS/freeradius-server.git==f43e7b256e2afbd44d07c8e90f0113371bbc8adb +https://github.com/FreeRADIUS/freeradius-server.git==02df5b27df68396150c6424d2a16618f361329af https://github.com/FreeRADIUS/pam_radius.git==8d373539bb9f13b0abfe8bcae0095a930a00fad0 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 485e10ebf30c..70254c9d8fdc 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230704T000215Z -debian-security==20230704T000217Z -download.docker.com_linux_debian_dists_bullseye==2023-06-09T17:17:20Z -download.docker.com_linux_debian_dists_buster==2023-05-26T07:49:38Z +debian==20230707T000210Z +debian-security==20230707T000202Z +download.docker.com_linux_debian_dists_bullseye==2023-07-07T20:10:57Z +download.docker.com_linux_debian_dists_buster==2023-07-07T20:10:57Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230704T000217Z_dists_bullseye-security==2023-07-03T20:07:44Z -packages.trafficmanager.net_snapshot_debian-security_20230704T000217Z_dists_buster_updates==2023-07-03T20:07:43Z -packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_bullseye-backports==2023-07-03T20:15:50Z -packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_bullseye-updates==2023-07-03T20:15:49Z -packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_buster-backports==2023-07-03T20:15:50Z -packages.trafficmanager.net_snapshot_debian_20230704T000215Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230707T000202Z_dists_bullseye-security==2023-07-06T20:09:13Z +packages.trafficmanager.net_snapshot_debian-security_20230707T000202Z_dists_buster_updates==2023-07-06T20:09:13Z +packages.trafficmanager.net_snapshot_debian_20230707T000210Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230707T000210Z_dists_bullseye-backports==2023-07-06T20:09:27Z +packages.trafficmanager.net_snapshot_debian_20230707T000210Z_dists_bullseye-updates==2023-07-06T20:09:28Z +packages.trafficmanager.net_snapshot_debian_20230707T000210Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230707T000210Z_dists_buster-backports==2023-07-06T20:09:27Z +packages.trafficmanager.net_snapshot_debian_20230707T000210Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 0ead0b68cbae..a569f211b972 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -14,6 +14,9 @@ http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0-7.dsc==983d http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0.orig.tar.gz==f60e47b5eb50bbeed48a9f43bb08dd5e http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p15+dfsg-1.debian.tar.xz==896c9b6679f379d8967b012a0cc792c2 http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p15+dfsg.orig.tar.xz==c1c557036197188a22ec285fa53149d8 +http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar.xz==f457e44218a7d4cc7b7ab0ed696096e3 +http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb +http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a http://ftp.us.debian.org/debian/pool/main/s/scapy/python-scapy_2.4.0-2_all.deb==d87d7b22de51937b1e706e4751b86251 http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.1-1.debian.tar.xz==d0ef92c6f301ac5023f7953cf7816ff0 http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.1-1.dsc==ef9e33d036c6dbb74a4ed12fefe2de8a @@ -88,8 +91,8 @@ https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_ https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg.orig.tar.xz==6c2d346ce3320e8999500497e9bacc99 https://sonicstorage.blob.core.windows.net/packages/20190307/bcmcmd?sv=2015-04-05&sr=b&sig=sUdbU7oVbh5exbXXHVL5TDFBTWDDBASHeJ8Cp0B0TIc%3D&se=2038-05-06T22%3A34%3A19Z&sp=r==b8aefc751bdf93218716bca6797460ff https://sonicstorage.blob.core.windows.net/packages/20190307/dsserve?sv=2015-04-05&sr=b&sig=lk7BH3DtW%2F5ehc0Rkqfga%2BUCABI0UzQmDamBsZH9K6w%3D&se=2038-05-06T22%3A34%3A45Z&sp=r==f9d4b815ebb9be9f755dedca8a51170d -https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A12%3A02Z&se=2100-03-09T02%3A12%3A00Z&sr=b&sp=r&sig=n4mqMVnZxC3u14EWRehfl6bqqUAi1VP1uUdHGg3%2B7H4%3D==a34422a3e5e381a792bdfb701b4c62c5 -https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.9.0_amd64.deb?sv=2021-04-10&st=2023-03-08T02%3A10%3A11Z&se=2100-03-09T02%3A10%3A00Z&sr=b&sp=r&sig=mxOWttgAuOXVjvDI3zF5KHcrTHBgg6mv%2FOpTOxlCoVM%3D==3b68300e65c2788806b57e2f090f3617 +https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo-owl_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A25%3A43Z&se=2100-01-31T04%3A25%3A00Z&sr=b&sp=r&sig=%2BdSFujwy0gY%2FiH50Ffi%2FsqZOAHBOFPUcBdR06fHEZkI%3D==cca0a297f413bf6b01ea6761b040d527 +https://sonicstorage.blob.core.windows.net/packages/credosai/libsaicredo_0.8.2_amd64.deb?sv=2021-04-10&st=2023-01-31T04%3A24%3A23Z&se=2100-01-31T04%3A24%3A00Z&sr=b&sp=r&sig=RZPbmaIetvDRtwifrVT4s%2FaQxB%2FBTOyCqXtMtoNRjmY%3D==9107bab0c6295fecd4ab4cd48493bc3f https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.4.1-3.debian.tar.xz?sv=2020-04-08&st=2021-12-14T08%3A00%3A00Z&se=2030-12-14T18%3A18%3A00Z&sr=b&sp=r&sig=C8aYSvaQgMJ58Z13kFY0Wr0J0QF6i7WCeET9%2BpF%2BAxc%3D==e8d1e99b4b9e93f5dde860f6d55f42e3 https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.4.1-3.dsc?sv=2020-04-08&st=2021-12-14T00%3A00%3A00Z&se=2050-12-15T00%3A00%3A00Z&sr=b&sp=r&sig=fIy6dVz3s59K0TiMkTlwSWN8lCzRl3i76ruAtROhfWA%3D==df3ed0dd965589fd09bf6a2920bc273e https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.4.1.orig.tar.gz?sv=2020-04-08&st=2021-12-14T00%3A00%3A00Z&se=2050-12-15T00%3A00%3A00Z&sr=b&sp=r&sig=gpihyZv%2Fr0bVrCUKCKwpS4bIoqiPpdd%2BgCfuUGNHOUc%3D==780d14908dc1a6aa2790de376ab56b7a diff --git a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye index 67ade6f8b5a3..76daecffdd8a 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -14,8 +14,8 @@ libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 -libsaicredo==0.9.0 -libsaicredo-owl==0.9.0 +libsaicredo==0.8.2 +libsaicredo-owl==0.8.2 libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye index 33d136604062..c811dc246953 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bullseye @@ -4,6 +4,7 @@ libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 libcbor0==0.5.0+dfsg-2 libcurl3-gnutls==7.74.0-1.3+deb11u7 +libdashapi==1.0.0 libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 @@ -15,6 +16,8 @@ libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 libpcsclite1==1.9.1-1 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 @@ -24,6 +27,7 @@ libteam5==1.30-1 libteamdctl0==1.30-1 libunwind8==1.3.2-2 openssh-client==1:8.4p1-5+deb11u1 +python3-protobuf==3.21.12-3 sshpass==1.09-1+b1 strace==5.10-1 swss==1.0.0 diff --git a/files/build/versions/dockers/docker-macsec/versions-py3 b/files/build/versions/dockers/docker-macsec/versions-py3 new file mode 100644 index 000000000000..2f66c6818b60 --- /dev/null +++ b/files/build/versions/dockers/docker-macsec/versions-py3 @@ -0,0 +1 @@ +protobuf==4.21.12 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index 8ad105c88c0e..bf73e4489323 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -1,6 +1,6 @@ attrs==20.3.0 certifi==2023.5.7 -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 grpcio==1.39.0 grpcio-tools==1.39.0 guacamole==0.9.2 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 4aa5c3dc84a4..cbea33c9ff9d 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -23,6 +23,7 @@ dbus==1.12.24-0+deb10u1 dbus-user-session==1.12.24-0+deb10u1 dconf-gsettings-backend==0.30.1-2 dconf-service==0.30.1-2 +debian-archive-keyring==2019.1+deb10u2 dh-python==3.20190308 dirmngr==2.2.12-1+deb10u2 dmsetup==2:1.02.155-3 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 index 272991b8d277..e36571edbf43 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -1,7 +1,7 @@ attrs==23.1.0 certifi==2017.4.17 -charset-normalizer==3.1.0 -click==8.1.3 +charset-normalizer==3.2.0 +click==8.1.4 clickclick==20.10.2 connexion==2.7.0 flask==2.2.5 @@ -18,7 +18,7 @@ openapi-schema-validator==0.4.4 openapi-spec-validator==0.5.7 pathable==0.4.3 pkgutil_resolve_name==1.3.10 -protobuf==4.23.3 +protobuf==4.23.4 pyrsistent==0.19.3 python-dateutil==2.6.0 requests==2.31.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index 5f58f9cb9c2e..e52e03bd01dc 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -3,7 +3,7 @@ bcrypt==3.2.2 blessed==1.20.0 certifi==2023.5.7 cffi==1.15.1 -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 click==7.0 click-log==0.4.0 colorful==0.5.5 diff --git a/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye index 3708dc6eb3a1..653aa8fe9518 100644 --- a/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye @@ -1,6 +1,10 @@ iputils-ping==3:20210202-1 +libdashapi==1.0.0 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 libsaimetadata==1.0.0 libsairedis==1.0.0 libteam5==1.30-1 libteamdctl0==1.30-1 +python3-protobuf==3.21.12-3 swss==1.0.0 diff --git a/files/build/versions/dockers/docker-swss-layer-bullseye/versions-py3 b/files/build/versions/dockers/docker-swss-layer-bullseye/versions-py3 new file mode 100644 index 000000000000..2f66c6818b60 --- /dev/null +++ b/files/build/versions/dockers/docker-swss-layer-bullseye/versions-py3 @@ -0,0 +1 @@ +protobuf==4.21.12 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index e5f84cdac4f5..2a4aeca2a106 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -50,7 +50,7 @@ cmake==3.18.4-2+deb11u1 cmake-data==3.18.4-2+deb11u1 cmocka-doc==1.1.5-2 comerr-dev==2.1-1.46.2-2 -containerd.io==1.5.11-1 +containerd.io==1.6.21-1 cowbuilder==0.89 cowdancer==0.89 cpio==2.13+dfsg-4 @@ -59,6 +59,8 @@ cpp-10==10.2.1-6 cppcheck==2.3-1 cron==3.0pl1-137 curl==7.74.0-1.3+deb11u7 +dblatex==0.3.12py3-1 +dblatex-doc==0.3.12py3-1 dbus==1.12.24-0+deb11u1 dbus-user-session==1.12.24-0+deb11u1 dconf-gsettings-backend==0.38.0-2 @@ -67,6 +69,7 @@ dctrl-tools==2.24-3+b1 debhelper==13.3.4 debian-keyring==2021.07.26 debootstrap==1.0.123+deb11u1 +default-jdk==2:1.11-72 default-jdk-headless==2:1.11-72 default-jre==2:1.11-72 default-jre-headless==2:1.11-72 @@ -75,6 +78,7 @@ device-tree-compiler==1.6.0-1 devscripts==2.21.3+deb11u1 dh-apparmor==2.13.6-10 dh-autoreconf==20 +dh-elpa==2.0.8 dh-exec==0.23.2 dh-make==2.202003 dh-python==4.20201102+nmu1 @@ -93,10 +97,12 @@ docbook-dsssl==1.79-9.2 docbook-to-man==1:2.0.0-45 docbook-utils==0.6.14-3.4 docbook-xml==4.5-9 -docker-ce==5:20.10.14~3-0~debian-bullseye -docker-ce-cli==5:20.10.14~3-0~debian-bullseye -docker-ce-rootless-extras==5:24.0.2-1~debian.11~bullseye -docker-scan-plugin==0.23.0~debian-bullseye +docbook-xsl==1.79.2+dfsg-1 +docker-buildx-plugin==0.10.5-1~debian.11~bullseye +docker-ce==5:24.0.2-1~debian.11~bullseye +docker-ce-cli==5:24.0.2-1~debian.11~bullseye +docker-ce-rootless-extras==5:24.0.4-1~debian.11~bullseye +docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 doxygen==1.9.1-1 @@ -109,6 +115,10 @@ dwarves==1.20-1 dwz==0.13+20210201-1 eatmydata==105-9 ed==1.17-1 +emacs-bin-common==1:27.1+1-3.1+deb11u2 +emacs-common==1:27.1+1-3.1+deb11u2 +emacs-el==1:27.1+1-3.1+deb11u2 +emacs-nox==1:27.1+1-3.1+deb11u2 emacsen-common==3.0.4 equivs==2.3.1 exim4-base==4.94.2-7 @@ -124,6 +134,8 @@ fonts-dejavu-core==2.37-2 fonts-dejavu-extra==2.37-2 fonts-droid-fallback==1:6.0.1r16-1.1 fonts-font-awesome==5.0.10+really4.7.0~dfsg-4.1 +fonts-gfs-baskerville==1.1-6 +fonts-gfs-porson==1.1-7 fonts-lato==2.0-2.1 fonts-liberation==1:1.07.4-11 fonts-lmodern==2.004.5-6.1 @@ -247,6 +259,8 @@ libarchive-zip-perl==1.68-1 libarchive13==3.4.3-2+deb11u1 libargon2-1==0~20171227-0.2 libarray-intspan-perl==2.004-1 +libarray-unique-perl==0.08-2.1 +libarray-utils-perl==0.5-1.1 libasan6==10.2.1-6 libasm-java==9.1-1 libasound2==1.2.4-1.1 @@ -385,6 +399,8 @@ libcc1-0==10.2.1-6 libcdi-api-java==1.2-3 libcdparanoia0==3.10.2+debian-13.1 libcdt5==2.42.2-5 +libcgi-fast-perl==1:2.15-1 +libcgi-pm-perl==4.51-1 libcgraph6==2.42.2-5 libchromaprint1==1.5.0-2 libcjson-dev==1.7.14-1 @@ -458,6 +474,7 @@ libdbus-glib-1-dev-bin==0.110-6 libdconf1==0.38.0-2 libde265-0==1.0.11-0+deb11u1 libdebhelper-perl==13.3.4 +libdebian-source-perl==0.116 libdebuginfod1==0.183-1 libdeflate0==1.7-1 libdevel-callchecker-perl==0.008-1+b2 @@ -502,6 +519,7 @@ libel-api-java==3.0.0-3 libelf-dev==0.183-1 libelf1==0.183-1 libemail-address-xs-perl==1.04-1+b3 +libemail-date-format-perl==1.005-1.1 libencode-locale-perl==1.05-1.1 libepoxy-dev==1.5.5-1 libepoxy0==1.5.5-1 @@ -521,6 +539,7 @@ libexpat1==2.2.10-2+deb11u5 libexpat1-dev==2.2.10-2+deb11u5 libexplain-dev==1.4.D001-11+deb11u1 libexplain51==1.4.D001-11+deb11u1 +libexporter-lite-perl==0.08-1 libexporter-tiny-perl==1.002002-1 libfabric1==1.11.0-2 libfakeroot==1.25.3-1.1 @@ -611,6 +630,7 @@ libgmp-dev==2:6.2.1+dfsg-1+deb11u1 libgmpxx4ldbl==2:6.2.1+dfsg-1+deb11u1 libgnutls-dane0==3.7.1-5+deb11u3 libgomp1==10.2.1-6 +libgoogle-gson-java==2.8.6-1+deb11u1 libgoogle-perftools4==2.8.1-1 libgpgme11==1.14.0-1+b2 libgpm2==1.20.7-8 @@ -655,6 +675,7 @@ libhttp-daemon-perl==6.12-1+deb11u1 libhttp-date-perl==6.05-1 libhttp-message-perl==6.28-1 libhttp-negotiate-perl==6.01-1 +libhttp-server-simple-perl==0.52-1.1 libhttp-tiny-multipart-perl==0.08-1.1 libhttpclient-java==4.5.13-2 libhttpcore-java==4.4.14-1 @@ -688,6 +709,7 @@ libip6tc-dev==1.8.7-1 libip6tc2==1.8.7-1 libipc-run-perl==20200505.0-1 libipc-run3-perl==0.048-2 +libipc-shareable-perl==0.61-2 libipc-system-simple-perl==1.30-1 libipt2==2.0.3-1 libiptc-dev==1.8.7-1 @@ -766,6 +788,8 @@ liblmdb0==0.9.24-1 liblocale-gettext-perl==1.07-4+b1 liblog-any-adapter-screen-perl==0.140-1 liblog-any-perl==1.709-1 +liblog-dispatch-perl==2.70-1 +liblog-log4perl-perl==1.54-1 liblog4j1.2-java==1.2.17-10+deb11u1 liblognorm5==2.0.5-1.1 liblqr-1-0==0.4.2-2.1 @@ -817,7 +841,10 @@ libmd-dev==1.0.3-3 libmd0==1.0.3-3 libmd4c0==0.4.7-2 libmfx1==21.1.0-1 +libmime-charset-perl==1.012.2-1 +libmime-lite-perl==3.031-1 libmime-tools-perl==5.509-1 +libmime-types-perl==2.18-1 libmnl-dev==1.0.4-3 libmnl0==1.0.4-3 libmodule-implementation-perl==0.09-1.1 @@ -921,7 +948,9 @@ libpaper1==1.1.28+b1 libparams-classify-perl==0.015-1+b3 libparams-util-perl==1.102-1+b1 libparams-validate-perl==1.30-1+b1 +libparams-validationcompiler-perl==0.30-1 libparboiled-java==1.1.7-2.1 +libparse-debcontrol-perl==2.005-4.1 libpath-iterator-rule-perl==1.014-1 libpath-tiny-perl==0.118-1 libpathplan4==2.42.2-5 @@ -984,10 +1013,7 @@ libpostproc55==7:4.3.6-0+deb11u1 libproc-processtable-perl==0.59-2+b1 libprocps8==2:3.3.17-5 libprotobuf-c1==1.3.3-1+b2 -libprotobuf-dev==3.12.4-1 -libprotobuf-lite23==3.12.4-1 libprotobuf23==3.12.4-1 -libprotoc23==3.12.4-1 libproxy1v5==0.4.17-1 libpsl5==0.21.0-1.2 libpsm-infinipath1==3.3+20.604758e7-6.1 @@ -1089,6 +1115,7 @@ libsnmp40==5.9+dfsg-4+deb11u1 libsoap-lite-perl==1.27-1 libsodium-dev==1.0.18-1 libsodium23==1.0.18-1 +libsombok3==2.4.0-2+b1 libsord-0-0==0.16.8-2 libsort-key-perl==1.33-2+b3 libsort-versions-perl==1.62-1 @@ -1097,6 +1124,7 @@ libsoup2.4-1==2.72.0-2 libsource-highlight-common==3.1.9-3 libsource-highlight4v5==3.1.9-3+b1 libsoxr0==0.1.3-4 +libspecio-perl==0.47-1 libspeex1==1.2~rc1.2-1.1 libsphinxbase3==0.8+5prealpha+1-12 libspice-server1==0.14.3-2.1 @@ -1176,6 +1204,7 @@ libucx0==1.10.1~rc1+really.1.10.0-1 libudev-dev==247.3-7+deb11u2 libudfread0==1.1.1-1 libunbound8==1.13.1-1+deb11u1 +libunicode-linebreak-perl==0.0.20190101-1+b3 libunicode-utf8-perl==0.62-1+b2 libunivocity-parsers-java==2.8.3-2 libunwind-dev==1.3.2-2 @@ -1234,6 +1263,7 @@ libwmf0.2-7==0.2.8.4-17 libwoff1==1.0.2-1+b1 libwrap0==7.6.q-31 libwrap0-dev==7.6.q-31 +libwww-mechanize-perl==2.03-1 libwww-perl==6.52-1 libwww-robotrules-perl==6.02-1 libx11-6==2:1.7.2-1+deb11u1 @@ -1341,6 +1371,7 @@ libxrender1==1:0.9.10-1 libxshmfence1==1.3-1 libxslt1.1==1.1.34-4+deb11u1 libxss1==1:1.2.3-1 +libxstring-perl==0.005-1+b1 libxt-dev==1:1.2.0-1 libxt6==1:1.2.0-1 libxtables-dev==1.8.7-1 @@ -1356,6 +1387,7 @@ libyajl2==2.1.0-3 libyaml-0-2==0.2.2-1 libyaml-dev==0.2.2-1 libyaml-libyaml-perl==0.82+repack-1+b1 +libyaml-tiny-perl==1.73-1 libz3-4==4.8.10-1 libz3-dev==4.8.10-1 libzmq3-dev==4.3.4-1 @@ -1496,7 +1528,6 @@ preview-latex-style==12.2-1 pristine-tar==1.49 procmail==3.22-26+deb11u1 procps==2:3.3.17-5 -protobuf-compiler==3.12.4-1 psmisc==23.4-2 psutils==1.17.dfsg-4 publicsuffix==20220811.1734-0+deb11u1 @@ -1629,6 +1660,7 @@ qtchooser==66-2 qttranslations5-l10n==5.15.2-2 quilt==0.66-2.1 rake==13.0.3-1 +rake-compiler==1.1.1-1 readline-common==8.1-1 rrdtool==1.7.2-3+b7 rsync==3.2.3-4+deb11u1 @@ -1636,9 +1668,15 @@ rsyslog==8.2102.0-2+deb11u1 ruby==1:2.7+2 ruby-all-dev==1:2.7+2 ruby-asciidoctor==2.0.12-2 +ruby-diff-lcs==1.4.4-1 ruby-minitest==5.13.0-1 ruby-net-telnet==0.1.1-2 ruby-power-assert==1.1.7-2 +ruby-rspec==3.9.0c2e2m1s3-2 +ruby-rspec-core==3.9.0c2e2m1s3-2 +ruby-rspec-expectations==3.9.0c2e2m1s3-2 +ruby-rspec-mocks==3.9.0c2e2m1s3-2 +ruby-rspec-support==3.9.0c2e2m1s3-2 ruby-rubygems==3.2.5-2 ruby-test-unit==3.3.9-1 ruby-xmlrpc==0.3.0-2 @@ -1679,15 +1717,21 @@ tex-common==6.16 tex-gyre==20180621-3.1 texi2html==1.82+dfsg1-6 texinfo==6.7.0.dfsg.2-6 +texlive==2020.20210202-3 texlive-base==2020.20210202-3 +texlive-bibtex-extra==2020.20210202-3 texlive-binaries==2020.20200327.54578-7+deb11u1 +texlive-extra-utils==2020.20210202-3 texlive-fonts-recommended==2020.20210202-3 texlive-formats-extra==2020.20210202-3 +texlive-lang-greek==2020.20210202-2 texlive-latex-base==2020.20210202-3 texlive-latex-extra==2020.20210202-3 texlive-latex-recommended==2020.20210202-3 +texlive-luatex==2020.20210202-3 texlive-pictures==2020.20210202-3 texlive-plain-generic==2020.20210202-3 +texlive-science==2020.20210202-3 texlive-xetex==2020.20210202-3 thin-provisioning-tools==0.9.0-1 time==1.9-0.1 @@ -1726,6 +1770,7 @@ xfonts-encodings==1:1.0.4-2.1 xfonts-utils==1:7.7+6 xkb-data==2.29-2 xml-core==0.18+nmu1 +xmlto==0.0.28-2.1 xorg-sgml-doctools==1:1.11-1.1 xsltproc==1.1.34-4+deb11u1 xtrans-dev==1.4.0-1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 index e947381773ed..05ebfa8e9f35 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -16,6 +16,7 @@ libgcc-s1-armhf-cross==10.2.1-6cross1 libgomp1-armhf-cross==10.2.1-6cross1 libstdc++6-armhf-cross==10.2.1-6cross1 libubsan1-armhf-cross==10.2.1-6cross1 +libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 linux-headers-5.10.0-23-arm64==5.10.179-1 linux-headers-arm64==5.10.179-1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index 899e633b7b85..69454f7ebe94 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -5,6 +5,7 @@ golang-1.15-go==1.15.15-1~deb11u4 golang-1.15-src==1.15.15-1~deb11u4 libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 +libunicode-linebreak-perl==0.0.20190101-1+b2 libxslt1-dev==1.1.34-4+deb11u1 linux-compiler-gcc-10-arm==5.10.179-1 linux-headers-5.10.0-23-armmp==5.10.179-1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index aab91a4138ef..fefafa377ca5 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -17,6 +17,7 @@ coverage==5.1 crc16==0.1.1 cryptography==3.3.2 ctypesgen==1.0.2 +dblatex==0.3.12 dbus-python==1.2.16 devscripts==2.21.3+deb11u1 distro-info==1.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 96af63974e6c..ae07b4e673b3 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -91,10 +91,11 @@ docbook-dsssl==1.79-9.1 docbook-to-man==1:2.0.0-42 docbook-utils==0.6.14-3.3 docbook-xml==4.5-8 -docker-ce==5:20.10.21~3-0~debian-buster -docker-ce-cli==5:20.10.21~3-0~debian-buster -docker-ce-rootless-extras==5:24.0.2-1~debian.10~buster -docker-scan-plugin==0.23.0~debian-buster +docker-buildx-plugin==0.10.5-1~debian.10~buster +docker-ce==5:24.0.2-1~debian.10~buster +docker-ce-cli==5:24.0.2-1~debian.10~buster +docker-ce-rootless-extras==5:24.0.4-1~debian.10~buster +docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 dosfstools==4.1-2 @@ -1115,7 +1116,6 @@ libswscale5==7:4.1.11-0+deb10u1 libsynctex2==2018.20181218.49446-1+deb10u2 libsys-hostname-long-perl==1.5-1 libsystemd-dev==241-7~deb10u10 -libsystemd0==241-7~deb10u10 libtag1v5==1.11.1+dfsg.1-0.3+deb10u1 libtag1v5-vanilla==1.11.1+dfsg.1-0.3+deb10u1 libtask-weaken-perl==1.06-1 @@ -1157,7 +1157,6 @@ libtypes-serialiser-perl==1.0-1 libubsan1==8.3.0-6 libuchardet0==0.0.6-3 libudev-dev==241-7~deb10u10 -libudev1==241-7~deb10u10 libunbound8==1.9.0-2+deb10u3 libunicode-utf8-perl==0.62-1 libunwind-dev==1.2.1-10~deb10u1 diff --git a/files/build/versions/host-image/versions-deb-bullseye b/files/build/versions/host-image/versions-deb-bullseye index 84673f52d380..04dac275779c 100644 --- a/files/build/versions/host-image/versions-deb-bullseye +++ b/files/build/versions/host-image/versions-deb-bullseye @@ -18,7 +18,7 @@ busybox==1:1.30.1-6+b3 ca-certificates==20210119 cgroup-tools==0.41-11 conntrack==1:1.4.6-2 -containerd.io==1.5.11-1 +containerd.io==1.6.21-1 cpio==2.13+dfsg-4 cpp==4:10.2.1-1 cpp-10==10.2.1-6 @@ -31,8 +31,8 @@ dirmngr==2.2.27-2+deb11u2 distro-info-data==0.51+deb11u3 dmidecode==3.3-2 dmsetup==2:1.02.175-2.1 -docker-ce==5:20.10.14~3-0~debian-bullseye -docker-ce-cli==5:20.10.14~3-0~debian-bullseye +docker-ce==5:24.0.2-1~debian.11~bullseye +docker-ce-cli==5:24.0.2-1~debian.11~bullseye dpkg-dev==1.20.12 eatmydata==105-9 ebtables==2.0.11-4+b1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 49cf9f80a688..e90730ed21a6 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -6,7 +6,7 @@ bitarray==1.5.3 blessed==1.20.0 certifi==2023.5.7 cffi==1.15.1 -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 click==7.0 click-log==0.4.0 colorful==0.5.5 From 9321c97731fac33c16293a6f12fb2efc203f6821 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 9 Jul 2023 15:16:10 +0800 Subject: [PATCH 076/107] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#15755) --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 81048cd1fb63..63bd9d8b7cbb 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 81048cd1fb63da9fdca567aa863c7d1d43156ed3 +Subproject commit 63bd9d8b7cbbdfec039aa236079c3b5d0c01112c From c07447ae615b8a6489530e88ee5c9f11c05b4ec3 Mon Sep 17 00:00:00 2001 From: Chun'ang Li <39114813+lerry-lee@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:47:40 +0800 Subject: [PATCH 077/107] Refine PR test template format (#15636) Why I did it Refine PR test template format. How I did it Refine PR test template format. How to verify it PR test executed normally. Signed-off-by: Chun'ang Li --- .../run-test-scheduler-template.yml | 114 +++++++++++++++--- azure-pipelines.yml | 30 +++-- 2 files changed, 112 insertions(+), 32 deletions(-) diff --git a/.azure-pipelines/run-test-scheduler-template.yml b/.azure-pipelines/run-test-scheduler-template.yml index 176866a8bc05..7f33240be49b 100644 --- a/.azure-pipelines/run-test-scheduler-template.yml +++ b/.azure-pipelines/run-test-scheduler-template.yml @@ -18,6 +18,10 @@ parameters: type: string default: 1 +- name: NUM_ASIC + type: number + default: 1 + - name: TEST_SET type: string default: "" @@ -34,13 +38,73 @@ parameters: type: string default: "ceos" +- name: TESTBED_NAME + type: string + default: "" + +- name: IMAGE_URL + type: string + default: "" + +- name: HWSKU + type: string + default: "" + +- name: TEST_PLAN_TYPE + type: string + default: "" + +- name: PLATFORM + type: string + default: "" + +- name: SCRIPTS + type: string + default: "" + +- name: FEATURES + type: string + default: "" + +- name: SCRIPTS_EXCLUDE + type: string + default: "" + +- name: FEATURES_EXCLUDE + type: string + default: "" + +- name: REPO_NAME + type: string + default: "" + - name: MGMT_BRANCH type: string - default: master + default: "" + +- name: STOP_ON_FAILURE + type: string + default: "" -- name: NUM_ASIC +- name: RETRY_TIMES + type: string + default: "" + +- name: DUMP_KVM_IF_FAIL + type: string + default: "True" + values: + - "True" + - "False" + +- name: REQUESTER + type: string + default: "" + +- name: MAX_RUN_TEST_MINUTES type: number - default: 1 + default: 480 + steps: - script: | @@ -53,12 +117,20 @@ steps: set -e pip install PyYAML rm -f new_test_plan_id.txt - python ./.azure-pipelines/test_plan.py create -t ${{ parameters.TOPOLOGY }} -o new_test_plan_id.txt \ - --min-worker ${{ parameters.MIN_WORKER }} --max-worker ${{ parameters.MAX_WORKER }} \ - --test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) \ - --deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \ - --mgmt-branch ${{ parameters.MGMT_BRANCH }} --vm-type ${{ parameters.VM_TYPE }} \ + + python ./.azure-pipelines/test_plan.py create \ + -t ${{ parameters.TOPOLOGY }} \ + -o new_test_plan_id.txt \ + --min-worker ${{ parameters.MIN_WORKER }} \ + --max-worker ${{ parameters.MAX_WORKER }} \ + --test-set ${{ parameters.TEST_SET }} \ + --kvm-build-id $(KVM_BUILD_ID) \ + --deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \ + --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \ + --mgmt-branch ${{ parameters.MGMT_BRANCH }} \ + --vm-type ${{ parameters.VM_TYPE }} \ --num-asic ${{ parameters.NUM_ASIC }} + TEST_PLAN_ID=`cat new_test_plan_id.txt` echo "Created test plan $TEST_PLAN_ID" @@ -104,18 +176,20 @@ steps: env: TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) displayName: Run test - - - script: | - set -e - echo "KVM dump" - echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" - echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " - # When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED" - python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP - condition: succeededOrFailed() - env: - TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) - displayName: KVM dump + timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }} + + - ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}: + - script: | + set -e + echo "KVM dump" + echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" + echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " + # When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED" + python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP + condition: succeededOrFailed() + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + displayName: KVM dump - script: | set -e diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6a5af16bc75b..e7d8c3f3b011 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -157,6 +157,7 @@ stages: TOPOLOGY: t0 MIN_WORKER: $(T0_INSTANCE_NUM) MAX_WORKER: $(T0_INSTANCE_NUM) + MGMT_BRANCH: master - job: t0_2vlans_elastictest pool: ubuntu-20.04 @@ -170,6 +171,7 @@ stages: TEST_SET: t0-2vlans MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) + MGMT_BRANCH: master DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - job: t1_lag_elastictest @@ -183,6 +185,7 @@ stages: TOPOLOGY: t1-lag MIN_WORKER: $(T1_LAG_INSTANCE_NUM) MAX_WORKER: $(T1_LAG_INSTANCE_NUM) + MGMT_BRANCH: master - job: multi_asic_elastictest displayName: "kvmtest-multi-asic-t1-lag by Elastictest" @@ -197,6 +200,7 @@ stages: MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM) MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM) NUM_ASIC: 4 + MGMT_BRANCH: master - job: dualtor_elastictest pool: ubuntu-20.04 @@ -209,6 +213,7 @@ stages: TOPOLOGY: dualtor MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) + MGMT_BRANCH: master COMMON_EXTRA_PARAMS: "--disable_loganalyzer " - job: sonic_t0_elastictest @@ -223,18 +228,19 @@ stages: MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) TEST_SET: t0-sonic + MGMT_BRANCH: master COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " VM_TYPE: vsonic - - job: wan_elastictest - displayName: "kvmtest-wan by Elastictest" - pool: ubuntu-20.04 - timeoutInMinutes: 240 - continueOnError: false - steps: - - template: .azure-pipelines/run-test-scheduler-template.yml - parameters: - TOPOLOGY: wan-pub - MIN_WORKER: $(WAN_INSTANCE_NUM) - MAX_WORKER: $(WAN_INSTANCE_NUM) - COMMON_EXTRA_PARAMS: "--skip_sanity " +# - job: wan_elastictest +# displayName: "kvmtest-wan by Elastictest" +# pool: ubuntu-20.04 +# timeoutInMinutes: 240 +# continueOnError: false +# steps: +# - template: .azure-pipelines/run-test-scheduler-template.yml +# parameters: +# TOPOLOGY: wan-pub +# MIN_WORKER: $(WAN_INSTANCE_NUM) +# MAX_WORKER: $(WAN_INSTANCE_NUM) +# COMMON_EXTRA_PARAMS: "--skip_sanity " From cb3ee6571df4a77a8306683946c57d4ca66ae4d1 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Mon, 10 Jul 2023 11:42:11 +0800 Subject: [PATCH 078/107] Remove DNS configuration from minigraph schema (#15727) #### Why I did it We should not modify minigraph schema. #### How I did it Update minigraph.py and remove unit test. #### How to verify it Run sonic-config-engine unit test. --- src/sonic-config-engine/minigraph.py | 9 ++------- .../tests/multi_npu_data/sample-minigraph.xml | 5 ----- .../tests/simple-sample-graph-case.xml | 6 ------ .../tests/simple-sample-graph-metadata.xml | 6 ------ src/sonic-config-engine/tests/test_cfggen.py | 5 ----- src/sonic-config-engine/tests/test_minigraph_case.py | 5 ----- src/sonic-config-engine/tests/test_multinpu_cfggen.py | 11 ----------- 7 files changed, 2 insertions(+), 45 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 625e11c012c3..e0a8b3bd79cb 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -993,7 +993,6 @@ def parse_meta(meta, hname): dhcp_servers = [] dhcpv6_servers = [] ntp_servers = [] - dns_nameservers = [] tacacs_servers = [] mgmt_routes = [] erspan_dst = [] @@ -1024,8 +1023,6 @@ def parse_meta(meta, hname): dhcp_servers = value_group elif name == "NtpResources": ntp_servers = value_group - elif name == "DnsNameserverResources": - dns_nameservers = value_group elif name == "SyslogResources": syslog_servers = value_group elif name == "TacacsServer": @@ -1064,7 +1061,7 @@ def parse_meta(meta, hname): qos_profile = value elif name == "RackMgmtMap": rack_mgmt_map = value - return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, dns_nameservers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map + return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map def parse_linkmeta(meta, hname): @@ -1491,7 +1488,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw dhcp_servers = [] dhcpv6_servers = [] ntp_servers = [] - dns_nameservers = [] tacacs_servers = [] mgmt_routes = [] erspan_dst = [] @@ -1547,7 +1543,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw elif child.tag == str(QName(ns, "UngDec")): (u_neighbors, u_devices, _, _, _, _, _, _) = parse_png(child, hostname, None) elif child.tag == str(QName(ns, "MetadataDeclaration")): - (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, dns_nameservers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map) = parse_meta(child, hostname) + (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, switch_id, switch_type, max_cores, kube_data, macsec_profile, downstream_redundancy_types, redundancy_type, qos_profile, rack_mgmt_map) = parse_meta(child, hostname) elif child.tag == str(QName(ns, "LinkMetadataDeclaration")): linkmetas = parse_linkmeta(child, hostname) elif child.tag == str(QName(ns, "DeviceInfos")): @@ -2003,7 +1999,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) results['DHCP_RELAY'] = dhcp_relay_table results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) - results['DNS_NAMESERVER'] = dict((item, {}) for item in dns_nameservers) results['TACPLUS_SERVER'] = dict((item, {'priority': '1', 'tcp_port': '49'}) for item in tacacs_servers) if len(acl_table_types) > 0: results['ACL_TABLE_TYPE'] = acl_table_types diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml index 0adcec5c8420..be3938f24bc4 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml +++ b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml @@ -1425,11 +1425,6 @@ 17.39.1.129;17.39.1.130 - - DnsNameserverResources - - 1.1.1.1;8.8.8.8 - SnmpResources diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index 7e8f1579cdf4..69b27c33e7b4 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -500,12 +500,6 @@ 10.0.10.1;10.0.10.2 - - DnsNameserverResources - - 1.1.1.1;8.8.8.8 - - SnmpResources diff --git a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml index c841ff8d1a9f..fbc33b49862a 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -236,12 +236,6 @@ 10.0.10.1;10.0.10.2 - - DnsNameserverResources - - 20.2.2.2;30.3.3.3 - - SnmpResources diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 9c1c56d28fce..b84d5acdc5e2 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -696,11 +696,6 @@ def test_metadata_ntp(self): output = self.run_script(argument) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'10.0.10.1': {}, '10.0.10.2': {}}")) - def test_metadata_dns_nameserver(self): - argument = ['-m', self.sample_graph_metadata, '-p', self.port_config, '-v', "DNS_NAMESERVER"] - output = self.run_script(argument) - self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'20.2.2.2': {}, '30.3.3.3': {}}")) - def test_minigraph_vnet(self, **kwargs): graph_file = kwargs.get('graph_file', self.sample_graph_simple) argument = ['-m', graph_file, '-p', self.port_config, '-v', "VNET"] diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 035cff6edb25..d33d2c14e825 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -277,11 +277,6 @@ def test_metadata_ntp(self): output = self.run_script(argument) self.assertEqual(output.strip(), "{'10.0.10.1': {}, '10.0.10.2': {}}") - def test_metadata_dns_nameserver(self): - argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "DNS_NAMESERVER"] - output = self.run_script(argument) - self.assertEqual(output.strip(), "{'1.1.1.1': {}, '8.8.8.8': {}}") - def test_minigraph_vnet(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "VNET"] output = self.run_script(argument) diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 7026dfa84a61..bc4227f85d52 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -150,17 +150,6 @@ def test_metadata_ntp(self): print("Log:asic{} sku {}".format(asic,output)) self.assertDictEqual(output, {}) - def test_metadata_dns_nameserver(self): - argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "DNS_NAMESERVER"] - output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'1.1.1.1': {}, '8.8.8.8': {}}) - #DNS_NAMESERVER data is present only in the host config - argument = ['-m', self.sample_graph, '--var-json', "DNS_NAMESERVER"] - for asic in range(NUM_ASIC): - output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) - print("Log:asic{} sku {}".format(asic,output)) - self.assertDictEqual(output, {}) - def test_mgmt_port(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "MGMT_PORT"] output = json.loads(self.run_script(argument)) From 430330800ea07fb7d82152ff52aff46b0adf1df2 Mon Sep 17 00:00:00 2001 From: Baorong Liu Date: Mon, 10 Jul 2023 10:14:11 -0700 Subject: [PATCH 079/107] [staticroutebfd] fix ipv6 letter case issue (#15765) *use lower case for IPv6 address as internal key and bfd session key. fixes #15764 Why I did it *staticroutebfd uses the IPv6 address string as a key to create bfd session and cache the bfd sessions using it as a key. When the IPv6 address string has uppercase letter in the static route nexthop list, the string with uppercase letter key is stored in the cache, but the BFD STATE_DB uses lowercase for IPv6 address, so when the staticroutebfd get the bfd state event, it cannot find the bfd session in its local cache because of the letter case. --- src/sonic-bgpcfgd/staticroutebfd/main.py | 8 ++ src/sonic-bgpcfgd/tests/test_static_rt_bfd.py | 76 +++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/src/sonic-bgpcfgd/staticroutebfd/main.py b/src/sonic-bgpcfgd/staticroutebfd/main.py index e3b2ed10be30..268dbd3c1669 100644 --- a/src/sonic-bgpcfgd/staticroutebfd/main.py +++ b/src/sonic-bgpcfgd/staticroutebfd/main.py @@ -66,6 +66,9 @@ def static_route_split_key(key): :param key: key to split :return: valid, vrf name extracted from the key, ip prefix extracted from the key """ + if key is None or len(key) == 0: + return False, "", "" + l = tuple(key.split('|')) if len(l) == 1: @@ -376,6 +379,11 @@ def static_route_set_handler(self, key, data): log_err("invalid ip prefix for static route: ", key) return True + #use lower case if there is letter in IPv6 address string + if 'nexthop' in data: + nh = data['nexthop'] + data['nexthop'] = nh.lower() + arg_list = lambda v: [x.strip() for x in v.split(',')] if len(v.strip()) != 0 else None bfd_field = arg_list(data['bfd']) if 'bfd' in data else ["false"] diff --git a/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py b/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py index 0e4d62475988..6d07894c0fae 100644 --- a/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py +++ b/src/sonic-bgpcfgd/tests/test_static_rt_bfd.py @@ -94,6 +94,82 @@ def intf_setup(dut): {}, {} ) + set_del_test(dut, "intf", + "SET", + ("if1|2603:10E2:400:1::1/64",{} + ), + {}, + {} + ) + set_del_test(dut, "intf", + "SET", + ("if2|2603:10E2:400:2::1/64",{} + ), + {}, + {} + ) + set_del_test(dut, "intf", + "SET", + ("if3|2603:10E2:400:3::1/64",{} + ), + {}, + {} + ) + +def test_set_del_ipv6(): + dut = constructor() + intf_setup(dut) + + set_del_test(dut, "srt", + "SET", + ("2603:10e2:400::4/128", { + "bfd": "true", + "ifname": "if1, if2, if3", + "nexthop": "2603:10E2:400:1::2,2603:10E2:400:2::2,2603:10e2:400:3::2" + }), + { + "set_default:default:2603:10e2:400:1::2" : {'multihop': 'true', 'rx_interval': '50', 'tx_interval': '50', 'multiplier': '3', 'local_addr': '2603:10E2:400:1::1'}, + "set_default:default:2603:10e2:400:2::2" : {'multihop': 'true', 'rx_interval': '50', 'tx_interval': '50', 'multiplier': '3', 'local_addr': '2603:10E2:400:2::1'}, + "set_default:default:2603:10e2:400:3::2" : {'multihop': 'true', 'rx_interval': '50', 'tx_interval': '50', 'multiplier': '3', 'local_addr': '2603:10E2:400:3::1'} + }, + {} + ) + + set_del_test(dut, "bfd", + "SET", + ("2603:10e2:400:1::2", { + "state": "Up" + }), + {}, + {'set_default:2603:10e2:400::4/128': {'nexthop': '2603:10e2:400:1::2', 'ifname': 'if1', 'nexthop-vrf': 'default', 'expiry': 'false'}} + ) + set_del_test(dut, "bfd", + "SET", + ("2603:10e2:400:2::2", { + "state": "Up" + }), + {}, + {'set_default:2603:10e2:400::4/128': {'nexthop': '2603:10e2:400:1::2,2603:10e2:400:2::2', 'ifname': 'if1,if2', 'nexthop-vrf': 'default,default', 'expiry': 'false'}} + ) + set_del_test(dut, "bfd", + "SET", + ("2603:10e2:400:3::2", { + "state": "Up" + }), + {}, + {'set_default:2603:10e2:400::4/128': {'nexthop': '2603:10e2:400:1::2,2603:10e2:400:2::2,2603:10e2:400:3::2', 'ifname': 'if1,if2,if3', 'nexthop-vrf': 'default,default,default', 'expiry': 'false'}} + ) + + set_del_test(dut, "srt", + "DEL", + ("2603:10e2:400::4/128", { }), + { + "del_default:default:2603:10e2:400:1::2" : {}, + "del_default:default:2603:10e2:400:2::2" : {}, + "del_default:default:2603:10e2:400:3::2" : {} + }, + {'del_default:2603:10e2:400::4/128': { }} + ) def test_set_del(): dut = constructor() From 7639df0868ac537a4777499ca0dedf69430a1dba Mon Sep 17 00:00:00 2001 From: ycoheNvidia <99744138+ycoheNvidia@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:27:41 +0300 Subject: [PATCH 080/107] Added ssh configurations to YANG model (#13338) - Why I did it Implemented ssh configurations - How I did it Added ssh config table in configDB, once changed - hostcfgd will change the relevant OS files (sshd_config) - How to verify it Tests in sonic-host-services. Change relevant configs in configDB such as ports, and see sshd port was modified --- src/sonic-yang-models/doc/Configuration.md | 20 +++++++ src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 8 +++ .../yang_model_tests/tests/ssh-server.json | 26 ++++++++ .../tests_config/ssh-server.json | 60 +++++++++++++++++++ .../yang-models/sonic-ssh-server.yang | 46 ++++++++++++++ 6 files changed, 161 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/ssh-server.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/ssh-server.json create mode 100644 src/sonic-yang-models/yang-models/sonic-ssh-server.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index ab633a715850..fdb92ddce805 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -79,6 +79,7 @@ Table of Contents * [LOGGER](#logger) * [WRED_PROFILE](#wred_profile) * [PASSWORD_HARDENING](#password_hardening) + * [SSH_SERVER](#ssh_server) * [SYSTEM_DEFAULTS table](#systemdefaults-table) * [RADIUS](#radius) * [Static DNS](#static-dns) @@ -2321,6 +2322,25 @@ There are 4 classes } ``` +### SSH_SERVER + +In this table, we allow configuring ssh server global settings. This will feature includes 3 configurations: + +- authentication_retries - number of login attepmts 1-100 +- login_timeout - Timeout in seconds for login session for user to connect 1-600 +- ports - Ssh port numbers - string of port numbers seperated by ',' +``` +{ + "SSH_SERVER": { + "POLICIES":{ + "authentication_retries": "6", + "login_timeout": "120", + "ports": "22" + } + } +} +``` + ### BREAKOUT_CFG This table is introduced as part of Dynamic Port Breakout(DPB) feature. diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index b4bdc2da47f0..f3de50de857a 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -140,6 +140,7 @@ def run(self): './yang-models/sonic-nat.yang', './yang-models/sonic-nvgre-tunnel.yang', './yang-models/sonic-passwh.yang', + './yang-models/sonic-ssh-server.yang', './yang-models/sonic-pbh.yang', './yang-models/sonic-port.yang', './yang-models/sonic-policer.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 2de693e58579..1ee67afff860 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2225,6 +2225,14 @@ } }, + "SSH_SERVER": { + "POLICIES":{ + "authentication_retries": "6", + "login_timeout": "120", + "ports": "22" + } + }, + "MACSEC_PROFILE": { "test": { "priority": "64", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/ssh-server.json b/src/sonic-yang-models/tests/yang_model_tests/tests/ssh-server.json new file mode 100644 index 000000000000..f3a1c30ef47a --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/ssh-server.json @@ -0,0 +1,26 @@ +{ + "SSH_SERVER_VALID": { + "desc": "Configure default SSH_SERVER." + }, + "SSH_SERVER_VALID_MODIFIED": { + "desc": "Configure modified SSH_SERVER." + }, + "SSH_SERVER_INVALID_AUTH_RETRIES": { + "desc": "Configure invalid number of authentication retries in SSH_SERVER.", + "eStrKey" : "Pattern", + "eStr": ["1..100"] + }, + "SSH_SERVER_INVALID_LOGIN_TIMEOUT": { + "desc": "Configure invalid login timeout value in SSH_SERVER.", + "eStrKey" : "Pattern", + "eStr": ["1..600"] + }, + "SSH_SERVER_INVALID_PORTS_1": { + "desc": "Configure invalid port value in SSH_SERVER.", + "eStr": "Invalid port numbers value" + }, + "SSH_SERVER_INVALID_PORTS_2": { + "desc": "Configure invalid port value in SSH_SERVER.", + "eStr": "Invalid port numbers value" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ssh-server.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ssh-server.json new file mode 100644 index 000000000000..e0abc1a1320a --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ssh-server.json @@ -0,0 +1,60 @@ +{ + "SSH_SERVER_VALID": { + "sonic-ssh-server:sonic-ssh-server": { + "sonic-ssh-server:SSH_SERVER": { + "POLICIES":{ + "authentication_retries": "6", + "login_timeout": "120", + "ports": "22" + } + } + } + }, + "SSH_SERVER_VALID_MODIFIED": { + "sonic-ssh-server:sonic-ssh-server": { + "sonic-ssh-server:SSH_SERVER": { + "POLICIES":{ + "authentication_retries": "16", + "login_timeout": "140", + "ports": "22,222" + } + } + } + }, + "SSH_SERVER_INVALID_AUTH_RETRIES": { + "sonic-ssh-server:sonic-ssh-server": { + "sonic-ssh-server:SSH_SERVER": { + "POLICIES":{ + "authentication_retries": "200" + } + } + } + }, + "SSH_SERVER_INVALID_LOGIN_TIMEOUT": { + "sonic-ssh-server:sonic-ssh-server": { + "sonic-ssh-server:SSH_SERVER": { + "POLICIES":{ + "login_timeout": "606" + } + } + } + }, + "SSH_SERVER_INVALID_PORTS_1": { + "sonic-ssh-server:sonic-ssh-server": { + "sonic-ssh-server:SSH_SERVER": { + "POLICIES":{ + "ports": "port22" + } + } + } + }, + "SSH_SERVER_INVALID_PORTS_2": { + "sonic-ssh-server:sonic-ssh-server": { + "sonic-ssh-server:SSH_SERVER": { + "POLICIES":{ + "ports": "22.222" + } + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-ssh-server.yang b/src/sonic-yang-models/yang-models/sonic-ssh-server.yang new file mode 100644 index 000000000000..a53fddac5bfc --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-ssh-server.yang @@ -0,0 +1,46 @@ + +//filename: sonic-ssh-server.yang +module sonic-ssh-server { + yang-version 1.1; + namespace "http://github.com/sonic-net/sonic-ssh-server"; + prefix sshg; + + description "SSH SERVER CONFIG YANG Module for SONiC OS"; + + revision 2022-08-29 { + description + "First Revision"; + } + + container sonic-ssh-server { + container SSH_SERVER { + description "SSH SERVER CONFIG part of config_db.json"; + container POLICIES { + leaf authentication_retries { + description "number of login attepmts"; + default 6; + type uint32 { + range 1..100; + } + } + leaf login_timeout { + description "login timeout (secs unit)"; + default 120; + type uint32 { + range 1..600; + } + } + leaf ports { + description "ssh port numbers"; + default "22"; + type string { + pattern '([1-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-6])(,([1-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-6]))*' { + error-message "Invalid port numbers value"; + error-app-tag ssh-server-ports-invalid-value; + } + } + } + }/*container policies */ + } /* container SSH_SERVER */ + }/* container sonic-ssh-server */ +}/* end of module sonic-ssh-server */ From 72021fdb0f6e1b003f53a87a93d9f57480a047e3 Mon Sep 17 00:00:00 2001 From: iavraham <122345477+iavraham@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:40:08 +0300 Subject: [PATCH 081/107] Add remote syslog configuration (#14513) * Add an ability to configure remote syslog servers * Add an initial configuration for remote syslog * Extend YANG module and add unit tests #### Why I did it Adding the following functionality to rsyslog feature: - Configure remote syslog servers: protocol, filter, severity level - Update global syslog configuration: severity level, message format #### How I did it added parameters to syslog server and global configuration. #### How to verify it create syslog server using CLI/adding to Redis-DB verify server is added to file /etc/rsyslog.conf and server is functional. #### Description for the changelog extend rsyslog capabilities, added server and global configuration parameters. #### Link to config_db schema for YANG module changes https://github.com/iavraham/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-syslog.yang --- files/image_config/rsyslog/rsyslog-config.sh | 5 +- files/image_config/rsyslog/rsyslog.conf.j2 | 72 ++++--- src/sonic-utilities | 2 +- src/sonic-yang-models/doc/Configuration.md | 108 ++++++---- .../tests/files/sample_config_db.json | 13 +- .../tests/yang_model_tests/tests/syslog.json | 59 +++++- .../yang_model_tests/tests_config/syslog.json | 184 ++++++++++++++++-- .../yang-models/sonic-syslog.yang | 78 +++++++- 8 files changed, 438 insertions(+), 83 deletions(-) diff --git a/files/image_config/rsyslog/rsyslog-config.sh b/files/image_config/rsyslog/rsyslog-config.sh index 83be7ab6cf71..576351711364 100755 --- a/files/image_config/rsyslog/rsyslog-config.sh +++ b/files/image_config/rsyslog/rsyslog-config.sh @@ -17,7 +17,10 @@ if [[ ($NUM_ASIC -gt 1) ]]; then else udp_server_ip=$(ip -j -4 addr list lo scope host | jq -r -M '.[0].addr_info[0].local') fi +hostname=$(hostname) -sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog.conf.j2 -a "{\"udp_server_ip\": \"$udp_server_ip\"}" >/etc/rsyslog.conf +sonic-cfggen -d -t /usr/share/sonic/templates/rsyslog.conf.j2 \ + -a "{\"udp_server_ip\": \"$udp_server_ip\", \"hostname\": \"$hostname\"}" \ + > /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 d20fb5d00aec..c29d803d085a 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -15,21 +15,14 @@ $ModLoad imuxsock # provides support for local system logging -{% if SYSLOG_CONFIG is defined %} -{% if 'GLOBAL' in SYSLOG_CONFIG %} -{% if 'rate_limit_interval' in SYSLOG_CONFIG['GLOBAL']%} -{% set rate_limit_interval = SYSLOG_CONFIG['GLOBAL']['rate_limit_interval'] %} -{% endif %} -{% if 'rate_limit_burst' in SYSLOG_CONFIG['GLOBAL']%} -{% set rate_limit_burst = SYSLOG_CONFIG['GLOBAL']['rate_limit_burst'] %} -{% endif %} -{% endif %} -{% endif %} +{% set gconf = (SYSLOG_CONFIG | d({})).get('GLOBAL', {}) -%} +{% set rate_limit_interval = gconf.get('rate_limit_interval') %} +{% set rate_limit_burst = gconf.get('rate_limit_burst') %} -{% if rate_limit_interval is defined %} +{% if rate_limit_interval is not none %} $SystemLogRateLimitInterval {{ rate_limit_interval }} {% endif %} -{% if rate_limit_burst is defined %} +{% if rate_limit_burst is not none %} $SystemLogRateLimitBurst {{ rate_limit_burst }} {% endif %} @@ -49,6 +42,8 @@ $UDPServerRun 514 ########################### #### GLOBAL DIRECTIVES #### ########################### +{% set format = gconf.get('format', 'standard') -%} +{% set fw_name = gconf.get('welf_firewall_name', hostname) -%} # # Use traditional timestamp format. # To enable high precision timestamps, comment out the following line. @@ -59,6 +54,10 @@ $UDPServerRun 514 $template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionFileDefaultTemplate SONiCFileFormat +template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall time=\"%timereported\ +:::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\ +:::date-second%\" fw=\"{{ fw_name }}\" pri=%syslogpriority% msg=\"%syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\"\n") + # # Set the default permissions for all log files. # @@ -91,25 +90,36 @@ $RepeatedMsgReduction on # Remote syslog logging # -# The omfwd plug-in provides the core functionality of traditional message forwarding via UDP and plain TCP. -# It is a built-in module that does not need to be loaded. +# The omfwd plug-in provides the core functionality of traditional message +# forwarding via UDP and plain TCP. It is a built-in module that does not need +# to be loaded. -{% if SYSLOG_SERVER is defined %} -{% for server, data in SYSLOG_SERVER.items() %} -{% set params_list = [] %} -{% if 'source' in data %} -{% set dummy = params_list.append('address=' + '"' + data.source|string + '"') %} -{% endif %} -{% if 'port' in data %} -{% set dummy = params_list.append('port=' + '"' + data.port|string + '"') %} -{% endif %} -{% if 'vrf' in data and data['vrf'] != "default" %} -{% set dummy = params_list.append('device=' + '"' + data.vrf|string + '"') %} -{% endif %} -{% if params_list %} -*.* action(type="omfwd" target="{{ server }}" protocol="udp" {{ params_list|join(' ') }} template="SONiCFileFormat") -{% else %} -*.* action(type="omfwd" target="{{ server }}" protocol="udp" template="SONiCFileFormat") +{% set servers = SYSLOG_SERVER | d({}) -%} +{% for server in servers %} +{% set conf = servers[server] | d({}) -%} + +{% set source = conf.get('source') -%} +{% set port = conf.get('port', 514) -%} +{% set proto = conf.get('protocol', 'udp') -%} +{% set vrf = conf.get('vrf', 'default') -%} +{% set severity = conf.get('severity', gconf.get('severity', 'notice')) -%} +{% set filter = conf.get('filter') -%} +{% set regex = conf.get('filter_regex') -%} + +{% set fmodifier = '!' if filter == 'exclude' else '' %} +{% set device = 'eth0' if vrf == 'default' else vrf -%} +{% set template = 'WelfRemoteFormat' if format == 'welf' else 'SONiCFileFormat' -%} + +{# Server extra options -#} +{% set options = '' -%} + +{% if source -%} + {% set options = options ~ ' Address="' ~ source ~ '"'-%} +{% endif -%} + +{% if filter %} +:msg, {{ fmodifier }}ereregex, "{{ regex }}" {% endif %} +*.{{ severity }} +action(type="omfwd" Target="{{ server }}" Port="{{ port }}" Protocol="{{ proto }}" Device="{{ device }}" Template="{{ template }}"{{ options }}) {% endfor %} -{% endif %} diff --git a/src/sonic-utilities b/src/sonic-utilities index dbcaaf8aa27b..659ba24b44ee 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit dbcaaf8aa27b37dfba1b088e2fa59fd94b8dc683 +Subproject commit 659ba24b44ee50da364a2c4e7aba43c607448e43 diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index fdb92ddce805..44b9f5aa9425 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -51,7 +51,7 @@ Table of Contents * [MUX_LINKMGR](#mux_linkmgr) * [NEIGH](#neigh) * [NTP Global Configuration](#ntp-global-configuration) - * [NTP and SYSLOG servers](#ntp-and-syslog-servers) + * [NTP Servers](#ntp-servers) * [Peer Switch](#peer-switch) * [Policer](#policer) * [Port](#port) @@ -60,7 +60,8 @@ Table of Contents * [Scheduler](#scheduler) * [Port QoS Map](#port-qos-map) * [Queue](#queue) - * [Syslog Rate Limit](#syslog-rate-limit) + * [Syslog Global Configuration](#syslog-global-configuration) + * [Syslog Servers](#syslog-servers) * [Sflow](#sflow) * [Restapi](#restapi) * [System Port](#system-port) @@ -1512,7 +1513,7 @@ for that address. } ``` -### NTP and SYSLOG servers +### NTP servers These information are configured in individual tables. Domain name or IP address of the server is used as object key. Currently there are no @@ -1535,35 +1536,6 @@ attributes in those objects. } ``` -***Syslog server*** -``` -{ - "SYSLOG_SERVER": { - "10.0.0.5": {}, - "10.0.0.6": {}, - "10.11.150.5": {} - }, - - "SYSLOG_SERVER" : { - "2.2.2.2": { - "source": "1.1.1.1", - "port": "514", - "vrf": "default" - }, - "4.4.4.4": { - "source": "3.3.3.3", - "port": "514", - "vrf": "mgmt" - }, - "2222::2222": { - "source": "1111::1111", - "port": "514", - "vrf": "Vrf-Data" - } - } -} -``` - ### Peer Switch Below is an exmaple of the peer switch table configuration. @@ -1849,7 +1821,33 @@ key - name | collector_port | Destination L4 port of the Sflow collector | | 6343 | | | collector_vrf | Specify the Collector VRF. In this revision, it is either default VRF or Management VRF.| | | | -### Syslog Rate Limit +### Syslog Global Configuration + +These configuration options are used to configure rsyslog utility and the way +the system generates logs. + +***Configuration sample*** +``` +{ + "SYSLOG_CONFIG": { + "GLOBAL": { + "rate_limit_interval": "5", + "rate_limit_burst": "100", + "format": "welf", + "welf_firewall_name": "bla", + "severity": "info" + } + } +} +``` + +* `rate_limit_interval` - determines the amount of time that is being measured for rate limiting: `unsigned integer` +* `rate_limit_burst` - defines the amount of messages, that have to occur in the time limit: `unsigned integer` +* `format` - syslog log format: `{standard, welf}` +* `welf_firewall_name` - WELF format firewall name: `string` +* `severity` - global log severity: `{emerg, alert, crit, error, warning, notice, info, debug}` + +***Syslog Rate Limit*** Host side configuration: @@ -1881,6 +1879,50 @@ Container side configuration: } ``` +### Syslog servers + +These information are configured in individual tables. Domain name or IP +address of the server is used as object key. Each server can be configurable. + +***Configuration sample*** +``` +{ + "SYSLOG_SERVER": { + "10.0.0.5": {}, + "10.0.0.6": {}, + "10.11.150.5": {} + }, + + "SYSLOG_SERVER" : { + "4.4.4.4": { + "source": "3.3.3.3", + "port": "514", + "vrf": "mgmt" + }, + "2222::2222": { + "source": "1111::1111", + "port": "514", + "vrf": "Vrf-Data" + }, + "somehostname": { + "filter": "include", + "filter_regex": "ololo", + "port": "514", + "protocol": "tcp", + "severity": "notice", + "vrf": "default" + } + } +} +``` + +* `filter` - determines if syslog will include or exclude messages specified by regex: `{include, exclude}` +* `filter_regex` - filter messages by this regex: `string` +* `port` - network port to use to connect to remote server: `integer: 1..65535` +* `protocol` - network protocol to use to connect to remote server: `{tcp, udp}` +* `severity` - per-server log severity, overrifes global one: `{emerg, alert, crit, error, warning, notice, info, debug}` + + ### System Port Every port on the system requires a global representation, known as a System Port, and is listed in this table. diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 1ee67afff860..742c68848f42 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -499,12 +499,23 @@ "source": "1111::1111", "port": "514", "vrf": "Vrf_blue" + }, + "somehostname": { + "filter": "include", + "filter_regex": "ololo", + "port": "514", + "protocol": "tcp", + "severity": "notice", + "vrf": "default" } }, "SYSLOG_CONFIG" : { "GLOBAL": { "rate_limit_interval": "5", - "rate_limit_burst": "100" + "rate_limit_burst": "100", + "format": "welf", + "welf_firewall_name": "bla", + "severity": "info" } }, "SYSLOG_CONFIG_FEATURE" : { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/syslog.json b/src/sonic-yang-models/tests/yang_model_tests/tests/syslog.json index da277f113486..4b2eb0ae1da2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/syslog.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/syslog.json @@ -29,10 +29,6 @@ "desc": "Load syslog server table with empty address as syslog server.", "eStrKey": "InvalidValue" }, - "SYSLOG_SERVER_INVALID_IPADDR_TEST": { - "desc": "Load syslog server table with invalid ipv4 address as syslog server.", - "eStrKey": "InvalidValue" - }, "SYSLOG_SERVER_INVALID_IPV6_ADDR_TEST": { "desc": "Load syslog server table with invalid ipv6 address as syslog server.", "eStrKey": "InvalidValue" @@ -62,5 +58,60 @@ "SYSLOG_CONFIG_FEATURE_INVALID_BURST": { "desc": "Configure invalid rate_limit_burst in SYSLOG_CONFIG_FEATURE.", "eStrKey": "InvalidValue" + }, + "SYSLOG_SERVER_HOSTNAME": { + "desc": "Load syslog server table with hostname" + }, + "SYSLOG_SERVER_HOSTNAME_INVALID": { + "desc": "Load syslog server table with invalid hostname", + "eStrKey": "InvalidValue" + }, + "SYSLOG_SERVER_FILTER_TYPE": { + "desc": "Valid filter type for syslog server" + }, + "SYSLOG_SERVER_FILTER_TYPE_INVALID": { + "desc": "Invalid filter type for syslog server", + "eStrKey": "InvalidValue" + }, + "SYSLOG_SERVER_FILTER_REGEX": { + "desc": "Valid filter regex" + }, + "SYSLOG_SERVER_PROTOCOL": { + "desc": "Valid syslog server protocol" + }, + "SYSLOG_SERVER_PROTOCOL_INVALID": { + "desc": "Invalid syslog server protocol", + "eStrKey": "InvalidValue" + }, + "SYSLOG_SERVER_SEVERITY": { + "desc": "Syslog server valid severity" + }, + "SYSLOG_SERVER_SEVERITY_INVALID": { + "desc": "Syslog server invalid severity", + "eStrKey": "InvalidValue" + }, + "SYSLOG_CONFIG_GLOBAL_VALID": { + "desc": "Global syslog configuration" + }, + "SYSLOG_CONFIG_FORMAT": { + "desc": "Syslog format type" + }, + "SYSLOG_CONFIG_FORMAT_INVALID": { + "desc": "Invalid syslog format", + "eStrKey": "InvalidValue" + }, + "SYSLOG_CONFIG_FORMAT_WELF_FW_NAME": { + "desc": "Syslog format WELF firewall name" + }, + "SYSLOG_CONFIG_FORMAT_WELF_FW_NAME_INVALID": { + "desc": "Syslog format WELF invalid firewall name", + "eStrKey": "Must" + }, + "SYSLOG_CONFIG_SEVERITY": { + "desc": "Global syslog severity" + }, + "SYSLOG_CONFIG_SEVERITY_INVALID": { + "desc": "Global invalid syslog severity", + "eStrKey": "InvalidValue" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/syslog.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/syslog.json index 0ebaddbc7044..d3505b6a31bd 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/syslog.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/syslog.json @@ -136,17 +136,6 @@ } } }, - "SYSLOG_SERVER_INVALID_IPADDR_TEST" : { - "sonic-syslog:sonic-syslog": { - "sonic-syslog:SYSLOG_SERVER": { - "SYSLOG_SERVER_LIST": [ - { - "server_address": "1111.22.33.1" - } - ] - } - } - }, "SYSLOG_SERVER_INVALID_IPV6_ADDR_TEST" : { "sonic-syslog:sonic-syslog": { "sonic-syslog:SYSLOG_SERVER": { @@ -209,6 +198,64 @@ } } }, + "SYSLOG_SERVER_HOSTNAME" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "thebestswitch" + } + ] + } + } + }, + "SYSLOG_SERVER_HOSTNAME_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "-" + } + ] + } + } + }, + "SYSLOG_SERVER_FILTER_TYPE" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "filter": "exclude" + } + ] + } + } + }, + "SYSLOG_SERVER_FILTER_TYPE_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "filter": "excludalol" + } + ] + } + } + }, + "SYSLOG_SERVER_FILTER_REGEX" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "filter_regex": "^expeliarmus.*" + } + ] + } + } + }, "SYSLOG_CONFIG_FEATURE_INVALID_SERVICE_NAME": { "sonic-syslog:sonic-syslog": { "sonic-syslog:SYSLOG_CONFIG_FEATURE": { @@ -222,6 +269,18 @@ } } }, + "SYSLOG_SERVER_PROTOCOL" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "protocol": "tcp" + } + ] + } + } + }, "SYSLOG_CONFIG_FEATURE_INVALID_INTERVAL": { "sonic-syslog:sonic-syslog": { "sonic-syslog:SYSLOG_CONFIG_FEATURE": { @@ -244,6 +303,30 @@ } } }, + "SYSLOG_SERVER_PROTOCOL_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "protocol": "order66" + } + ] + } + } + }, + "SYSLOG_SERVER_SEVERITY" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "severity": "info" + } + ] + } + } + }, "SYSLOG_CONFIG_FEATURE_INVALID_BURST": { "sonic-syslog:sonic-syslog": { "sonic-syslog:SYSLOG_CONFIG_FEATURE": { @@ -265,5 +348,84 @@ ] } } + }, + "SYSLOG_SERVER_SEVERITY_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_SERVER": { + "SYSLOG_SERVER_LIST": [ + { + "server_address": "1.2.3.4", + "severity": "information" + } + ] + } + } + }, + "SYSLOG_CONFIG_GLOBAL_VALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "format": "welf", + "welf_firewall_name": "welf-fw-name", + "severity": "debug" + } + } + } + }, + "SYSLOG_CONFIG_FORMAT" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "format": "standard" + } + } + } + }, + "SYSLOG_CONFIG_FORMAT_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "format": "nonstandard" + } + } + } + }, + "SYSLOG_CONFIG_FORMAT_WELF_FW_NAME" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "format": "welf", + "welf_firewall_name": "welf-switch" + } + } + } + }, + "SYSLOG_CONFIG_FORMAT_WELF_FW_NAME_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "format": "standard", + "welf_firewall_name": "welf-switch" + } + } + } + }, + "SYSLOG_CONFIG_SEVERITY" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "severity": "crit" + } + } + } + }, + "SYSLOG_CONFIG_SEVERITY_INVALID" : { + "sonic-syslog:sonic-syslog": { + "sonic-syslog:SYSLOG_CONFIG": { + "GLOBAL": { + "severity": "critical" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-syslog.yang b/src/sonic-yang-models/yang-models/sonic-syslog.yang index 6a4750f708d7..24e33f20acae 100644 --- a/src/sonic-yang-models/yang-models/sonic-syslog.yang +++ b/src/sonic-yang-models/yang-models/sonic-syslog.yang @@ -49,6 +49,44 @@ module sonic-syslog { } } + typedef log-format { + description "Represents syslog log format"; + type enumeration { + enum welf; + enum standard; + } + } + + typedef rsyslog-protocol { + description "The protocol to send logs to remote server"; + type enumeration { + enum tcp; + enum udp; + } + } + + typedef syslog-filter-type { + description "The filter type"; + type enumeration { + enum include; + enum exclude; + } + } + + typedef rsyslog-severity { + description "The protocol to send logs to remote server"; + type enumeration { + enum none; + enum debug; + enum info; + enum notice; + enum warn; + enum error; + enum crit; + } + } + + container sonic-syslog { container SYSLOG_SERVER { @@ -61,7 +99,7 @@ module sonic-syslog { leaf server_address { description "Syslog server IP address"; - type inet:ip-address; + type inet:host; } leaf source { @@ -88,6 +126,26 @@ module sonic-syslog { or (/mvrf:sonic-mgmt_vrf/mvrf:MGMT_VRF_CONFIG/mvrf:vrf_global/mvrf:mgmtVrfEnabled = 'true')"; } + leaf filter { + description "Syslog filter type"; + type syslog-filter-type; + } + + leaf filter_regex { + description "Filter regex"; + type string; + } + + leaf protocol { + description "The protocol to send logs to remote server"; + type rsyslog-protocol; + } + + leaf severity { + description "Limit the severity to send logs to remote server"; + type rsyslog-severity; + } + } /* end of list SYSLOG_SERVER_LIST */ } @@ -105,6 +163,24 @@ module sonic-syslog { leaf rate_limit_burst { type syslog-rate-limit-burst; } + + leaf format { + description "Log format"; + type log-format; + default standard; + } + + leaf welf_firewall_name { + description "WELF format Firewall name"; + type string; + must "(../format != 'standard')"; + } + + leaf severity { + type rsyslog-severity; + default notice; + } + } /* end of list SYSLOG_CONFIG_LIST */ } From c58923053adf043125a79005282f50eb797c9b31 Mon Sep 17 00:00:00 2001 From: ShiyanWangMS Date: Tue, 11 Jul 2023 09:54:10 +0800 Subject: [PATCH 082/107] Add Python3 packages to sonic-mgmt-docker (#15726) Why I did it This is part of sonic-mgmt-docker Python3 migration project. Currently Python3 packages are in the Python3 virtual environment. This PR will add Python3 packages to real file system. After we migrate all script to use Python3 in real file system, the Python3 venv will be deleted. After this PR, in sonic-mgmt-docker, Directly run cmd - pytest will use Python2's version. python3 -m pytest will use Python3's version. How I did it Modify sonic-mgmt-docker j2 script. How to verify it Build a private sonic-mgmt-docker and run basic test case with Python3. --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 87 +++++++++++++++++++++---- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 5534d3112a41..0a5e31eac415 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -38,6 +38,80 @@ RUN apt-get update && apt-get install -y apt-transport-https \ telnet \ vim +RUN pip3 install --upgrade pip setuptools wheel +RUN pip3 install aiohttp \ + allure-pytest==2.8.22 \ + ansible==2.9.27 \ + azure-storage-blob==12.9.0 \ + azure-kusto-data \ + azure-kusto-ingest \ + defusedxml \ + celery[redis]==4.4.7 \ + cffi \ + contextlib2==0.6.0.post1 \ + cryptography==3.3.2 \ + dpkt \ + "future>=0.16.0" \ + gitpython \ + ipaddr \ + ipython==5.4.1 \ + ixnetwork-restpy==1.0.64 \ + ixnetwork-open-traffic-generator==0.0.79 \ + jinja2==2.10.1 \ + jsonpatch \ + lxml \ + markupsafe==2.0.1 \ + mock \ + msrest==0.6.21 \ + natsort \ + ncclient \ + netaddr \ + netmiko==2.4.2 \ + paramiko==2.7.1 \ + passlib \ + pexpect \ + prettytable \ + psutil \ + ptf \ + pyasn1==0.4.8 \ + pycryptodome==3.9.8 \ + pyfiglet \ + pylint==1.8.1 \ + pyro4 \ + pysnmp==4.4.12 \ + pysubnettree \ + pytest-ansible \ + pytest-html \ + pytest-repeat \ + pytest-xdist==1.28.0 \ + python-dateutil \ + pytest==7.1.3 \ + redis \ + requests \ + retry \ + rpyc \ + scandir \ + scapy==2.4.5 \ + setuptools-rust \ + six \ + snappi[ixnetwork,convergence]==0.7.44 \ + tabulate \ + textfsm==1.1.2 \ + thrift==0.11.0 \ + virtualenv \ + && wget https://github.com/nanomsg/nanomsg/archive/1.2.tar.gz \ + && tar xvfz 1.2.tar.gz \ + && cd nanomsg-1.2 \ + && mkdir -p build \ + && cd build \ + && cmake .. \ + && make install \ + && ldconfig \ + && cd ../.. \ + && rm -fr nanomsg-1.2 \ + && rm -f 1.2.tar.gz \ + && pip3 install nnpy + RUN curl -fsSL http://archive.ubuntu.com/ubuntu/pool/universe/s/scapy/python-scapy_2.3.3-3_all.deb \ --output python-scapy_2.3.3-3_all.deb \ && dpkg -i python-scapy_2.3.3-3_all.deb \ @@ -72,6 +146,7 @@ RUN pip install allure-pytest==2.8.22 \ natsort \ netaddr \ netmiko==2.4.2 \ + nnpy \ paramiko==2.7.1 \ passlib \ pexpect \ @@ -108,18 +183,6 @@ RUN pip install allure-pytest==2.8.22 \ && python setup.py install \ && cd .. \ && rm -fr scapy-vxlan \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ - && tar xvfz 1.0.0.tar.gz \ - && cd nanomsg-1.0.0 \ - && mkdir -p build \ - && cd build \ - && cmake .. \ - && make install \ - && ldconfig \ - && cd ../.. \ - && rm -fr nanomsg-1.0.0 \ - && rm -f 1.0.0.tar.gz \ - && pip install nnpy \ && pip install scapy==2.4.5 --upgrade --ignore-installed # Install docker-ce-cli From c470b7dfd15a6b819dd15105f60b2e90c55b731f Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Tue, 11 Jul 2023 13:16:29 +0800 Subject: [PATCH 083/107] Add health check probe for k8s upgrade containers. (#15223) #### Why I did it After k8s upgrade a container, k8s can only know the container is running, don't know the service's status inside container. So we need a probe inside container, k8s will call the probe to check whether the container is really ready. ##### Work item tracking - Microsoft ADO **(number only)**: 22453004 #### How I did it Add a health check probe inside config engine container, the probe will check whether the start service exit normally or not if the start service exists and call the python script to do container self-related specific checks if the script is there. The python script should be implemented by feature owner if it's needed. more details: [design doc](https://github.com/sonic-net/SONiC/blob/master/doc/kubernetes/health-check.md) #### How to verify it Check path /usr/bin/readiness_probe.sh inside container. #### Which release branch to backport (provide reason below if selected) - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [x] 202205 - [x] 202211 #### Tested branch (Please provide the tested image version) - [x] 20220531.28 --- .../Dockerfile.j2 | 1 + .../docker-config-engine-buster/Dockerfile.j2 | 1 + rules/docker-config-engine-bullseye.mk | 1 + rules/docker-config-engine-buster.mk | 1 + rules/sonic-ctrmgrd.mk | 4 +++ src/sonic-ctrmgrd/ctrmgr/readiness_probe.sh | 35 +++++++++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 src/sonic-ctrmgrd/ctrmgr/readiness_probe.sh diff --git a/dockers/docker-config-engine-bullseye/Dockerfile.j2 b/dockers/docker-config-engine-bullseye/Dockerfile.j2 index 57631df95c3e..f6804de903be 100644 --- a/dockers/docker-config-engine-bullseye/Dockerfile.j2 +++ b/dockers/docker-config-engine-bullseye/Dockerfile.j2 @@ -44,6 +44,7 @@ RUN pip3 install redis==4.5.4 # Copy files COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"] +COPY ["files/readiness_probe.sh", "/usr/bin/"] COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"] ## Clean up diff --git a/dockers/docker-config-engine-buster/Dockerfile.j2 b/dockers/docker-config-engine-buster/Dockerfile.j2 index ccadb6e43957..084956eed5f5 100644 --- a/dockers/docker-config-engine-buster/Dockerfile.j2 +++ b/dockers/docker-config-engine-buster/Dockerfile.j2 @@ -44,6 +44,7 @@ RUN pip3 install redis==4.5.4 # Copy files COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"] +COPY ["files/readiness_probe.sh", "/usr/bin/"] COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"] ## Clean up diff --git a/rules/docker-config-engine-bullseye.mk b/rules/docker-config-engine-bullseye.mk index 808905496e8f..084b4b82dc76 100644 --- a/rules/docker-config-engine-bullseye.mk +++ b/rules/docker-config-engine-bullseye.mk @@ -19,6 +19,7 @@ $(DOCKER_CONFIG_ENGINE_BULLSEYE)_LOAD_DOCKERS += $(DOCKER_BASE_BULLSEYE) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $(SWSS_VARS_TEMPLATE) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $(RSYSLOG_PLUGIN_CONF_J2) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT) +$(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_HEALTH_PROBE) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT) $(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS = $($(DOCKER_BASE_BULLSEYE)_DBG_DEPENDS) \ diff --git a/rules/docker-config-engine-buster.mk b/rules/docker-config-engine-buster.mk index 474617bbbd94..4d1e7e0a4b92 100644 --- a/rules/docker-config-engine-buster.mk +++ b/rules/docker-config-engine-buster.mk @@ -18,6 +18,7 @@ $(DOCKER_CONFIG_ENGINE_BUSTER)_LOAD_DOCKERS += $(DOCKER_BASE_BUSTER) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $(SWSS_VARS_TEMPLATE) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $(RSYSLOG_PLUGIN_CONF_J2) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT) +$(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_HEALTH_PROBE) $(DOCKER_CONFIG_ENGINE_BUSTER)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT) $(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS = $($(DOCKER_BASE_BUSTER)_DBG_DEPENDS) \ diff --git a/rules/sonic-ctrmgrd.mk b/rules/sonic-ctrmgrd.mk index 659a2cf4ace1..167d78c43c88 100644 --- a/rules/sonic-ctrmgrd.mk +++ b/rules/sonic-ctrmgrd.mk @@ -20,12 +20,16 @@ $($(SONIC_CTRMGRD)_CFG_JSON)_PATH = $($(SONIC_CTRMGRD)_FILES_PATH) $(SONIC_CTRMGRD)_SERVICE = ctrmgrd.service $($(SONIC_CTRMGRD)_SERVICE)_PATH = $($(SONIC_CTRMGRD)_FILES_PATH) +$(SONIC_CTRMGRD)_HEALTH_PROBE = readiness_probe.sh +$($(SONIC_CTRMGRD)_HEALTH_PROBE)_PATH = $($(SONIC_CTRMGRD)_FILES_PATH) + SONIC_PYTHON_WHEELS += $(SONIC_CTRMGRD) $(SONIC_CTRMGRD)_FILES = $($(SONIC_CTRMGRD)_CONTAINER_SCRIPT) $(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_STARTUP_SCRIPT) $(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_CFG_JSON) $(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_SERVICE) +$(SONIC_CTRMGRD)_FILES += $($(SONIC_CTRMGRD)_HEALTH_PROBE) SONIC_COPY_FILES += $($(SONIC_CTRMGRD)_FILES) diff --git a/src/sonic-ctrmgrd/ctrmgr/readiness_probe.sh b/src/sonic-ctrmgrd/ctrmgr/readiness_probe.sh new file mode 100644 index 000000000000..9e796ca03816 --- /dev/null +++ b/src/sonic-ctrmgrd/ctrmgr/readiness_probe.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# This script is used by k8s to check the readiness of containers +# Check if the container is readiness or not, exit code 0 means readiness, others mean not readiness + +#### exit code contract, k8s only cares zero or not none-zero, but we want to use none-zero code to indicate different error +# 0: readiness +# 1: if the hook script is python code, the default crash exit code is 1 +# 2: supervisor start service doesn't exit normally +# other exit code: returned by post_check_script, define in the post_check_script, should not include 1,2 + +# check if the start service exists +# if the start service doesn't exist, do nothing +# if the start service exists, check if it exits normally +# if the start service doesn't exit normally, exit with code 2 +pre_check_service_name="start" +no_process_string="ERROR (no such process)" +service_status=$(supervisorctl status $pre_check_service_name) +if [[ $service_status != *"$no_process_string"* ]] && [[ $(echo $service_status |awk '{print $2}') != 'EXITED' ]]; then + exit 2 +fi + +# feature owner can add their own readiness check script +# check if the post_check_script exists +# if the post_check_script exists, run it +# if the post_check_script exits with non-zero code, exit with the code +post_check_script="/usr/bin/readiness_probe_hook" +if [ -x $post_check_script ]; then + $post_check_script + post_check_result=$? + if [ $post_check_result != 0 ]; then + exit $post_check_result + fi +fi + +exit 0 From d1c0fae124d41296d81bbc0e5fdcf2ba4e61ad46 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jul 2023 14:38:16 +0800 Subject: [PATCH 084/107] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#15520) #### Why I did it src/sonic-gnmi ``` * 01fe667 - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #134 from FengPan-Frank/fenpan_dialout_rename (3 days ago) [Feng-msft] |\ | * 994c69c - Rename --enable-dialout option into ENABLE_DIALOUT to follow the convention. (3 days ago) [Feng Pan] |/ * a9126da - Update makefile to support armhf (#132) (3 days ago) [ganglv] * 0d80c0d - prevent potential panic: return immediately if there exists error (#113) (7 days ago) [Mai Bui] * 3c0fca3 - Merge pull request #131 from FengPan-Frank/fenpan_dialout (7 days ago) [Feng-msft] |\ | * c3d3266 - Add build flag into gnmi as --enable-dialout. (8 days ago) [Feng Pan] |/ * fd78c42 - add semgrep (#126) (2 weeks ago) [Mai Bui] * 214fa1c - TranslClient: Use new translib subscription APIs (#122) (3 weeks ago) [Sachin Holla] * 87d8eb3 - (origin/202305) TranslClient: use PathValidator to sanitize the request paths (#112) (3 weeks ago) [Sachin Holla] ``` #### How I did it #### How to verify it #### Description for the changelog From 5cbae46635a7b81c5a100c2f3966526549cf3aaa Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 11 Jul 2023 00:13:57 -0700 Subject: [PATCH 085/107] [submodule] Advance sonic-utilities pointer (#15779) Update sonic-utilities submodule pointer to include the following: * ff380e04 [hash]: Implement GH frontend ([#2580](https://github.com/sonic-net/sonic-utilities/pull/2580)) * 61bad064 [db_migrator] Set correct CURRENT_VERSION, extend UT ([#2895](https://github.com/sonic-net/sonic-utilities/pull/2895)) * 6b8ee47c [CLI][Show][BGP] Show BGP Change for no neighbor scenario ([#2885](https://github.com/sonic-net/sonic-utilities/pull/2885)) * 73d8d633 [doc] Update Command-Reference.md, change show bgp peer command to show bfd peer ([#2750](https://github.com/sonic-net/sonic-utilities/pull/2750)) * 7bc08c28 [db_migrator] Remove hardcoded config and migrate config from minigraph ([#2887](https://github.com/sonic-net/sonic-utilities/pull/2887)) * b1aa9426 [generate_dump]: Enhance show techsupport for Marvell platform ([#2676](https://github.com/sonic-net/sonic-utilities/pull/2676)) * 316b14c0 Add support for secure upgrade ([#2698](https://github.com/sonic-net/sonic-utilities/pull/2698)) * dc2945bc [dns] Implement config and show commands for static DNS. ([#2737](https://github.com/sonic-net/sonic-utilities/pull/2737)) * 8414a709 [chassis][multi asic] change acl_loader to use tcp socket for db communication ([#2525](https://github.com/sonic-net/sonic-utilities/pull/2525)) * 0b629ba1 Revert [chassis][voq] Clear fabric counters queue/port (2789) ([#2882](https://github.com/sonic-net/sonic-utilities/pull/2882)) * 3ba8241a [db_migtrator] Add migration of FLEX_COUNTER_DELAY_STATUS during 1911->master upgrade + fast-reboot. Add UT. ([#2839](https://github.com/sonic-net/sonic-utilities/pull/2839)) * fceef2ed [chassis][voq] Clear fabric counters queue/port ([#2789](https://github.com/sonic-net/sonic-utilities/pull/2789)) Signed-off-by: dgsudharsan --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 659ba24b44ee..ff380e04b69d 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 659ba24b44ee50da364a2c4e7aba43c607448e43 +Subproject commit ff380e04b69d9412a93f33ffb36e05fc2d6def03 From 5eaa0d2842c24a7c175c73cf04972997300fd722 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:37:40 +0800 Subject: [PATCH 086/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15785) #### Why I did it src/sonic-swss ``` * 776af62c - (HEAD -> master, origin/master, origin/HEAD) [CodeQL]: Use dependencies with relevant versions in azp template. (#2845) (4 hours ago) [Nazarii Hnydyn] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 7fa01d250689..776af62c923c 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 7fa01d250689cbfb4e617e2104f9c5901fc2d25f +Subproject commit 776af62c923c90096777e2e12734f3b64055ece7 From 75a1fd95585343b54af8b5a0f9b96bd30b675fa4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:37:55 +0800 Subject: [PATCH 087/107] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#15456) #### Why I did it src/sonic-utilities ``` * ff380e04 - (HEAD -> master, origin/master, origin/HEAD) [hash]: Implement GH frontend (#2580) (13 hours ago) [Nazarii Hnydyn] * 61bad064 - [db_migrator] Set correct CURRENT_VERSION, extend UT (#2895) (4 days ago) [Vadym Hlushko] * 6b8ee47c - [CLI][Show][BGP] Show BGP Change for no neighbor scenario (#2885) (6 days ago) [Dev Ojha] * 73d8d633 - [doc] Update Command-Reference.md, change "show bgp peer" command to "show bfd peer" (#2750) (11 days ago) [PinghaoQu] * 7bc08c28 - [db_migrator] Remove hardcoded config and migrate config from minigraph (#2887) (11 days ago) [Vaibhav Hemant Dixit] * b1aa9426 - [generate_dump]: Enhance show techsupport for Marvell platform (#2676) (11 days ago) [pavannaregundi] * 316b14c0 - Add support for secure upgrade (#2698) (2 weeks ago) [ycoheNvidia] * dc2945bc - [dns] Implement config and show commands for static DNS. (#2737) (2 weeks ago) [Oleksandr Ivantsiv] * 8414a709 - [chassis][multi asic] change acl_loader to use tcp socket for db communication (#2525) (2 weeks ago) [Arvindsrinivasan Lakshmi Narasimhan] * 0b629ba1 - Revert "[chassis][voq] Clear fabric counters queue/port (#2789)" (#2882) (3 weeks ago) [RoRonoa] * 3ba8241a - [db_migtrator] Add migration of FLEX_COUNTER_DELAY_STATUS during 1911->master upgrade + fast-reboot. Add UT. (#2839) (4 weeks ago) [Vadym Hlushko] * fceef2ed - [chassis][voq] Clear fabric counters queue/port (#2789) (4 weeks ago) [jfeng-arista] ``` #### How I did it #### How to verify it #### Description for the changelog From 114f276dd47b56a23d217ffbfa59291fed739804 Mon Sep 17 00:00:00 2001 From: prabhataravind <108555774+prabhataravind@users.noreply.github.com> Date: Tue, 11 Jul 2023 09:57:50 -0700 Subject: [PATCH 088/107] [docker-sonic-vs]: More changes to support DPU-2P HWKSU (#15695) Why I did it port_config.ini and hwsku.json are needed to generate the default config switch_type needs to be "dpu" to spawn the right set of processes during dvs initialization and to make sure that DASH APIs can be handled properly Work item tracking Microsoft ADO 24375371: How I did it Use the same hwsku.json and port_config.ini for DPU-2P as the ones used for Nvidia-MBF2H536C SKU in nvidia-sonic sonic-buildimage repo. Set switch_type to "dpu" in DEVICE_METADATA configuration to make sure DASH specific APIs are handled properly Signed-off-by: Prabhat Aravind --- .../x86_64-kvm_x86_64-r0/DPU-2P/hwsku.json | 10 ++++++++++ .../x86_64-kvm_x86_64-r0/DPU-2P/port_config.ini | 3 +++ .../sai_dpu_2p.profile} | 2 +- platform/vs/docker-sonic-vs/Dockerfile.j2 | 2 +- platform/vs/docker-sonic-vs/init_cfg.json.j2 | 12 ++++++++---- ...latform-npu-2p.json => platform-dpu-2p.json} | 0 platform/vs/docker-sonic-vs/start.sh | 17 +++++++++++------ 7 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/hwsku.json create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/port_config.ini rename device/virtual/x86_64-kvm_x86_64-r0/{NPU/sai_npu.profile => DPU-2P/sai_dpu_2p.profile} (83%) rename platform/vs/docker-sonic-vs/{platform-npu-2p.json => platform-dpu-2p.json} (100%) diff --git a/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/hwsku.json b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/hwsku.json new file mode 100644 index 000000000000..caf6d7ed37b4 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/hwsku.json @@ -0,0 +1,10 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G" + } + } +} diff --git a/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/port_config.ini new file mode 100644 index 000000000000..1c163d89f7bf --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/port_config.ini @@ -0,0 +1,3 @@ +# name lanes alias index +Ethernet0 0,1,2,3 etp1 1 +Ethernet4 4,5,6,7 etp2 2 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/sai_dpu_2p.profile similarity index 83% rename from device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile rename to device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/sai_dpu_2p.profile index ffc5d7a21103..bb429eb4c552 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/NPU/sai_npu.profile +++ b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/sai_dpu_2p.profile @@ -1,4 +1,4 @@ -SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_NPU +SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_DPU_SIMU_2P SAI_VS_HOSTIF_USE_TAP_DEVICE=true SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini SAI_VS_CORE_PORT_INDEX_MAP_FILE=/usr/share/sonic/hwsku/coreportindexmap.ini diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index bbff022601c9..6d495ae5679b 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -147,7 +147,7 @@ COPY ["zero_profiles.json", "/etc/sonic"] COPY ["buffermgrd.sh", "/usr/bin/"] COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] -COPY ["platform-npu-2p.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] +COPY ["platform-dpu-2p.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/"] COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Mellanox-SN2700/"] diff --git a/platform/vs/docker-sonic-vs/init_cfg.json.j2 b/platform/vs/docker-sonic-vs/init_cfg.json.j2 index 418c9b871338..6f1eb65aa3dc 100644 --- a/platform/vs/docker-sonic-vs/init_cfg.json.j2 +++ b/platform/vs/docker-sonic-vs/init_cfg.json.j2 @@ -2,16 +2,20 @@ "DEVICE_METADATA": { "localhost": { "mac": "{{ system_mac }}", + "switch_type": "{{ switch_type }}", "buffer_model": "traditional" } }, -{% set features = ["swss", "bgp", "teamd", "nat", "database", "lldp", "dhcp_relay", "macsec"] %} +{% if switch_type != "dpu" %} +{% set features = ({"swss": "enabled", "bgp": "enabled", "teamd": "enabled", "nat": "enabled", "database": "enabled", "lldp": "enabled", "dhcp_relay": "enabled", "macsec": "enabled"}) %} +{% else %} +{% set features = ({"swss": "enabled", "bgp": "enabled", "teamd": "disabled", "nat": "disabled", "database": "enabled", "lldp": "enabled", "dhcp_relay": "disabled", "macsec": "disabled"}) %} +{% endif %} "FEATURE": { -{% for feature in features %} +{% for feature, state in features.items() %} "{{ feature }}": { - "state": "enabled" + "state": "{{ state }}" }{% if not loop.last %},{% endif %} {% endfor %} } } - diff --git a/platform/vs/docker-sonic-vs/platform-npu-2p.json b/platform/vs/docker-sonic-vs/platform-dpu-2p.json similarity index 100% rename from platform/vs/docker-sonic-vs/platform-npu-2p.json rename to platform/vs/docker-sonic-vs/platform-dpu-2p.json diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 59c05ed4eabf..5e3497850e61 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -8,9 +8,11 @@ ln -sf /usr/share/sonic/device/$PLATFORM /usr/share/sonic/platform ln -sf /usr/share/sonic/device/$PLATFORM/$HWSKU /usr/share/sonic/hwsku +SWITCH_TYPE=switch PLATFORM_CONF=platform.json -if [[ $HWSKU == "NPU-2P" ]]; then - PLATFORM_CONF=platform-npu-2p.json +if [[ $HWSKU == "DPU-2P" ]]; then + SWITCH_TYPE=dpu + PLATFORM_CONF=platform-dpu-2p.json fi pushd /usr/share/sonic/hwsku @@ -38,7 +40,7 @@ mkdir -p /var/run/redis/sonic-db cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/ SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') -sonic-cfggen -t /usr/share/sonic/templates/init_cfg.json.j2 -a "{\"system_mac\": \"$SYSTEM_MAC_ADDRESS\"}" > /etc/sonic/init_cfg.json +sonic-cfggen -t /usr/share/sonic/templates/init_cfg.json.j2 -a "{\"system_mac\": \"$SYSTEM_MAC_ADDRESS\", \"switch_type\": \"$SWITCH_TYPE\"}" > /etc/sonic/init_cfg.json if [[ -f /usr/share/sonic/virtual_chassis/default_config.json ]]; then sonic-cfggen -j /etc/sonic/init_cfg.json -j /usr/share/sonic/virtual_chassis/default_config.json --print-data > /tmp/init_cfg.json @@ -52,22 +54,25 @@ else # generate and merge buffers configuration into config file if [ -f /usr/share/sonic/hwsku/buffers.json.j2 ]; then sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json + buffers_cmd="-j /tmp/buffers.json" fi if [ -f /usr/share/sonic/hwsku/qos.json.j2 ]; then sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json + qos_cmd="-j /tmp/qos.json" fi sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/$PLATFORM_CONF -k $HWSKU --print-data > /tmp/ports.json # change admin_status from up to down; Test cases dependent sed -i "s/up/down/g" /tmp/ports.json - sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/qos.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json + sonic-cfggen -j /etc/sonic/init_cfg.json $buffers_cmd $qos_cmd -j /tmp/ports.json --print-data > /etc/sonic/config_db.json fi + sonic-cfggen -t /usr/share/sonic/templates/copp_cfg.j2 > /etc/sonic/copp_cfg.json if [ "$HWSKU" == "Mellanox-SN2700" ]; then cp /usr/share/sonic/hwsku/sai_mlnx.profile /usr/share/sonic/hwsku/sai.profile -elif [ "$HWSKU" == "NPU" ]; then - cp /usr/share/sonic/hwsku/sai_npu.profile /usr/share/sonic/hwsku/sai.profile +elif [ "$HWSKU" == "DPU-2P" ]; then + cp /usr/share/sonic/hwsku/sai_dpu_2p.profile /usr/share/sonic/hwsku/sai.profile fi mkdir -p /etc/swss/config.d/ From 51b50087fa7066508c7afe80a355de16285f02db Mon Sep 17 00:00:00 2001 From: Masaru OKI Date: Wed, 12 Jul 2023 06:32:08 +0900 Subject: [PATCH 089/107] Pick dependency files in submodules. (#15142) #### Why I did it Failed to build sonic-dhcp6relay_1.0.0-0_amd64.deb #### How I did it src/dhcprelay has git submodule. Dependency files by "git ls-files" are not picked files in submodules. Add --recurse-submodules, work again. #### How to verify it make all --- rules/dhcprelay.dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/dhcprelay.dep b/rules/dhcprelay.dep index 5f6d77a84fc3..552fda248014 100644 --- a/rules/dhcprelay.dep +++ b/rules/dhcprelay.dep @@ -2,7 +2,7 @@ SPATH := $($(SONIC_DHCPRELAY)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dhcprelay.mk rules/dhcprelay.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files --recurse-submodules)) $(SONIC_DHCPRELAY)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_DHCPRELAY)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) From 28b9299445ec8a1d0e1ecefa8a225a5f0edb2187 Mon Sep 17 00:00:00 2001 From: Mohammedz93 <65073859+Mohammedz93@users.noreply.github.com> Date: Wed, 12 Jul 2023 02:14:17 +0300 Subject: [PATCH 090/107] Support Reset factory (#14105) #### Why I did it Support reset factory in Sonic OS [Reset Factory HLD](https://github.com/sonic-net/SONiC/pull/1231) [Sonic-mgmt tests](https://github.com/sonic-net/sonic-mgmt/pull/7652) #### How I did it - Added new script "/usr/bin/reset-factory" * It generates a new config_db.json files with factory configurations * It clears system files and logs * It removes all docker containers on system except database * It clears non-default users and restores default users password - Dump the default users info to a new file during build "/etc/sonic/default_users.json" - Supported new type "Keep-basic" in "config-setup factory" - Add new conf file for config-setup "/etc/config-setup/config-setup.conf #### How to verify it - Run reset-factory script with all types: < none | keep-all-config | only-config | keep-basic > - Run config-setup factory with parameters < none | keep-basic > #### Description for the changelog Support reset factory in Sonic OS #### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --- build_debian.sh | 8 + files/build_templates/default_users.json.j2 | 8 + .../build_templates/sonic_debian_extension.j2 | 7 +- files/image_config/config-setup/config-setup | 58 +++++- .../config-setup/config-setup.conf | 4 + .../image_config/reset-factory/reset-factory | 197 ++++++++++++++++++ 6 files changed, 276 insertions(+), 6 deletions(-) create mode 100644 files/build_templates/default_users.json.j2 create mode 100644 files/image_config/config-setup/config-setup.conf create mode 100755 files/image_config/reset-factory/reset-factory diff --git a/build_debian.sh b/build_debian.sh index 7b215772e77d..83d9a687cd4c 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -596,6 +596,14 @@ export built_by="$USER@$BUILD_HOSTNAME" export sonic_os_version="${SONIC_OS_VERSION}" j2 files/build_templates/sonic_version.yml.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/sonic_version.yml +# Default users info +export password_expire="$( [[ "$CHANGE_DEFAULT_PASSWORD" == "y" ]] && echo true || echo false )" +export username="${USERNAME}" +export password="$(sudo grep ^${USERNAME} $FILESYSTEM_ROOT/etc/shadow | cut -d: -f2)" +j2 files/build_templates/default_users.json.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/default_users.json +sudo LANG=c chroot $FILESYSTEM_ROOT chmod 600 /etc/sonic/default_users.json +sudo LANG=c chroot $FILESYSTEM_ROOT chown root:shadow /etc/sonic/default_users.json + ## Copy over clean-up script sudo cp ./files/scripts/core_cleanup.py $FILESYSTEM_ROOT/usr/bin/core_cleanup.py diff --git a/files/build_templates/default_users.json.j2 b/files/build_templates/default_users.json.j2 new file mode 100644 index 000000000000..3e2e9a48e29b --- /dev/null +++ b/files/build_templates/default_users.json.j2 @@ -0,0 +1,8 @@ +{%- set users_dict = { + username: { + "password": password, + "expire": password_expire + } + } +-%} +{{ users_dict | tojson(indent=4) }} \ No newline at end of file diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 6723670490c3..29510542a2f2 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -601,12 +601,17 @@ sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf" # Generate initial SONiC configuration file j2 files/build_templates/init_cfg.json.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/init_cfg.json -# Copy config-setup script and service file +# Copy config-setup script, conf file and service file j2 files/build_templates/config-setup.service.j2 | sudo tee $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/config-setup.service sudo cp $IMAGE_CONFIGS/config-setup/config-setup $FILESYSTEM_ROOT/usr/bin/config-setup +sudo mkdir -p $FILESYSTEM_ROOT/etc/config-setup +sudo cp $IMAGE_CONFIGS/config-setup/config-setup.conf $FILESYSTEM_ROOT/etc/config-setup/config-setup.conf echo "config-setup.service" | sudo tee -a $GENERATED_SERVICE_FILE sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable config-setup.service +# Copy reset-factory script and service +sudo cp $IMAGE_CONFIGS/reset-factory/reset-factory $FILESYSTEM_ROOT/usr/bin/reset-factory + # Add delayed tacacs application service sudo cp files/build_templates/tacacs-config.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ echo "tacacs-config.timer" | sudo tee -a $GENERATED_SERVICE_FILE diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 28a3a4373a42..b23d84cf2607 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -40,6 +40,7 @@ CONFIG_SETUP_VAR_DIR=/var/lib/config-setup CONFIG_SETUP_PRE_MIGRATION_FLAG=${CONFIG_SETUP_VAR_DIR}/pending_pre_migration CONFIG_SETUP_POST_MIGRATION_FLAG=${CONFIG_SETUP_VAR_DIR}/pending_post_migration CONFIG_SETUP_INITIALIZATION_FLAG=${CONFIG_SETUP_VAR_DIR}/pending_initialization +CONFIG_SETUP_CONF=/etc/config-setup/config-setup.conf TACACS_JSON_BACKUP=tacacs.json @@ -56,17 +57,31 @@ usage() EOF } +# Factory command usage and help +usage_factory() +{ + cat << EOF + Usage: config-setup factory < keep-basic > + + Create factory default configuration and save it to + to ${CONFIG_DB_JSON}. + + keep-basic - Preserves basic configurations only. +EOF +} + # run given script run_hook() { local script="$1" + local script_param="$2" local exit_status=0 if [ -f $script ]; then # Check hook for syntactical correctness before executing it - /bin/bash -n $script + /bin/bash -n $script $script_param exit_status=$? if [ "$exit_status" -eq 0 ]; then - . $script + . $script $script_param fi exit_status=$? fi @@ -82,6 +97,7 @@ run_hook() { run_hookdir() { local dir="$1" local progress_file="$2" + local script_param="$3" local exit_status=0 if [ -d "$dir" ]; then @@ -94,7 +110,7 @@ run_hookdir() { fi for script in $SCRIPT_LIST; do - run_hook $script + run_hook $script $script_param exit_status=$((exit_status|$?)) script_name=$(basename $script) sed -i "/$script_name/d" $progress_file @@ -215,10 +231,33 @@ generate_config() if [ "$1" = "ztp" ]; then /usr/lib/ztp/ztp-profile.sh create ${DEST_FILE} elif [ "$1" = "factory" ]; then + FACTORY_TYPE=$3 rv=1 + if [ "$FACTORY_TYPE" = "keep-basic" ]; then + TMP_FILE="/tmp/tmp_keep_basic.$$.json" + # Verify the DEST_FILE exists and KEEP_BASIC_TABLES was defined in CONFIG_SETUP_CONF + if [ ! -f ${DEST_FILE} ] || [ -z "${KEEP_BASIC_TABLES}" ]; then + # Create empty valid json file + echo {} > ${TMP_FILE} + else + # Create filtered json file with keep-basic tables only + jq 'with_entries(select([.key] | inside($tables)))' --argjson tables "$KEEP_BASIC_TABLES" ${DEST_FILE} > ${TMP_FILE} + fi + # Create factory default + sonic-cfggen -H -k ${HW_KEY} --preset ${DEFAULT_PRESET} > ${DEST_FILE} + rv=$? + if [ $rv -ne 0 ]; then + rm -f ${TMP_FILE} + return $rv + fi + # Merge factory default config with filtered json + jq --indent 4 -s '.[0] * .[1]' ${DEST_FILE} ${TMP_FILE} > tmp.$$.json && mv tmp.$$.json ${DEST_FILE} + rm -f ${TMP_FILE} + fi + # Execute config initialization hooks - run_hookdir ${FACTORY_DEFAULT_HOOKS} ${CONFIG_SETUP_INITIALIZATION_FLAG} + run_hookdir ${FACTORY_DEFAULT_HOOKS} ${CONFIG_SETUP_INITIALIZATION_FLAG} ${FACTORY_TYPE} # Use preset defined in default_sku if [ ! -e ${DEST_FILE} ]; then @@ -415,6 +454,9 @@ boot_config() # read SONiC immutable variables [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment +# read config-setup.conf +[ -f $CONFIG_SETUP_CONF ] && . $CONFIG_SETUP_CONF + ### Execution starts here ### PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} # Parse the device specific asic conf file, if it exists @@ -439,7 +481,13 @@ fi # Process factory default configuration creation request if [ "$CMD" = "factory" ]; then - generate_config factory ${CONFIG_DB_JSON} + FACTORY_TYPE=$2 + if [ "$FACTORY_TYPE" = "help" ] || [ "$FACTORY_TYPE" = "-h" ] || \ + [ "$FACTORY_TYPE" = "--help" ]; then + usage_factory + exit 1 + fi + generate_config factory ${CONFIG_DB_JSON} ${FACTORY_TYPE} fi # Take a backup of current configuration diff --git a/files/image_config/config-setup/config-setup.conf b/files/image_config/config-setup/config-setup.conf new file mode 100644 index 000000000000..f5122f3399fb --- /dev/null +++ b/files/image_config/config-setup/config-setup.conf @@ -0,0 +1,4 @@ +# conf file for config-setup +# file: /etc/config-setup/config-setup.conf +# +KEEP_BASIC_TABLES='["MGMT_PORT","MGMT_INTERFACE","MGMT_VRF_CONFIG","PASSW_HARDENING"]' \ No newline at end of file diff --git a/files/image_config/reset-factory/reset-factory b/files/image_config/reset-factory/reset-factory new file mode 100755 index 000000000000..fc86737c9d07 --- /dev/null +++ b/files/image_config/reset-factory/reset-factory @@ -0,0 +1,197 @@ +#!/bin/bash +########################################################################### +# SONIC Factory reset script # +# /usr/bin/reset-factory # +# This script is used to reset the system to factory settings. # +# It creates factory default configuration and save it to config_db.json. # +# Also, it clear logs, tech-support, reboot-cause files, warmboot files, # +# docker containers non-default users, users history files and # +# home directories. # +########################################################################### + +# Initialize constants +CONFIG_DB_JSON=/etc/sonic/config_db.json +DEFAULT_USERS_FILE=/etc/sonic/default_users.json +PERMLOG=/var/log/systemlog +SONIC_VERSION=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v build_version) +SONIC_OVERLAY_UPPERDIR="/host/image-$SONIC_VERSION/rw/etc/sonic" + +SERVICES_STOPPED=0 +trap "error_cleanup" HUP INT QUIT PIPE TERM + +# Command usage and help +usage() +{ + cat << EOF + Usage: reset-factory < keep-all-config | only-config | keep-basic > + + Create factory default configuration and save it to + to ${CONFIG_DB_JSON}. + Clears logs, system files and reboot the system. + + Default - Reset configurations to factory default. Logs and files will be deleted. + keep-all-config - Preserves all configurations after boot. Logs and files will be deleted. + only-config - Reset configurations to factory default. Logs and files will be preserved. + keep-basic - Preserves basic configurations only after boot. Logs and files will be deleted. +EOF +} + +run_reboot() +{ + reboot + # If for any reason we reach this code, then force reboot + rc=$? + if [ $rc -ne 0 ]; then + # Force reboot + reboot -f + fi +} + +error_cleanup() +{ + if [ ! -z "${TEMP_CFG}" ]; then + # Recover config_db.json file + mv ${TEMP_CFG} ${CONFIG_DB_JSON} + fi + + if [ $SERVICES_STOPPED -eq 0 ]; then + ERRMSG="reset-factory: halted with error before stopping critical services; exiting" + logger $ERRMSG + echo $ERRMSG + exit 1 + else + ERRMSG="reset-factory: halted with error after stopping critical services; rebooting" + logger $ERRMSG + echo $ERRMSG + run_reboot + fi +} + +# Restore original /etc/sonic folder by clearing the folder in overlayfs upperdir +clear_sonic_dir() +{ + EXCLUDE_LIST="${CONFIG_DB_JSON}\|/etc/sonic/sonic-environment" + find $SONIC_OVERLAY_UPPERDIR -type f | grep -ve ${EXCLUDE_LIST} | xargs rm -rf + # remount root + mount -o remount / +} + +# Get list of defaults users names and passwords from DEFAULT_USERS_FILE +# Delete non-default users and restore default password of default users +reset_users() +{ + if [ ! -f "${DEFAULT_USERS_FILE}" ]; then + echo "Error: Failed to get default users information" + return + fi + # Get default user accounts + default_users=$(jq -r '. | keys[]' $DEFAULT_USERS_FILE) + EXCLUDE_LIST=$(echo $default_users | tr ' ' '|') + # Get non-default user accounts + other_users=$(getent passwd | awk -F: '($3>=1000 && $3<=60000) {print $1}' | grep -E -v $EXCLUDE_LIST) + echo "Remove non-default users" + for user in ${other_users[@]} + do + # avoid printing home directory and mail spool errors + userdel -rf $user 2> /dev/null + done + echo "Restore default users passwords" + for user in ${default_users[@]} + do + # Restore default password + user_pass=$(jq -r '.[$user].password' --arg user "${user}" $DEFAULT_USERS_FILE) + echo "$user:$user_pass" | chpasswd -e + # Check if we need to expire password + expire=$(jq -r '.[$user].expire' --arg user "${user}" $DEFAULT_USERS_FILE) + [ "${expire}" == "true" ] && passwd -e ${user} + done +} + +# Only root can run reset factory +if [ $UID != 0 ]; then + echo "You must be root to reset system to factory settings" + exit 1 +fi + +CMD=$1 +FACTORY_TYPE= + +if [ "$CMD" = "keep-all-config" ] || [ "$CMD" = "only-config" ] || \ + [ "$CMD" = "keep-basic" ] || [ -z "$CMD" ]; then + FACTORY_TYPE=$CMD +else + usage + exit 1 +fi + +SERVICES_STOPPED=1 +echo "Stop critical services" +monit unmonitor container_checker +systemctl stop sonic.target --job-mode replace-irreversibly + +rc=$? +if [ $rc -ne 0 ]; then + error_cleanup +fi + +DATE=$(date "+%Y/%m/%d %H:%M:%S") +HOSTNAME=$(hostname | sed 's/\./ /' | awk '{print $1}') +printf "%s %s reset-factory: resetting system to factory defaults\n" "$DATE" "$HOSTNAME" >> $PERMLOG + +# Backup and delete config_db.json +TEMP_CFG="/tmp/temp_config_db.$$" +cp ${CONFIG_DB_JSON} ${TEMP_CFG} +if [ "$FACTORY_TYPE" != "keep-basic" ] && [ "$FACTORY_TYPE" != "keep-all-config" ]; then + rm -f ${CONFIG_DB_JSON} +fi + +echo "Call config-setup factory" +config-setup factory $FACTORY_TYPE +rc=$? +if [ $rc -ne 0 ]; then + error_cleanup +fi + +if [ "$FACTORY_TYPE" != "only-config" ]; then + + if [ "$FACTORY_TYPE" != "keep-basic" ]; then + + # Delete non-default users and restore default users passwords + reset_users + + echo "Delete bash, python and vim history files" + find /home /root -type f -name ".bash_history" -o -name ".python_history" -o -name ".viminfo" | xargs rm -rf + + echo "Delete any non-dotfiles in users home directories" + find /home/ /root -type f ! -iname ".*" -delete + fi + + echo "Remove all docker containers except the database" + database_pattern=($(docker ps -a -q -f "name=database" | paste -sd '|' -)) + docker rm -f $(docker ps -a -q | egrep -v ${database_pattern}) > /dev/null + + echo "Clear sonic directory" + clear_sonic_dir + + echo "Clear warmboot folder" + find /host/warmboot/ -type f -delete + + echo "Delete reboot-cause files and symlinks" + find /host/reboot-cause/ -type l,f -delete + + echo "Delete tech-support files" + rm -rf /var/dump/* + + echo "Delete logs files" + find /var/log/ -type f ! -iname "wtmp" ! -iname "btmp" ! -iname "lastlog" ! -iname "systemlog" -delete + + # Clear wtmp, utmp and lastlog files + rm -rf /var/log/btmp.* + cat /dev/null > /var/log/btmp + rm -rf /var/log/wtmp.* + cat /dev/null > /var/log/wtmp + rm -rf /var/log/lastlog.* + cat /dev/null > /var/log/lastlog +fi + +run_reboot From 3b9e8fffb82daffd8b23e08ddc1d821a863bbdf2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:37:15 +0800 Subject: [PATCH 091/107] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#15798) #### Why I did it src/sonic-utilities ``` * 7ca31477 - (HEAD -> master, origin/master, origin/HEAD) [db_migrator] Set docker_routing_config_mode to the value obtained from minigraph parser (#2890) (10 hours ago) [Vaibhav Hemant Dixit] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index ff380e04b69d..7ca31477d942 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit ff380e04b69d9412a93f33ffb36e05fc2d6def03 +Subproject commit 7ca31477d9426afbda0f3b03aeecadafaceca95f From e3fc93d069a30775db19330a7e023600befbc9d9 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:37:20 +0800 Subject: [PATCH 092/107] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#15797) #### Why I did it src/sonic-platform-common ``` * 465f95e - (HEAD -> master, origin/master, origin/HEAD) Default implementation of under/over speed checks (#382) (9 hours ago) [spilkey-cisco] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 10af810fa1d4..465f95eed18c 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 10af810fa1d40347ab8556e79374e6c94a99a22d +Subproject commit 465f95eed18cd9a9a598beabb8c02cb5387e199a From 4f4559cf15137a011207ea70bf0c8af00692e738 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:37:25 +0800 Subject: [PATCH 093/107] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#15782) #### Why I did it src/sonic-linux-kernel ``` * d070cae - (HEAD -> master, origin/master, origin/HEAD) arm64: dts: marvell: Add Nokia 7215-IXS-A1 board (#321) (34 hours ago) [Pavan-Nokia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index e7c93a542272..d070cae8e92a 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit e7c93a542272b5952a1082326c097ec7633f881b +Subproject commit d070cae8e92ae3cd9798546e27d796a71fd7e914 From 9864dfeaa1d468c074aee3a39a1df9aa9d04d9f4 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com> Date: Wed, 12 Jul 2023 09:52:06 -0700 Subject: [PATCH 094/107] [SNMP][IPv6]: Fix SNMP IPv6 reachability issue in certain scenarios (#15487) Modify snmpd.conf to start snmpd to listen on specific management and loopback ips instead of listening on any ip. #### Why I did it SNMP over IPv6 is not working for all scenarios for a single asic platforms. The expectation is that SNMP query over IPv6 should work over Management or Loopback0 addresses. **Specific scenario where this issue is seen** In case of Lab T0 device, when SNMP request is sent from a directly connected T1 neighbor over Loopback IP, SNMP response was not received. This was because the SRC IP address in SNMP response was not Loopback IP, it was the PortChannel IP connected to the neighboring device. ``` 23:18:51.620897 In 22:26:27:e6:e0:07 ethertype IPv6 (0x86dd), length 105: fc00::72.41725 > **fc00:1::32**.161: C="msft" **GetRequest**(28) .1.3.6.1.2.1.1.1.0 23:18:51.621441 Out 28:99:3a:a0:97:30 ethertype IPv6 (0x86dd), length 241: **fc00::71**.161 > fc00::72.41725: C="msft" **GetResponse**(162) .1.3.6.1.2.1.1.1.0="SONiC Software Version: SONiC.xxx - HwSku: xx - Distribution: Debian 10.13 - Kernel: 4.19.0-12-2-amd64" ``` In case of IPv4, the SRC IP in SNMP response was correctly set to Loopback IP. ``` 23:25:32.769712 In 22:26:27:e6:e0:07 ethertype IPv4 (0x0800), length 85: 10.0.0.57.56701 > **10.1.0.32**.161: C="msft" **GetRequest**(28) .1.3.6.1.2.1.1.1.0 23:25:32.975967 Out 28:99:3a:a0:97:30 ethertype IPv4 (0x0800), length 221: **10.1.0.32**.161 > 10.0.0.57.56701: C="msft" **GetResponse**(162) .1.3.6.1.2.1.1.1.0="SONiC Software Version: SONiC.xxx - HwSku: xx - Distribution: Debian 10.13 - Kernel: 4.19.0-12-2-amd64" ``` **Sequence of SNMP request and response** 1. SNMP request will be sent with SRC IP fc00::72 DST IP fc00:1::32 2. SNMP request is received at SONiC device is sent to snmpd which is listening on port 161 :::161/ 3. snmpd process will parse the request create a response and sent to DST IP fc00::72. snmpd process does not track the DST IP on which the SNMP request was received, which in this case is Loopback IP. snmpd process will only keep track what is tht IP to which the response should be sent to. 4. snmpd process will send the response packet. 5. Kernel will do a route look up on destination IP and find the best path. ip -6 route get fc00::72 fc00::72 from :: dev PortChannel101 proto kernel src fc00::71 metric 256 pref medium 5. Using the "src" ip from about, the response is sent out. This SRC ip is that of the PortChannel and not the device Loopback IP. The same issue is seen when SNMP query is sent from a remote server over Management IP. SONiC device eth0 --------- Remote server SNMP request comes with SRC IP DST IP If kernel finds best route to Remote_server_IP is via BGP neighbors, then it will send the response via front-panel interface with SRC IP as Loopback IP instead of Management IP. Main issue is that in case of IPv6, snmpd ignores the IP address to which SNMP request was sent, in case of IPv6. In case of IPv4, snmpd keeps track of DST IP of SNMP request, it will keep track if the SNMP request was sent to mgmt IP or Loopback IP. Later, this IP is used in ipi_spec_dst as SRC IP which helps kernel to find the route based on DST IP using the right SRC IP. https://github.com/net-snmp/net-snmp/blob/master/snmplib/transports/snmpUDPBaseDomain.c#L300 ipi.ipi_spec_dst.s_addr = srcip->s_addr Reference: https://man7.org/linux/man-pages/man7/ip.7.html ``` If IP_PKTINFO is passed to sendmsg(2) and ipi_spec_dst is not zero, then it is used as the local source address for the routing table lookup and for setting up IP source route options. When ipi_ifindex is not zero, the primary local address of the interface specified by the index overwrites ipi_spec_dst for the routing table lookup. ``` **This issue is not seen on multi-asic platform, why?** on multi-asic platform, there exists different network namespaces. SNMP docker with snmpd process runs on host namespace. Management interface belongs to host namespace. Loopback0 is configured on asic namespaces. Additional inforamtion on how the packet coming over Loopback IP reaches snmpd process running on host namespace: https://github.com/sonic-net/sonic-buildimage/pull/5420 Because of this separation of network namespaces, the route lookup of destination IP is confined to routing table of specific namespace where packet is received. if packet is received over management interface, SNMP response also is sent out of management interface. Same goes with packet received over Loopback Ip. ##### Work item tracking - Microsoft ADO **17537063**: #### How I did it Have snmpd listen on specific Management and Loopback IPs specifically instead of listening on any IP for single-asic platform. Before Fix ``` admin@xx:~$ sudo netstat -tulnp | grep 161 udp 0 0 0.0.0.0:161 0.0.0.0:* 15631/snmpd udp6 0 0 :::161 :::* 15631/snmpd ``` After fix ``` admin@device:~$ sudo netstat -tulnp | grep 161 udp 0 0 10.1.0.32:161 0.0.0.0:* 215899/snmpd udp 0 0 10.3.1.1:161 0.0.0.0:* 215899/snmpd udp6 0 0 fc00:1::32:161 :::* 215899/snmpd udp6 0 0 fc00:2::32:161 :::* 215899/snmpd ``` **How this change helps with the issue?** To see snmpd trace logs, modify snmpd to start using the below parameters, in supervisord.conf file ``` /usr/sbin/snmpd -f -LS0-7i -Lf /var/log/snmpd.log ``` When snmpd listens on any IP, snmpd binds to IPv4 and IPv6 sockets as below: ``` netsnmp_udpbase: binding socket: 7 to UDP: [0.0.0.0]:0->[0.0.0.0]:161 trace: netsnmp_udp6_transport_bind(): transports/snmpUDPIPv6Domain.c, 303: netsnmp_udpbase: binding socket: 8 to UDP/IPv6: [::]:161 ``` When IPv4 response is sent, it goes out of fd 7 and IPv6 response goes out of fd 8. When IPv6 response is sent, it does not have the right SRC IP and it can lead to the issue described. When snmpd listens on specific Loopback/Management IPs, snmpd binds to different sockets: ``` trace: netsnmp_udpipv4base_transport_bind(): transports/snmpUDPIPv4BaseDomain.c, 207: netsnmp_udpbase: binding socket: 7 to UDP: [0.0.0.0]:0->[10.250.0.101]:161 trace: netsnmp_udpipv4base_transport_bind(): transports/snmpUDPIPv4BaseDomain.c, 207: netsnmp_udpbase: binding socket: 8 to UDP: [0.0.0.0]:0->[10.1.0.32]:161 trace: netsnmp_register_agent_nsap(): snmp_agent.c, 1261: netsnmp_register_agent_nsap: fd 8 netsnmp_udpbase: binding socket: 10 to UDP/IPv6: [fc00:1::32]:161 trace: netsnmp_register_agent_nsap(): snmp_agent.c, 1261: netsnmp_register_agent_nsap: fd 10 netsnmp_ipv6: fmtaddr: t = (nil), data = 0x7fffed4c85d0, len = 28 trace: netsnmp_udp6_transport_bind(): transports/snmpUDPIPv6Domain.c, 303: netsnmp_udpbase: binding socket: 9 to UDP/IPv6: [fc00:2::32]:161 ``` When SNMP request comes in via Loopback IPv4, SNMP response is sent out of fd 8 ``` trace: netsnmp_udpbase_send(): transports/snmpUDPBaseDomain.c, 511: netsnmp_udp: send 170 bytes from 0x5581f2fbe30a to UDP: [10.0.0.33]:46089->[10.1.0.32]:161 on fd 8 ``` When SNMP request comes in via Loopback IPv6, SNMP response is sent out of fd 10 ``` netsnmp_ipv6: fmtaddr: t = (nil), data = 0x5581f2fc2ff0, len = 28 trace: netsnmp_udp6_send(): transports/snmpUDPIPv6Domain.c, 164: netsnmp_udp6: send 170 bytes from 0x5581f2fbe30a to UDP/IPv6: [fc00::42]:43750 on fd 10 ``` #### How to verify it Verified on single asic and multi-asic devices. Single asic SNMP query with Loopback ``` ARISTA01T1#bash snmpget -v2c -c xxx 10.1.0.32 1.3.6.1.2.1.1.1.0 SNMPv2-MIB::sysDescr.0 = STRING: SONiC Software Version: SONiC.xx - HwSku: Arista-7260xx - Distribution: Debian 10.13 - Kernel: 4.19.0-12-2-amd64 ARISTA01T1#bash snmpget -v2c -c xxx fc00:1::32 1.3.6.1.2.1.1.1.0 SNMPv2-MIB::sysDescr.0 = STRING: SONiC Software Version: SONiC.xx - HwSku: Arista-7260xxx - Distribution: Debian 10.13 - Kernel: 4.19.0-12-2-amd64 ``` On multi-asic -- no change. ``` sudo netstat -tulnp | grep 161 udp 0 0 0.0.0.0:161 0.0.0.0:* 17978/snmpd udp6 0 0 :::161 :::* 17978/snmpd ``` Query result using Loopback IP from a directly connected BGP neighbor ``` ARISTA01T2#bash snmpget -v2c -c xxx 10.1.0.32 1.3.6.1.2.1.1.1.0 SNMPv2-MIB::sysDescr.0 = STRING: SONiC Software Version: SONiC.xx - HwSku: xx - Distribution: Debian 9.13 - Kernel: 4.9.0-14-2-amd64 ARISTA01T2#bash snmpget -v2c -c xxx fc00:1::32 1.3.6.1.2.1.1.1.0 SNMPv2-MIB::sysDescr.0 = STRING: SONiC Software Version: SONiC.xx - HwSku: xx - Distribution: Debian 9.13 - Kernel: 4.9.0-14-2-amd64 ``` --- dockers/docker-snmp/snmpd.conf.j2 | 28 ++++++++++++++++++++++++++-- dockers/docker-snmp/start.sh | 3 +++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index 585fb5353e5b..cf7f8f385138 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -13,12 +13,36 @@ # AGENT BEHAVIOUR # -# Listen for connections on all ip addresses, including eth0, ipv4 lo +# Listen for connections on all ip addresses, including eth0, ipv4 lo for multi-asic platform +# Listen on managment and loopback0 ips for single asic platform # +{% macro protocol(ip_addr) %} +{%- if ip_addr|ipv6 -%} +{{ 'udp6' }} +{%- else -%} +{{ 'udp' }} +{%- endif -%} +{% endmacro %} + {% if SNMP_AGENT_ADDRESS_CONFIG %} {% for (agentip, port, vrf) in SNMP_AGENT_ADDRESS_CONFIG %} -agentAddress {{ agentip }}{% if port %}:{{ port }}{% endif %}{% if vrf %}%{{ vrf }}{% endif %}{{ "" }} +agentAddress {{ protocol(agentip) }}:[{{ agentip }}]{% if port %}:{{ port }}{% endif %}{% if vrf %}%{{ vrf }}{% endif %}{{ "" }} +{% endfor %} +{% elif NAMESPACE_COUNT is not defined or NAMESPACE_COUNT|int <= 1 %} +{% if MGMT_INTERFACE is defined %} +{% for if, ip in MGMT_INTERFACE %} +{% set agentip = ip.split('/')[0] %} +agentAddress {{ protocol(agentip) }}:[{{ agentip }}]:161 +{% endfor %} +{% endif %} +{% if LOOPBACK_INTERFACE is defined %} +{% for lo in LOOPBACK_INTERFACE %} +{% if lo | length == 2 %} +{% set agentip = lo[1].split('/')[0] %} +agentAddress {{ protocol(agentip) }}:[{{ agentip }}]:161 +{% endif %} {% endfor %} +{% endif %} {% else %} agentAddress udp:161 agentAddress udp6:161 diff --git a/dockers/docker-snmp/start.sh b/dockers/docker-snmp/start.sh index 6de6f740b0ad..1d4c3b935a02 100755 --- a/dockers/docker-snmp/start.sh +++ b/dockers/docker-snmp/start.sh @@ -16,11 +16,14 @@ mkdir -p /etc/ssw /etc/snmp # Parse snmp.yml and insert the data in Config DB /usr/bin/snmp_yml_to_configdb.py +ADD_PARAM=$(printf '%s {"NAMESPACE_COUNT":"%s"}' "-a" "$NAMESPACE_COUNT") + SONIC_CFGGEN_ARGS=" \ -d \ -y /etc/sonic/sonic_version.yml \ -t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \ -t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \ + $ADD_PARAM \ " sonic-cfggen $SONIC_CFGGEN_ARGS From dc5258eed5acbc3cb1d0393709a1f1d19dd7cf90 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Thu, 13 Jul 2023 10:38:46 +0800 Subject: [PATCH 095/107] [Build] Fix the python module importlib.metadata not found issue (#15800) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it It is to fix the docker-ptf-sai build failure. https://dev.azure.com/mssonic/build/_build/results?buildId=311315&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=cf595088-5c84-5cf1-9d7e-03331f31d795 2023-07-09T13:53:19.9025355Z �[91mTraceback (most recent call last): 2023-07-09T13:53:19.9025715Z File "/root/ptf/.eggs/setuptools_scm-7.1.0-py3.7.egg/setuptools_scm/_entrypoints.py", line 74, in 2023-07-09T13:53:19.9025933Z from importlib.metadata import entry_points # type: ignore 2023-07-09T13:53:19.9026167Z ModuleNotFoundError: No module named 'importlib.metadata' Work item tracking Microsoft ADO (number only): 24513583 How I did it How to verify it --- dockers/docker-ptf-sai/Dockerfile.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dockers/docker-ptf-sai/Dockerfile.j2 b/dockers/docker-ptf-sai/Dockerfile.j2 index 778a32669fc8..f0af02169dc4 100644 --- a/dockers/docker-ptf-sai/Dockerfile.j2 +++ b/dockers/docker-ptf-sai/Dockerfile.j2 @@ -18,6 +18,7 @@ RUN pip3 install crc16 \ psutil \ scapy_helper \ pysubnettree \ + importlib-metadata \ xmlrunner COPY \ From 25defcfa46295442757d12dd74a3362f42d87bdc Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:57:10 +0800 Subject: [PATCH 096/107] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15811) #### Why I did it src/sonic-swss ``` * c7e1308e - (HEAD -> master, origin/master, origin/HEAD) Remove redundant updateFabricPortState (#2850) (2 hours ago) [kenneth-arista] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 776af62c923c..c7e1308ec6e0 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 776af62c923c90096777e2e12734f3b64055ece7 +Subproject commit c7e1308ec6e00035136da09f6cb0f43bf5f82b46 From b3e59106a1e5258180a0e037efa3ae9467080a9b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:57:15 +0800 Subject: [PATCH 097/107] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#15810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### Why I did it src/sonic-platform-daemons ``` * d73808c - (HEAD -> master, origin/master, origin/HEAD) Added PCIe transaction check for all peripherals on the bus (#331) (9 hours ago) [Ashwin Srinivasan] * 432602a - Update active application selected code in transceiver_info table aft… (#381) (13 hours ago) [Michael Wang - TW] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 63bd9d8b7cbb..d73808cead2a 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 63bd9d8b7cbbdfec039aa236079c3b5d0c01112c +Subproject commit d73808cead2aaf386ae033d9d571882c92f0377c From 30959ec9010b81b1b07733787cb74d5df4346022 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Thu, 13 Jul 2023 23:00:38 +0800 Subject: [PATCH 098/107] [Build] Change the build option from ENABLE_FIPS_FEATURE to INCLUDE_FIPS (#15758) Why I did it [Build] Change the build option from ENABLE_FIPS_FEATURE to INCLUDE_FIPS Work item tracking Microsoft ADO (number only): 24485797 How I did it --- Makefile.work | 10 +++++----- rules/config | 4 ++-- rules/docker-base-bullseye.mk | 2 +- rules/sonic-fips.mk | 2 +- slave.mk | 6 +++--- sonic-slave-bullseye/Dockerfile.j2 | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile.work b/Makefile.work index 7c561e545011..df4e6de8a7f6 100644 --- a/Makefile.work +++ b/Makefile.work @@ -176,13 +176,13 @@ DOCKER_ROOT = $(PWD)/fsroot.docker.$(BLDENV) # Support FIPS feature, armhf not supported yet ifeq ($(PLATFORM_ARCH),armhf) -ENABLE_FIPS_FEATURE := n +INCLUDE_FIPS := n ENABLE_FIPS := n endif -ifeq ($(ENABLE_FIPS_FEATURE), n) +ifeq ($(INCLUDE_FIPS), n) ifeq ($(ENABLE_FIPS), y) - $(error Cannot set fips config ENABLE_FIPS=y when ENABLE_FIPS_FEATURE=n) + $(error Cannot set fips config ENABLE_FIPS=y when INCLUDE_FIPS=n) endif endif @@ -209,7 +209,7 @@ $(shell \ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \ MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) \ CROSS_BUILD_ENVIRON=$(CROSS_BUILD_ENVIRON) \ - ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \ + INCLUDE_FIPS=$(INCLUDE_FIPS) \ DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) \ DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \ @@ -559,7 +559,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ ENABLE_ASAN=$(ENABLE_ASAN) \ SONIC_INCLUDE_BOOTCHART=$(INCLUDE_BOOTCHART) \ SONIC_ENABLE_BOOTCHART=$(ENABLE_BOOTCHART) \ - ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \ + INCLUDE_FIPS=$(INCLUDE_FIPS) \ ENABLE_FIPS=$(ENABLE_FIPS) \ SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \ MIRROR_URLS=$(MIRROR_URLS) \ diff --git a/rules/config b/rules/config index 8f3354eb2d2a..04a5b53584d1 100644 --- a/rules/config +++ b/rules/config @@ -286,9 +286,9 @@ INCLUDE_BOOTCHART = y # ENABLE_BOOTCHART - whether to enable systemd-bootchart on boot ENABLE_BOOTCHART = n -# ENABLE_FIPS_FEATURE - support FIPS feature, only for amd64 or arm64, armhf not supported yet +# INCLUDE_FIPS - support FIPS feature, only for amd64 or arm64, armhf not supported yet # ENABLE_FIPS - support FIPS flag, if enabled, no additional config requred for the image to support FIPS -ENABLE_FIPS_FEATURE ?= y +INCLUDE_FIPS ?= y ENABLE_FIPS ?= n # SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver diff --git a/rules/docker-base-bullseye.mk b/rules/docker-base-bullseye.mk index 9d9345bea490..df2d964a4f12 100644 --- a/rules/docker-base-bullseye.mk +++ b/rules/docker-base-bullseye.mk @@ -12,7 +12,7 @@ OPENSSH = openssh-client SSHPASS = sshpass STRACE = strace -ifeq ($(ENABLE_FIPS_FEATURE), y) +ifeq ($(INCLUDE_FIPS), y) $(DOCKER_BASE_BULLSEYE)_DEPENDS += $(FIPS_OPENSSL_LIBSSL) $(FIPS_OPENSSL_LIBSSL_DEV) $(FIPS_OPENSSL) $(SYMCRYPT_OPENSSL) $(FIPS_KRB5) endif diff --git a/rules/sonic-fips.mk b/rules/sonic-fips.mk index e53f8e5c4c82..44a157bb1608 100644 --- a/rules/sonic-fips.mk +++ b/rules/sonic-fips.mk @@ -47,7 +47,7 @@ FIPS_PACKAGE_ALL = $(SYMCRYPT_OPENSSL) $(FIPS_DERIVED_TARGET) $(foreach package,$(FIPS_DERIVED_TARGET),$(eval $(call add_extra_package,$(SYMCRYPT_OPENSSL),$(package)))) -ifeq ($(ENABLE_FIPS_FEATURE), y) +ifeq ($(INCLUDE_FIPS), y) FIPS_BASEIMAGE_INSTALLERS = $(FIPS_OPENSSL_LIBSSL) $(FIPS_OPENSSL_LIBSSL_DEV) $(FIPS_OPENSSL) $(SYMCRYPT_OPENSSL) $(FIPS_OPENSSH) $(FIPS_OPENSSH_CLIENT) $(FIPS_OPENSSH_SFTP_SERVER) $(FIPS_OPENSSH_SERVER) $(FIPS_KRB5) SONIC_MAKE_DEBS += $(SYMCRYPT_OPENSSL) endif diff --git a/slave.mk b/slave.mk index a592bc5b43a8..73e9131ecd8d 100644 --- a/slave.mk +++ b/slave.mk @@ -353,7 +353,7 @@ endif export SONIC_ROUTING_STACK export FRR_USER_UID export FRR_USER_GID -export ENABLE_FIPS_FEATURE +export INCLUDE_FIPS export ENABLE_FIPS ############################################################################### @@ -428,7 +428,7 @@ $(info "INCLUDE_TEAMD" : "$(INCLUDE_TEAMD)") $(info "INCLUDE_ROUTER_ADVERTISER" : "$(INCLUDE_ROUTER_ADVERTISER)") $(info "INCLUDE_BOOTCHART : "$(INCLUDE_BOOTCHART)") $(info "ENABLE_BOOTCHART : "$(ENABLE_BOOTCHART)") -$(info "ENABLE_FIPS_FEATURE" : "$(ENABLE_FIPS_FEATURE)") +$(info "INCLUDE_FIPS" : "$(INCLUDE_FIPS)") $(info "ENABLE_TRANSLIB_WRITE" : "$(ENABLE_TRANSLIB_WRITE)") $(info "ENABLE_NATIVE_WRITE" : "$(ENABLE_NATIVE_WRITE)") $(info "ENABLE_AUTO_TECH_SUPPORT" : "$(ENABLE_AUTO_TECH_SUPPORT)") @@ -1245,7 +1245,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \ $(addsuffix -install,$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(DEBOOTSTRAP))) \ $(if $(findstring y,$(ENABLE_ZTP)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SONIC_ZTP))) \ - $(if $(findstring y,$(ENABLE_FIPS_FEATURE)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SYMCRYPT_OPENSSL))) \ + $(if $(findstring y,$(INCLUDE_FIPS)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SYMCRYPT_OPENSSL))) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_UTILITIES_PY3)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PY_COMMON_PY2)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PY_COMMON_PY3)) \ diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 401d3651164b..dacff484536b 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -468,7 +468,7 @@ RUN apt-get install -y kernel-wedge # For gobgp and telemetry build RUN apt-get install -y golang-1.15 && ln -s /usr/lib/go-1.15 /usr/local/go -{%- if ENABLE_FIPS_FEATURE == "y" %} +{%- if INCLUDE_FIPS == "y" %} RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \ && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \ && dpkg -i golang-go.deb golang-src.deb \ From d549787408e2eaf965058d4e484be8376bc645aa Mon Sep 17 00:00:00 2001 From: Mai Bui Date: Thu, 13 Jul 2023 21:08:43 -0400 Subject: [PATCH 099/107] limit privileged flag for bgp container (#14932) Why I did it HLD implementation: Container Hardening (sonic-net/SONiC#1364) Work item tracking Microsoft ADO (number only): 14807420 How I did it Reduce linux capabilities in privileged flag, retain NET_ADMIN and SYS_ADMIN capabilities How to verify it Install new image to DUT, verify bgp container is up Run bgp sonic-mgmt kvmtest --- rules/docker-fpm-frr.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/docker-fpm-frr.mk b/rules/docker-fpm-frr.mk index b672d85bac27..bcc293e0257f 100644 --- a/rules/docker-fpm-frr.mk +++ b/rules/docker-fpm-frr.mk @@ -28,7 +28,7 @@ SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR) SONIC_DOCKER_DBG_IMAGES += $(DOCKER_FPM_FRR_DBG) $(DOCKER_FPM_FRR)_CONTAINER_NAME = bgp -$(DOCKER_FPM_FRR)_RUN_OPT += --privileged -t +$(DOCKER_FPM_FRR)_RUN_OPT += -t --cap-add=NET_ADMIN --cap-add=SYS_ADMIN $(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro From df13380d706727c71b7ed5f2ef25b7a2dc18b218 Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:42:17 +0800 Subject: [PATCH 100/107] [k8s]: Bypass the systemd service restart limit and do immediately restart when change to local mode (#15432) Why I did it During the upgrade process via k8s, the feature's systemd service will restart as well, all of the feature systemd service has restart number limit, and the limit number is too small, only three times. if fallback happens when upgrade, the start count will be 2, just once again, the systemd service will be down. So, need to bypass this. This restart function will be called when do local -> kube, kube -> kube, kube ->local, each time call this function, we indeed need to restart successfully, so do reset-failed every time we do restart. When need to go back to local mode, we do systemd restart immediately without waiting the default restart interval time so that we can reduce the container down time. Work item tracking Microsoft ADO (number only): 24172368 How I did it Before every restart for upgrade, do reset feature's restart number. The restart number will be reset to 0 to bypass the restart limit. When need to go back to local mode, we do systemd restart immediately. How to verify it Feature's systemd service can be always restarted successfully during upgrade process via k8s. --- src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py | 9 +++++++ src/sonic-ctrmgrd/tests/ctrmgrd_test.py | 31 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py index 9bf12f4a8351..f72393ef1ba7 100755 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py @@ -151,6 +151,7 @@ def is_systemd_active(feat): def restart_systemd_service(server, feat, owner): log_debug("Restart service {} to owner:{}".format(feat, owner)) if not UNIT_TESTING: + subprocess.call(["systemctl", "reset-failed", str(feat)]) status = subprocess.call(["systemctl", "restart", str(feat)]) else: server.mod_db_entry(STATE_DB_NAME, @@ -551,6 +552,7 @@ def on_state_update(self, key, op, data): self.st_data[key] = _update_entry(dflt_st_feat, data) remote_state = self.st_data[key][ST_FEAT_REMOTE_STATE] + current_owner = self.st_data[key][ST_FEAT_OWNER] if (remote_state == REMOTE_RUNNING) and (old_remote_state != remote_state): # Tag latest @@ -563,6 +565,13 @@ def on_state_update(self, key, op, data): log_debug("try to tag latest label after {} seconds @{}".format( remote_ctr_config[TAG_IMAGE_LATEST], start_time)) + + # This is for going back to local without waiting the systemd restart time + # when k8s is down, can't deploy containers to worker and need to go back to local + # if current owner is already local, we don't do restart + if (current_owner != OWNER_LOCAL) and (remote_state == REMOTE_NONE) and (old_remote_state == REMOTE_STOPPED): + restart_systemd_service(self.server, key, OWNER_LOCAL) + return if (not init): if (old_remote_state == remote_state): diff --git a/src/sonic-ctrmgrd/tests/ctrmgrd_test.py b/src/sonic-ctrmgrd/tests/ctrmgrd_test.py index 0304985224ea..76651309ce6a 100755 --- a/src/sonic-ctrmgrd/tests/ctrmgrd_test.py +++ b/src/sonic-ctrmgrd/tests/ctrmgrd_test.py @@ -324,6 +324,37 @@ } } } + }, + 4: { + common_test.DESCR: "Restart immediately to go back to local when remote_state changes to none from stopped", + common_test.ARGS: "ctrmgrd", + common_test.PRE: { + common_test.STATE_DB_NO: { + common_test.FEATURE_TABLE: { + "snmp": { + "remote_state": "stopped", + } + } + } + }, + common_test.UPD: { + common_test.STATE_DB_NO: { + common_test.FEATURE_TABLE: { + "snmp": { + "remote_state": "none", + } + } + } + }, + common_test.POST: { + common_test.STATE_DB_NO: { + common_test.FEATURE_TABLE: { + "snmp": { + "restart": "true" + } + } + } + } } } From 1bf2a613d53ee71410bc7fe48cfb9ce8d1f6491c Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:44:24 +0800 Subject: [PATCH 101/107] [ctrmgr]: Container image clean up bug fix (#15772) Why I did it When do clean up container images, current code has two bugs need to be fixed. And some variables' name maybe cause confused, change the variables' name. Work item tracking Microsoft ADO (number only): 24502294 How I did it We do clean up after tag latest successfully. But currently tag latest function only return 0 and 1, 0 means succeed and 1 means failed, when we get 1, we will retry, when we get 0, we will do clean up. Actually the code 0 includes another case we don't need to do clean up. The case is that when we are doing tag latest, the container image we want to tag maybe not running, so we can not tag latest and don't need to cleanup, we need to separate this case from 0, return -1 now. When local mode(v1) -> kube mode(v2) happens, one problem is how to handle the local image, there are two cases. one case is that there was one kube v1 container dry-run(cause we don't relace the local if kube version = local version), we will remove the kube v1 image and tag the local version with ACR prefix and remove local v1 local tag. Another case is that there was no kube v1 container dry-run, we remove the local v1 image directly, cause the local v1 image should not be the last desire version. About the docker_id variable, it may cause confused, it's actually docker image id, so rename the variable. About the two dicts and the list, rename them to be more readable. How to verify it Check tag latest and image clean up result. --- src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py | 8 ++- src/sonic-ctrmgrd/ctrmgr/kube_commands.py | 49 +++++++++++-------- src/sonic-ctrmgrd/tests/kube_commands_test.py | 23 ++++++++- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py index f72393ef1ba7..7e85c22f60c8 100755 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py @@ -590,7 +590,7 @@ def on_state_update(self, key, op, data): def do_tag_latest(self, feat, docker_id, image_ver): ret = kube_commands.tag_latest(feat, docker_id, image_ver) - if ret != 0: + if ret == 1: # Tag latest failed. Retry after an interval self.start_time = datetime.datetime.now() self.start_time += datetime.timedelta( @@ -599,7 +599,7 @@ def do_tag_latest(self, feat, docker_id, image_ver): log_debug("Tag latest as local failed retry after {} seconds @{}". format(remote_ctr_config[TAG_RETRY], self.start_time)) - else: + elif ret == 0: last_version = self.st_data[feat][ST_FEAT_CTR_STABLE_VER] if last_version == image_ver: last_version = self.st_data[feat][ST_FEAT_CTR_LAST_VER] @@ -609,6 +609,10 @@ def do_tag_latest(self, feat, docker_id, image_ver): self.st_data[ST_FEAT_CTR_LAST_VER] = last_version self.st_data[ST_FEAT_CTR_STABLE_VER] = image_ver self.do_clean_image(feat, image_ver, last_version) + elif ret == -1: + # This means the container we want to tag latest is not running + # so we don't need to do clean up + pass def do_clean_image(self, feat, current_version, last_version): ret = kube_commands.clean_image(feat, current_version, last_version) diff --git a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py index 8a8aad41bc0a..fd63f2cb12bc 100755 --- a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py +++ b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py @@ -478,7 +478,7 @@ def tag_latest(feat, docker_id, image_ver): else: log_error(err) elif ret == -1: - ret = 0 + log_debug(out) else: log_error(err) return ret @@ -487,31 +487,38 @@ def _do_clean(feat, current_version, last_version): err = "" out = "" ret = 0 - DOCKER_ID = "docker_id" + IMAGE_ID = "image_id" REPO = "repo" _, image_info, err = _run_command("docker images |grep {} |grep -v latest |awk '{{print $1,$2,$3}}'".format(feat)) if image_info: - version_dict = {} - version_dict_default = {} + remote_image_version_dict = {} + local_image_version_dict = {} for info in image_info.split("\n"): - rep, version, docker_id = info.split() + rep, version, image_id = info.split() if len(rep.split("/")) == 1: - version_dict_default[version] = {DOCKER_ID: docker_id, REPO: rep} + local_image_version_dict[version] = {IMAGE_ID: image_id, REPO: rep} else: - version_dict[version] = {DOCKER_ID: docker_id, REPO: rep} + remote_image_version_dict[version] = {IMAGE_ID: image_id, REPO: rep} - if current_version in version_dict: - image_prefix = version_dict[current_version][REPO] - del version_dict[current_version] + if current_version in remote_image_version_dict: + image_prefix = remote_image_version_dict[current_version][REPO] + del remote_image_version_dict[current_version] else: out = "Current version {} doesn't exist.".format(current_version) ret = 0 return ret, out, err - # should be only one item in version_dict_default - for k, v in version_dict_default.items(): - local_version, local_repo, local_docker_id = k, v[REPO], v[DOCKER_ID] - tag_res, _, err = _run_command("docker tag {} {}:{} && docker rmi {}:{}".format( - local_docker_id, image_prefix, local_version, local_repo, local_version)) + # should be only one item in local_image_version_dict + for k, v in local_image_version_dict.items(): + local_version, local_repo, local_image_id = k, v[REPO], v[IMAGE_ID] + # if there is a kube image with same version, need to remove the kube version + # and tag the local version to kube version for fallback preparation + # and remove the local version + if local_version in remote_image_version_dict: + tag_res, _, err = _run_command("docker rmi {}:{} && docker tag {} {}:{} && docker rmi {}:{}".format( + image_prefix, local_version, local_image_id, image_prefix, local_version, local_repo, local_version)) + # if there is no kube image with same version, just remove the local version + else: + tag_res, _, err = _run_command("docker rmi {}:{}".format(local_repo, local_version)) if tag_res == 0: msg = "Tag {} local version images successfully".format(feat) log_debug(msg) @@ -520,12 +527,12 @@ def _do_clean(feat, current_version, last_version): err = "Failed to tag {} local version images. Err: {}".format(feat, err) return ret, out, err - if last_version in version_dict: - del version_dict[last_version] + if last_version in remote_image_version_dict: + del remote_image_version_dict[last_version] - versions = [item[DOCKER_ID] for item in version_dict.values()] - if versions: - clean_res, _, err = _run_command("docker rmi {} --force".format(" ".join(versions))) + image_id_remove_list = [item[IMAGE_ID] for item in remote_image_version_dict.values()] + if image_id_remove_list: + clean_res, _, err = _run_command("docker rmi {} --force".format(" ".join(image_id_remove_list))) else: clean_res = 0 if clean_res == 0: @@ -534,7 +541,7 @@ def _do_clean(feat, current_version, last_version): err = "Failed to clean {} old version images. Err: {}".format(feat, err) ret = 1 else: - err = "Failed to docker images |grep {} |awk '{{print $3}}'".format(feat) + err = "Failed to docker images |grep {} |awk '{{print $3}}'. Error: {}".format(feat, err) ret = 1 return ret, out, err diff --git a/src/sonic-ctrmgrd/tests/kube_commands_test.py b/src/sonic-ctrmgrd/tests/kube_commands_test.py index 62a0b5053b9e..4c0b3b24dc1a 100755 --- a/src/sonic-ctrmgrd/tests/kube_commands_test.py +++ b/src/sonic-ctrmgrd/tests/kube_commands_test.py @@ -266,7 +266,7 @@ }, 2: { common_test.DESCR: "Tag a unstable container", - common_test.RETVAL: 0, + common_test.RETVAL: -1, common_test.ARGS: ["snmp", "123456", "v1"], common_test.PROC_CMD: [ "docker ps |grep 123456" @@ -382,7 +382,7 @@ common_test.ARGS: ["snmp", "20201231.84", ""], common_test.PROC_CMD: [ "docker images |grep snmp |grep -v latest |awk '{print $1,$2,$3}'", - "docker tag 507f8d28bf6e sonick8scue.azurecr.io/docker-sonic-telemetry:20201231.74 && docker rmi docker-sonic-telemetry:20201231.74" + "docker rmi docker-sonic-telemetry:20201231.74" ], common_test.PROC_OUT: [ "docker-sonic-telemetry 20201231.74 507f8d28bf6e\n\ @@ -394,6 +394,25 @@ 0 ] }, + 5: { + common_test.DESCR: "Clean image successfuly(local to dry-kube to kube)", + common_test.RETVAL: 0, + common_test.ARGS: ["snmp", "20201231.84", "20201231.74"], + common_test.PROC_CMD: [ + "docker images |grep snmp |grep -v latest |awk '{print $1,$2,$3}'", + "docker rmi sonick8scue.azurecr.io/docker-sonic-telemetry:20201231.74 && docker tag 507f8d28bf6e sonick8scue.azurecr.io/docker-sonic-telemetry:20201231.74 && docker rmi docker-sonic-telemetry:20201231.74" + ], + common_test.PROC_OUT: [ + "docker-sonic-telemetry 20201231.74 507f8d28bf6e\n\ + sonick8scue.azurecr.io/docker-sonic-telemetry 20201231.74 507f8d28bf6f\n\ + sonick8scue.azurecr.io/docker-sonic-telemetry 20201231.84 507f8d28bf6g", + "" + ], + common_test.PROC_CODE: [ + 0, + 0 + ] + }, } class TestKubeCommands(object): From 95d11976bd07046e39273bc8059b1ef5df623283 Mon Sep 17 00:00:00 2001 From: Liping Xu <108326363+lipxu@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:44:17 +0800 Subject: [PATCH 102/107] update rsyslog log size conf (#15821) Why I did it For some devices whose log folder size is larger than 200M, for example, 256M, the LOG_FILE_ROTATE_SIZE_KB should be 16M. and THRESHOLD_KB=$((USABLE_SPACE_KB - (NUM_LOGS_TO_ROTATE * LOG_FILE_ROTATE_SIZE_KB * 2))) = $(( (VAR_LOG_SIZE_KB * 90 / 100) - RESERVED_SPACE_KB)) - (NUM_LOGS_TO_ROTATE * LOG_FILE_ROTATE_SIZE_KB * 2))) = $(( (256M * 90 / 100) - 4096)) - (8 * 16M * 2))) the result would be a negative value Work item tracking Microsoft ADO (number only): 24524827 How I did it Add a case for 400M, if the log folder size is between 200M and 400M, set the log file size to 2M How to verify it Do cmd "sudo logrotate -f /etc/logrotate.conf" on DUT which val/log folder size is 256M, and check the syslog. --- files/image_config/logrotate/rsyslog.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/image_config/logrotate/rsyslog.j2 b/files/image_config/logrotate/rsyslog.j2 index 25db65ac48b8..d2b94ca2ebf4 100644 --- a/files/image_config/logrotate/rsyslog.j2 +++ b/files/image_config/logrotate/rsyslog.j2 @@ -36,6 +36,8 @@ { {% if var_log_kb <= 204800 %} size 1M +{% elif var_log_kb <= 409600 %} + size 2M {% else %} size 16M {% endif %} @@ -52,6 +54,8 @@ # Adjust LOG_FILE_ROTATE_SIZE_KB to reflect the "size" parameter specified above, in kB {% if var_log_kb <= 204800 %} LOG_FILE_ROTATE_SIZE_KB=1024 +{% elif var_log_kb <= 409600 %} + LOG_FILE_ROTATE_SIZE_KB=2048 {% else %} LOG_FILE_ROTATE_SIZE_KB=16384 {% endif %} From 23a0a878746759aac035874d6847082f708eaac0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:36:32 +0800 Subject: [PATCH 103/107] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#15812) #### Why I did it src/sonic-utilities ``` * 51c7a43c - (HEAD -> master, origin/master, origin/HEAD) [show][muxcable] update `show mux config` to print out `soc_ipv6` as well (#2909) (6 hours ago) [Jing Zhang] * fd497755 - [route_check][dualtor] Ignore vlan neighbor route miss (#2888) (18 hours ago) [Longxiang Lyu] * 81c0ed4e - [show][muxcable] update `show mux tunnel-route` to check soc_ipv6 as well (33 hours ago) [Jing Zhang] * 1ee73668 - [db_migrator] Migrate DNS configuratuion (#2893) (2 days ago) [ganglv] * 553a3432 - [dualtor][route_check] filter out `soc_ipv6` (#2899) (2 days ago) [Jing Zhang] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 7ca31477d942..51c7a43cc04b 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 7ca31477d9426afbda0f3b03aeecadafaceca95f +Subproject commit 51c7a43cc04bfd4feef354689f47e12ee9c404c1 From c991c5f16e6409e2e8a5a9fc7d07c35984973466 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Fri, 14 Jul 2023 08:36:30 -0700 Subject: [PATCH 104/107] Upgrade scapy in the PTF's python3 virtualenv to 2.5.0 (#15573) This is primarily to fix a bug in scapy hitting an error when trying to listen on multiple interfaces in a single `sniff` call. This also upgrades it to the current latest version. Signed-off-by: Saikrishna Arcot --- dockers/docker-ptf/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 69df5d51cb5f..9e6eb6a8930a 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -175,7 +175,7 @@ RUN python3 -m pip install setuptools \ && pip3 install itsdangerous \ && pip3 install retrying \ && pip3 install jinja2 \ - && pip3 install scapy==2.4.5 \ + && pip3 install scapy==2.5.0 \ && pip3 install thrift {% if docker_ptf_whls.strip() -%} From bf49154493975b597a2d7745142b226b02d927aa Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Fri, 14 Jul 2023 08:38:45 -0700 Subject: [PATCH 105/107] Potential fix for Celestica E1031 device hang (#15822) set CPU max_cstate to 0 Co-authored-by: Sumukha Tumkur Vani --- device/celestica/x86_64-cel_e1031-r0/installer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/celestica/x86_64-cel_e1031-r0/installer.conf b/device/celestica/x86_64-cel_e1031-r0/installer.conf index b158400b2292..4da96f0604f1 100644 --- a/device/celestica/x86_64-cel_e1031-r0/installer.conf +++ b/device/celestica/x86_64-cel_e1031-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=9600 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich processor.max_cstate=1 intel_idle.max_cstate=0" From 2602ad25bada9951603d918cbc0df8b19d0dc42c Mon Sep 17 00:00:00 2001 From: lixiaoyuner <35456895+lixiaoyuner@users.noreply.github.com> Date: Sat, 15 Jul 2023 00:15:20 +0800 Subject: [PATCH 106/107] [ctgmgr]: do not remove label when do systemd service stop when service is in kube mode (#15642) Why I did it When sonic is managed by k8s, the sonic container is managed by k8s daemonset, daemonset identifies its members by labels. Currently when restarting a sonic service by systemctl, if the service's container is already managed by k8s, systemd script stops the container by removing the feature label to make it disjoin from k8s daemonset, and then starts it by adding the label to make it join k8s daemonset again. This behavior would cause problem during k8s container upgrade. Containers in daemonset are upgraded in a rolling fashion, that means the daemonset version is updated first, then rollout the new version to containers with precheck/postcheck one by one. However, if a sonic device joins a daemonset, k8s will directly deploy a pod with the current version of daemonset, it is expected when a device joins k8s cluster at first time. But for a device which has already joined k8s cluster, the re-joining daemonset will cause the container upgraded to new version without precheck, so if a systemd service is restarted during daemonset upgrade, the container may be upgraded without precheck and break rolling update policy. To fix it, we need to remove the logic about dropping k8s label in systemd service stop script for kube mode. Work item tracking Microsoft ADO (number only): 24304563 How I did it Don't drop label in systemd service stop script when feature's set_owner is kube. Only drop label when feature's set_owner is local. How to verify it The label feature_enabled should be always true if the feature's set owner is kube. --- src/sonic-ctrmgrd/ctrmgr/container | 2 +- src/sonic-ctrmgrd/tests/container_test.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/sonic-ctrmgrd/ctrmgr/container b/src/sonic-ctrmgrd/ctrmgr/container index 29e91a3c4e22..3c7db1c98163 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container +++ b/src/sonic-ctrmgrd/ctrmgr/container @@ -288,7 +288,7 @@ def container_stop(feature, **kwargs): set_owner, _ , _ = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) - remove_label = (remote_state != "pending") or (set_owner == "local") + remove_label = (set_owner == "local") debug_msg("{}: set_owner:{} current_owner:{} remote_state:{} docker_id:{}".format( feature, set_owner, current_owner, remote_state, docker_id)) diff --git a/src/sonic-ctrmgrd/tests/container_test.py b/src/sonic-ctrmgrd/tests/container_test.py index 57fffe7af669..0cf2730391c7 100755 --- a/src/sonic-ctrmgrd/tests/container_test.py +++ b/src/sonic-ctrmgrd/tests/container_test.py @@ -244,11 +244,6 @@ "container_id": "", "container_version": "20201230.1.15" } - }, - common_test.KUBE_LABEL_TABLE: { - "SET": { - "snmp_enabled": "false" - } } } }, From 109830b9b0131094c0d09f3d2ebed12e33842684 Mon Sep 17 00:00:00 2001 From: gouthambanala Date: Tue, 18 Jul 2023 19:39:47 +0000 Subject: [PATCH 107/107] devicehealth name corrected in supervisord --- dockers/docker-device-health/lom.supervisord.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-device-health/lom.supervisord.conf.j2 b/dockers/docker-device-health/lom.supervisord.conf.j2 index 897dca942f89..2a760e00bef9 100644 --- a/dockers/docker-device-health/lom.supervisord.conf.j2 +++ b/dockers/docker-device-health/lom.supervisord.conf.j2 @@ -13,7 +13,7 @@ events=PROCESS_STATE buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] -command=/usr/bin/supervisor-proc-exit-listener --container-name device_health +command=/usr/bin/supervisor-proc-exit-listener --container-name device-health events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected