From e4ee4a2d9b3fe2243d0cdf609b9d942809d0bb5e Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Sat, 9 Jul 2022 01:05:19 +0000 Subject: [PATCH 01/26] Add YANG models for structured events --- .../yang-events/sonic-events-bgp.yang | 82 ++++++++ .../yang-events/sonic-events-common.yang | 46 +++++ .../yang-events/sonic-events-dhcp_relay.yang | 78 ++++++++ .../yang-events/sonic-events-host.yang | 188 ++++++++++++++++++ .../yang-events/sonic-events-pmon.yang | 41 ++++ .../yang-events/sonic-events-swss.yang | 131 ++++++++++++ .../yang-events/sonic-events-syncd.yang | 60 ++++++ 7 files changed, 626 insertions(+) create mode 100644 src/sonic-yang-models/yang-events/sonic-events-bgp.yang create mode 100644 src/sonic-yang-models/yang-events/sonic-events-common.yang create mode 100644 src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang create mode 100644 src/sonic-yang-models/yang-events/sonic-events-host.yang create mode 100644 src/sonic-yang-models/yang-events/sonic-events-pmon.yang create mode 100644 src/sonic-yang-models/yang-events/sonic-events-swss.yang create mode 100644 src/sonic-yang-models/yang-events/sonic-events-syncd.yang diff --git a/src/sonic-yang-models/yang-events/sonic-events-bgp.yang b/src/sonic-yang-models/yang-events/sonic-events-bgp.yang new file mode 100644 index 00000000000..852fb39f5e0 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-bgp.yang @@ -0,0 +1,82 @@ +module sonic-events-bgp { + namespace "http://github.com/Azure/sonic-events-bgp"; + + yang-version 1.1; + + import sonic-events-common { + prefix evtcmn; + } + + import openconfig-alarm-types { + prefix oc-alarm-types; + } + + revision 2022-12-01 { + description "BGP alert events."; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC BGP events"; + + container bgp-state { + oc-alarm-types:MINOR + + description " + Declares an event for BGP state for a neighbor IP going up/down.; + leaf ip { + type inet:ip-address; + description "IP of neighbor"; + } + leaf status { + type enumeration { + enum "up"; + enum "down"; + } + description "Provides the status as up (true) or down (false)"; + } + uses evtcmn:sonic-events-cmn; + } + container notification { + oc-alarm-types:MAJOR + description " + Reports an notification. + The error codes as per IANA. + The other params are as in the message"; + leaf major-code { + type uint8; + description "Major IANA error code; [RFC4271][RFC7313]"; + } + leaf minor-code { + type uint8; + description "Minor IANA error code; [RFC4271][RFC7313]"; + } + leaf ip { + type inet:ip-address; + description "IP of neighbor associated with this notification"; + } + leaf ASN { + type uint32; + description "ASN number from the notification"; + } + leaf is-sent { + type boolean; + description "true - if this notification was for sent messages; false if it was for received."; + } + uses evtcmn:sonic-events-cmn; + } + container zebra-no-buff { + oc-alarm-types:MAJOR + description " + Declares an event for zebra running out of buffer. + This event does not have any other parameter. + Hence source + tag identifies an event"; + + uses evtcmn:sonic-events-cmn; + } +} diff --git a/src/sonic-yang-models/yang-events/sonic-events-common.yang b/src/sonic-yang-models/yang-events/sonic-events-common.yang new file mode 100644 index 00000000000..bbff8f87796 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-common.yang @@ -0,0 +1,46 @@ +module sonic-events-common { + namespace "http://github.com/Azure/sonic-events-common"; + prefix evtcmn; + yang-version 1.1; + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC Events common definition"; + + revision 2022-12-01 { + description + "Common reusable definitions"; + } + + grouping sonic-events-cmn { + leaf timestamp { + type yang::date-and-time; + description "time of the event"; + } + } + + grouping sonic-events-usage { + leaf usage { + type uint8 { + range "0..100" { + error-message "Incorrect val for %"; + } + } + description "Percentage in use"; + } + + leaf limit { + type uint8 { + range "0..100" { + error-message "Incorrect val for %"; + } + } + description "Percentage limit set"; + } + } +} diff --git a/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang b/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang new file mode 100644 index 00000000000..bd4e6b92df6 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang @@ -0,0 +1,78 @@ +module sonic-events-dhcp-relay { + namespace "http://github.com/sonic-net/sonic-events-dhcp-relay"; + yang-version 1.1; + + import openconfig-alarm-types { + prefix oc-alarm-types; + } + + import sonic-events-common { + prefix evtcmn; + } + + revision 2022-12-01 { + description "dhcp-relay alert events."; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC dhcp-relay events"; + + container dhcp-relay-discard { + oc-alarm-types:MAJOR + + description " + Declares an event for dhcp-relay discarding packet on an + interface due to missing IP address assigned. + Params: + name of the interface discarding. + class of the missing IP address as IPv4 or IPv6."; + + leaf ip_class { + type enumeration { + enum "ipV4"; + enum "ipV6"; + } + description "Class of IP address missing"; + } + + leaf ifname { + type string; + description "Name of the i/f discarding"; + } + + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } + + uses evtcmn:sonic-events-cmn; + } + + container dhcp-relay-disparity { + oc-alarm-types:MAJOR + + description " + Declares an event for disparity detected in + DHCP Relay behavior by dhcpmon. + parameters: + vlan that shows this disparity + The duration of disparity"; + + leaf vlan { + type string; + description "Name of the vlan affected"; + } + + leaf duration { + type uint32; + description "Duration of disparity"; + } + + uses evtcmn:sonic-events-cmn; + } +} diff --git a/src/sonic-yang-models/yang-events/sonic-events-host.yang b/src/sonic-yang-models/yang-events/sonic-events-host.yang new file mode 100644 index 00000000000..95da1106ee5 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-host.yang @@ -0,0 +1,188 @@ +module events-host { + namespace "http://github.com/sonic-net/sonic-events-host"; + yang-version 1.1; + + import openconfig-alarm-types { + prefix oc-alarm-types; + } + + import sonic-events-common { + prefix evtcmn; + } + revision 2022-12-01 { + description "BGP alert events."; + } + + container disk-usage { + oc-alarm-types:MINOR + + description " + Declares an event for disk usage crossing set limit + The parameters describe the usage & limit set."; + + leaf fs { + type string; + description "Name of the file system"; + default ""; + } + + uses evtcmn:sonic-events-usage; + + uses evtcmn:sonic-events-cmn; + } + + container memory-usage { + oc-alarm-types:MINOR + + description " + Declares an event for memory usage crossing set limit + The parameters describe the usage & limit set."; + + uses evtcmn:sonic-events-usage; + + uses evtcmn:sonic-events-cmn; + } + + container event-sshd { + oc-alarm-types:MINOR + + description " + Declares an event reported by sshd. + The fail type declares the type of failure. + INCORRECT_PASSWORD - denotes that sshd is sending + wrong password to AAA to intentionally fail this login."; + + leaf fail_type { + type enumeration { + enum "INCORRECT_PASSWD"; + } + description "Type of failure"; + } + + uses evtcmn:sonic-events-cmn; + } + + container event-disk { + oc-alarm-types:MINOR + + description " + Declares an event reported by disk check. + The fail type declares the type of failure. + read-only - denotes that disk is in RO state."; + + leaf fail_type { + type enumeration { + enum "read_only"; + } + description "Type of failure"; + } + + uses evtcmn:sonic-events-cmn; + } + + container event-kernel { + oc-alarm-types:MINOR + + description " + Declares an event reported by kernel. + The fail type declares the type of failure."; + + leaf fail_type { + type enumeration { + enum "write_failed"; + enum "write_protected"; + enum "remount_read_only"; + enum "aufs_read_lock"; + enum "invalid_freelist"; + enum "zlib_decompress"; + } + description "Type of failure"; + } + + leaf msg { + type string; + description "human readable hint text"; + default ""; + } + + uses evtcmn:sonic-events-cmn; + } + + container event-monit-proc { + evtcmn:severity "2" + + description " + Declares an event reported by monit for a process + that is not running. + + Params: + Name of the process that is not running. + The ASIC-index of that process."; + + leaf proc_name { + type string; + description "Name of the process not running"; + default ""; + } + + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + default 0; + } + + uses evtcmn:sonic-events-cmn; + } + + container event-monit-status { + evtcmn:severity "2" + + description " + Declares an event reported by monit for status check + failure for a process + + Params: + Name of the process that is not running. + The ASIC-index of that process."; + + leaf entity { + type string; + description "Name of the failing entity"; + default ""; + } + + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + default 0; + } + + leaf reason { + type string; + description "Human readble text explaining failure"; + default ""; + } + + uses evtcmn:sonic-events-cmn; + } + + container event-platform { + evtcmn:severity "2" + + description " + Declares an event for platform related failure. + Params: + fail_type provides the type of failure."; + + leaf fail_type { + type enumeration { + enum "watchdog_timeout"; + enum "switch_parity_error"; + enum "SEU_error"; + } + description "Type of failure"; + } + + uses evtcmn:sonic-events-cmn; + } +} diff --git a/src/sonic-yang-models/yang-events/sonic-events-pmon.yang b/src/sonic-yang-models/yang-events/sonic-events-pmon.yang new file mode 100644 index 00000000000..0339406c1d1 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-pmon.yang @@ -0,0 +1,41 @@ +module sonic-events-pmon { + namespace "http://github.com/sonic-net/sonic-events-pmon"; + yang-version 1.1; + + import openconfig-alarm-types { + prefix oc-alarm-types; + } + + import sonic-events-common { + prefix evtcmn; + } + + revision 2022-12-01 { + description "pmon alert events."; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC pmon events"; + + + container pmon-exited { + oc-alarm-types:MAJOR + + description " + Declares an event reportes by pmon for an unexpected exit. + The exited entity is the only param"; + + leaf entity { + type string; + description "entity that had unexpected exit"; + } + + uses evtcmn:sonic-events-cmn; + } +} diff --git a/src/sonic-yang-models/yang-events/sonic-events-swss.yang b/src/sonic-yang-models/yang-events/sonic-events-swss.yang new file mode 100644 index 00000000000..c459aa873d1 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-swss.yang @@ -0,0 +1,131 @@ +module sonic-events-swss { + namespace "http://github.com/sonic-net/sonic-events-swss"; + yang-version 1.1; + + import openconfig-alarm-types { + prefix oc-alarm-types; + } + + import sonic-events-common { + prefix evtcmn; + } + + revision 2022-12-01 { + description "SWSS alert events."; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC SWSS events"; + + container redis-generic { + oc-alarm-types:MAJOR + + description " + Declares an event for a fatal error encountered by swss. + The asic-index of the failing process is the only param."; + + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + default 0; + } + + uses evtcmn:sonic-events-cmn; + } + + container if-state { + oc-alarm-types:MINOR + + description " + Declares an event for i/f flap. + + The name of the flapping i/f and status are the only params."; + + leaf ifname { + type string; + description "Interface name"; + } + + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } + + leaf status { + type enumeration { + enum "up"; + enum "down"; + } + description "Provides the status as up (true) or down (false)"; + } + + uses evtcmn:sonic-events-cmn; + + } + + container pfc-storm { + oc-alarm-types:MAJOR + + description " + Declares an event for PFC storm. + + The name of the i/f facing the storm is the only param."; + + leaf ifname { + type string; + description "Interface name"; + } + + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } + + leaf queue_index { + type uint8; + } + + leaf queue_id { + type uint64_t; + } + + leaf port_id { + type uint64_t; + } + + leaf timestamp { + type yang::date-and-time; + description "time of the event"; + } + } + + container chk_crm_threshold { + oc-alarm-types:MAJOR + + description " + Declares an event for CRM threshold."; + + leaf percent { + type uint8 { + range "0..100" { + error-message "Invalid percentage value"; + } + } + description "percentage used"; + } + + leaf used_cnt { + type uint8; + } + + leaf free_cnt { + type uint64_t; + } + + uses evtcmn:sonic-events-cmn; + } +} diff --git a/src/sonic-yang-models/yang-events/sonic-events-syncd.yang b/src/sonic-yang-models/yang-events/sonic-events-syncd.yang new file mode 100644 index 00000000000..8a8a62579c9 --- /dev/null +++ b/src/sonic-yang-models/yang-events/sonic-events-syncd.yang @@ -0,0 +1,60 @@ +module sonic-events-syncd { + namespace "http://github.com/sonic-net/sonic-events-syncd"; + yang-version 1.1; + + import openconfig-alarm-types { + prefix oc-alarm-types; + } + + import sonic-events-common { + prefix evtcmn; + } + + revision 2022-12-01 { + description "syncd alert events."; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC syncd events"; + + container syncd_failure { + oc-alarm-types:MAJOR + + description " + Declares an event for all types of syncd failure. + The type of failure and the asic-index of failing syncd are + provided along with a human readable message to give the + dev debugging additional info."; + + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + default 0; + } + + leaf fail_type { + type enumeration { + enum "route_add_failed"; + enum "switch_event_2"; + enum "brcm_sai_switch_assert"; + enum "assert"; + enum "mmu_err"; + } + } + + leaf msg { + type string; + description "human readable hint text" + default ""; + } + + uses evtcmn:sonic-events-cmn; + } +} + From a8183dab1f90c1e5bcdcf9c0e92183d08fe617ad Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Fri, 26 Aug 2022 18:38:45 +0200 Subject: [PATCH 02/26] [Arista] Update platform submodule (#11853) --- 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 d570713cdf7..b65a69a9e1c 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit d570713cdf715ea9d722a0a8cf606148edc359f8 +Subproject commit b65a69a9e1c2c876ba5210ce8b2a1cc9b5c8b18f diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index d570713cdf7..b65a69a9e1c 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit d570713cdf715ea9d722a0a8cf606148edc359f8 +Subproject commit b65a69a9e1c2c876ba5210ce8b2a1cc9b5c8b18f From 9b7bcf21d1a6b378f927629ef932e429e01f266f Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Sun, 28 Aug 2022 04:48:22 +0000 Subject: [PATCH 03/26] Advance submodule sonic-sairedis (#11704) 2022-07-28 854d54e: Add support of mdio IPC server class using sai switch api and unix socket (sonic-net/sonic-sairedis#1080) (Jiahua Wang) 2022-07-27 513cb2a: [FlexCounter] Refactor FlexCounter class (sonic-net/sonic-sairedis#1073) (Junchao-Mellanox) --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 9652ea49b22..854d54e07fd 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 9652ea49b22e5f14421e957e3c8e52a35729478b +Subproject commit 854d54e07fd8eeff9cae0410e8e7f04d6385400b From f453cf655e55acfda190bf66af4c37bc81ed1b0a Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Sun, 28 Aug 2022 12:28:58 -0700 Subject: [PATCH 04/26] Update swss common submodule for events api (#11858) #### Why I did it Structured events code like eventd, rsyslogplugin, requires changes made in swss-common Submodule adds these newest commits: 56b0f18 (HEAD, origin/master, origin/HEAD, master) Events: APIs to set/get global options (#672) 5467c89 Add changes to yml file to improve pytest (#674) #### How I did it Updated git submodule #### How to verify it Check new commit pointer --- 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 ecc13b26f70..56b0f1877a0 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit ecc13b26f70c22812eda4c03ddcc063ed800d8b7 +Subproject commit 56b0f1877a02c43b51595a2d7e6f09e1fabd3d32 From 506ad6681b17ef9618b173ffe135f6ed69fd5366 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 29 Aug 2022 04:45:24 +0200 Subject: [PATCH 05/26] [Arista] Fix content of platform.json for DCS-720DT-48S (#11855) Why I did it Content of platform.json was outdated and some platform_tests/api of sonic-mgmt were failing. How I did it Added the necessary values to platform.json How to verify it Running platform_tests/api of sonic-mgmt should yield 100% passrate. --- .../x86_64-arista_720dt_48s/platform.json | 59 +++++++++++++++---- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/device/arista/x86_64-arista_720dt_48s/platform.json b/device/arista/x86_64-arista_720dt_48s/platform.json index 90fa1ea1f57..625e6433527 100644 --- a/device/arista/x86_64-arista_720dt_48s/platform.json +++ b/device/arista/x86_64-arista_720dt_48s/platform.json @@ -2,15 +2,38 @@ "chassis": { "name": "CCS-720DT-48S", "components": [], - "fans": [ - { - "name": "fan1" - }, - { - "name": "fan2" + "fan_drawers": [ + { + "name": "fixed1", + "status_led": { + "controllable": false, + "available": false + }, + "fans": [ + { + "name": "fan1", + "status_led": { + "available": false + } + } + ] + }, + { + "name": "fixed2", + "status_led": { + "controllable": false, + "available": false + }, + "fans": [ + { + "name": "fan2", + "status_led": { + "available": false + } + } + ] } ], - "fan_drawers": [], "psus": [ { "name": "psu1", @@ -21,7 +44,10 @@ "temperature": false, "voltage": false, "voltage_high_threshold": false, - "voltage_low_threshold": false + "voltage_low_threshold": false, + "status_led": { + "controllable": false + } }, { "name": "psu2", @@ -32,21 +58,28 @@ "temperature": false, "voltage": false, "voltage_high_threshold": false, - "voltage_low_threshold": false + "voltage_low_threshold": false, + "status_led": { + "controllable": false + } } ], "thermals": [ { - "name": "Cpu temp sensor" + "name": "Cpu temp sensor", + "controllable": false }, { - "name": "Psu temp sensor" + "name": "Psu temp sensor", + "controllable": false }, { - "name": "SFP+ connector temp sensor" + "name": "SFP+ connector temp sensor", + "controllable": false }, { - "name": "MAC external temp sensor" + "name": "MAC external temp sensor", + "controllable": false } ], "sfps": [ From eb08462992e0f2117b7643b1cd4abfeadabc0deb Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Mon, 29 Aug 2022 11:24:57 +0800 Subject: [PATCH 06/26] [actions] Update github actions label and automerge. (#11736) 1. Add auto approve step when adding label to version upgrading PR. 2. Use mssonicbld TOKEN to merge version upgrading PR instead of 'github actions' --- .github/workflows/automerge.yml | 2 +- .github/workflows/label.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 502f5d8987d..ee27244bfb1 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -15,7 +15,7 @@ jobs: - name: automerge uses: 'pascalgn/automerge-action@v0.13.1' env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GITHUB_TOKEN: '${{ secrets.TOKEN }}' MERGE_LABELS: 'automerge' MERGE_METHOD: 'squash' MERGE_FILTER_AUTHOR: 'mssonicbld' diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 5f8c0279b7e..307cbd86f87 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -22,6 +22,13 @@ jobs: label: runs-on: ubuntu-latest steps: + - name: approve + run: | + set -e + echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token + url=$(echo $GITHUB_CONTEXT | jq -r '.event.pull_request._links.html.href') + echo PR: $url + gh pr review $url --approve - uses: actions/labeler@main with: repo-token: "${{ secrets.GITHUB_TOKEN }}" From bd31be2e1f4a4ab62315c611e6fcd87fc84faf1c Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Mon, 29 Aug 2022 11:26:15 +0800 Subject: [PATCH 07/26] [ci] Update reproducible build related pipeline. (#11810) --- .azure-pipelines/azure-pipelines-repd-build-variables.yml | 2 +- .azure-pipelines/official-build.yml | 2 +- azure-pipelines.yml | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-repd-build-variables.yml b/.azure-pipelines/azure-pipelines-repd-build-variables.yml index 1bd897dafb9..af77e97e2ff 100644 --- a/.azure-pipelines/azure-pipelines-repd-build-variables.yml +++ b/.azure-pipelines/azure-pipelines-repd-build-variables.yml @@ -1,6 +1,6 @@ variables: ${{ if eq(variables['Build.Reason'],'PullRequest') }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([ "$(System.PullRequest.TargetBranch)" != "master" ] && echo deb,py2,py3,web,git,docker)' + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([[ "$(System.PullRequest.TargetBranch)" =~ ^20[2-9][0-9]{3}$ ]] && echo deb,py2,py3,web,git,docker)' ${{ elseif ne(variables['Build.SourceBranchName'],'master') }}: VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' ${{ else }}: diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index ee99d7ca3f2..c73124f2e91 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -38,7 +38,7 @@ stages: variables: - name: CACHE_MODE value: wcache - - template: azure-pipelines-repd-build-variables.yml + - template: azure-pipelines-repd-build-variables.yml@buildimage jobs: - template: azure-pipelines-build.yml parameters: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b9653c2bc8c..5876080411a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,10 +38,7 @@ resources: variables: - template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage -- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - template: .azure-pipelines/template-variables.yml -- ${{ else }}: - - template: .azure-pipelines/template-variables.yml@buildimage +- template: .azure-pipelines/template-variables.yml@buildimage - name: CACHE_MODE value: rcache - name: ENABLE_FIPS From 1d0d61c511fec2b0e31d89a619a21b074c2b3f6c Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Mon, 29 Aug 2022 08:19:28 -0700 Subject: [PATCH 08/26] Address Review Comment to define SONIC_GLOBAL_DB_CLI in gbsyncd.sh (#11857) As part of PR #11754 Change was added to use variable SONIC_DB_NS_CLI for namespace but that will not work since ./files/scripts/syncd_common.sh uses SONIC_DB_CLI. So revert back to use SONIC_DB_CLI and define new variable for SONIC_GLOBAL_DB_CLI for global/host db cli access Also fixed DB_CLI not working for namespace. --- files/scripts/gbsyncd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/scripts/gbsyncd.sh b/files/scripts/gbsyncd.sh index a7eaaced0cd..0948aaadc19 100755 --- a/files/scripts/gbsyncd.sh +++ b/files/scripts/gbsyncd.sh @@ -4,8 +4,8 @@ function startplatform() { - declare -a DbCliArray=($SONIC_DB_CLI $SONIC_DB_NS_CLI) - for DB_CLI in ${DbCliArray[@]}; do + declare -A DbCliArray=([0]=$SONIC_GLOBAL_DB_CLI [1]=$SONIC_DB_CLI) + for DB_CLI in "${DbCliArray[@]}"; do # Add gbsyncd to FEATURE table, if not in. It did have same config as syncd. if [ -z $($DB_CLI CONFIG_DB HGET 'FEATURE|gbsyncd' state) ]; then local CMD="local r=redis.call('DUMP', KEYS[1]); redis.call('RESTORE', KEYS[2], 0, r)" @@ -34,11 +34,11 @@ PEER="swss" DEBUGLOG="/tmp/swss-$SERVICE-debug$DEV.log" LOCKFILE="/tmp/swss-$SERVICE-lock$DEV" NAMESPACE_PREFIX="asic" +SONIC_GLOBAL_DB_CLI="sonic-db-cli" SONIC_DB_CLI="sonic-db-cli" -SONIC_DB_NS_CLI="sonic-db-cli" if [ "$DEV" ]; then NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace - SONIC_DB_NS_CLI="sonic-db-cli -n $NET_NS" + SONIC_DB_CLI="sonic-db-cli -n $NET_NS" fi case "$1" in From 45c8d02332bd8fee903958384ec5423c75b73adf Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 30 Aug 2022 02:15:42 +0800 Subject: [PATCH 09/26] [Build] Increase the size of the installer image (#11869) #### Why I did it Fix the build failure caused by the installer image size too small. The installer image is only used during the build, not impact the final images. See https://dev.azure.com/mssonic/build/_build/results?buildId=139926&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=359769c4-8b5e-5976-a793-85da132e0a6f ``` + fallocate -l 2048M ./sonic-installer.img + mkfs.vfat ./sonic-installer.img mkfs.fat 4.2 (2021-01-31) ++ mktemp -d + tmpdir=/tmp/tmp.TqdDSc00Cn + mount -o loop ./sonic-installer.img /tmp/tmp.TqdDSc00Cn + cp target/sonic-vs.bin /tmp/tmp.TqdDSc00Cn/onie-installer.bin cp: error writing '/tmp/tmp.TqdDSc00Cn/onie-installer.bin': No space left on device [ FAIL LOG END ] [ target/sonic-vs.img.gz ] ``` #### How I did it Increase the size from 2048M to 4096M. Why not increase to 16G like qcow2 image? The qcow2 supports the sparse disk, although a big disk size allocated, but it will not consume the real disk size. The falocate does not support the sparse disk. We do not want to allocate a very big disk, but no use at all. It will require more space to build. --- scripts/build_kvm_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_kvm_image.sh b/scripts/build_kvm_image.sh index 6e5fd7dec74..44009ed013f 100755 --- a/scripts/build_kvm_image.sh +++ b/scripts/build_kvm_image.sh @@ -36,7 +36,7 @@ create_disk() prepare_installer_disk() { - fallocate -l 2048M $INSTALLER_DISK + fallocate -l 4096M $INSTALLER_DISK mkfs.vfat $INSTALLER_DISK From 5048f6517f1195e9706ad712df7694801bee5cff Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 29 Aug 2022 11:34:23 -0700 Subject: [PATCH 10/26] Update sensor names for msn4600c for the 5.10 kernel (#11491) * Update sensor names for msn4600c for the 5.10 kernel Looks like a sensor was removed in the 5.10 kernel for the tps53679 sensor, so the names/indexing has changed. Related to Azure/sonic-mgmt#4513. Signed-off-by: Saikrishna Arcot * Update sensors file Signed-off-by: Saikrishna Arcot Signed-off-by: Saikrishna Arcot --- .../x86_64-mlnx_msn4600c-r0/sensors.conf | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf index 3ff78f15023..b0ad1ff407b 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf @@ -129,27 +129,29 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" bus "i2c-15" "i2c-1-mux (chan_id 6)" chip "tps53679-i2c-*-58" - label in1 "PMIC-8 PSU 12V Rail (in1)" - label in2 "PMIC-8 PSU 12V Rail (in2)" - label in3 "PMIC-8 COMEX 1.8V Rail (out)" - label in4 "PMIC-8 COMEX 1.05V Rail (out)" + label in1 "PMIC-8 PSU 12V Rail (in)" + label in2 "PMIC-8 COMEX 1.8V Rail (out)" + label in3 "PMIC-8 COMEX 1.05V Rail (out)" label temp1 "PMIC-8 Temp 1" label temp2 "PMIC-8 Temp 2" - label power1 "PMIC-8 COMEX 1.8V Rail Pwr (out)" - label power2 "PMIC-8 COMEX 1.05V Rail Pwr (out)" - label curr1 "PMIC-8 COMEX 1.8V Rail Curr (out)" - label curr2 "PMIC-8 COMEX 1.05V Rail Curr (out)" + ignore power1 + label power2 "PMIC-8 COMEX 1.8V Rail Pwr (out)" + label power3 "PMIC-8 COMEX 1.05V Rail Pwr (out)" + ignore curr1 + label curr2 "PMIC-8 COMEX 1.8V Rail Curr (out)" + label curr3 "PMIC-8 COMEX 1.05V Rail Curr (out)" chip "tps53679-i2c-*-61" - label in1 "PMIC-9 PSU 12V Rail (in1)" - label in2 "PMIC-9 PSU 12V Rail (in2)" - label in3 "PMIC-9 COMEX 1.2V Rail (out)" - ignore in4 + label in1 "PMIC-9 PSU 12V Rail (in)" + label in2 "PMIC-9 COMEX 1.2V Rail (out)" + ignore in3 label temp1 "PMIC-9 Temp 1" label temp2 "PMIC-9 Temp 2" - label power1 "PMIC-9 COMEX 1.2V Rail Pwr (out)" - ignore power2 - label curr1 "PMIC-9 COMEX 1.2V Rail Curr (out)" - ignore curr2 + ignore power1 + label power2 "PMIC-9 COMEX 1.2V Rail Pwr (out)" + ignore power3 + ignore curr1 + label curr2 "PMIC-9 COMEX 1.2V Rail Curr (out)" + ignore curr3 # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" From 6fa111c4af2a48aeb7fd7be5027ba9336525d6d7 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 29 Aug 2022 11:35:07 -0700 Subject: [PATCH 11/26] Fix error handling when failing to install a deb package (#11846) The current error handling code for when a deb package fails to be installed currently has a chain of commands linked together by && and ends with `exit 1`. The assumption is that the commands would succeed, and the last `exit 1` would end it with a non-zero return code, thus fully failing the target and causing the build to stop because of bash's -e flag. However, if one of the commands prior to `exit 1` returns a non-zero return code, then bash won't actually treat it as a terminating error. From bash's man page: ``` -e Exit immediately if a pipeline (which may consist of a single simple command), a list, or a compound command (see SHELL GRAMMAR above), exits with a non-zero status. The shell does not exit if the command that fails is part of the command list immediately following a while or until keyword, part of the test following the if or elif reserved words, part of any command executed in a && or || list except the command following the final && or ||, any command in a pipeline but the last, or if the command's return value is being inverted with !. If a compound command other than a subshell returns a non-zero status because a command failed while -e was being ignored, the shell does not exit. ``` The part `part of any command executed in a && or || list except the command following the final && or ||` says that if the failing command is not the `exit 1` that we have at the end, then bash doesn't treat it as an error and exit immediately. Additionally, since this is a compound command, but isn't in a subshell (subshell are marked by `(` and `)`, whereas `{` and `}` just tells bash to run the commands in the current environment), bash doesn't exist. The result of this is that in the deb-install target, if a package installation fails, it may be infinitely stuck in that while-loop. There are two fixes for this: change to using a subshell, or use `;` instead of `&&`. Using a subshell would, I think, require exporting any shell variables used in the subshell, so I chose to change the `&&` to `;`. In addition, at the start of the subshell, `set +e` is added in, which removes the exit-on-error handling of bash. This makes sure that all commands are run (the output of which may help for debugging) and that it still exits with 1, which will then fully fail the target. Signed-off-by: Saikrishna Arcot Signed-off-by: Saikrishna Arcot --- slave.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slave.mk b/slave.mk index e1f4a0ef80d..7cdee954ad7 100644 --- a/slave.mk +++ b/slave.mk @@ -736,13 +736,13 @@ $(SONIC_INSTALL_DEBS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -install # put a lock here because dpkg does not allow installing packages in parallel if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then ifneq ($(CROSS_BUILD_ENVIRON),y) - { sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(DEBS_PATH)/$* $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && sudo lsof /var/lib/dpkg/lock-frontend && ps aux && exit 1 ; } + { sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(DEBS_PATH)/$* $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { set +e; rm -d $(DEBS_PATH)/dpkg_lock; sudo lsof /var/lib/dpkg/lock-frontend; ps aux; exit 1 ; } else # Relocate debian packages python libraries to the cross python virtual env location { sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(if $(findstring $(LINUX_HEADERS),$*),--force-depends) $(DEBS_PATH)/$* $(LOG) && \ rm -rf tmp && mkdir tmp && dpkg -x $(DEBS_PATH)/$* tmp && (sudo cp -rf tmp/usr/lib/python2*/dist-packages/* $(VIRTENV_LIB_CROSS_PYTHON2)/python2*/site-packages/ 2>/dev/null || true) && \ (sudo cp -rf tmp/usr/lib/python3/dist-packages/* $(VIRTENV_LIB_CROSS_PYTHON3)/python3.*/site-packages/ 2>/dev/null || true) && \ - rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && sudo lsof /var/lib/dpkg/lock-frontend && ps aux && exit 1 ; } + rm -d $(DEBS_PATH)/dpkg_lock && break; } || { set +e; rm -d $(DEBS_PATH)/dpkg_lock; sudo lsof /var/lib/dpkg/lock-frontend; ps aux; exit 1 ; } endif fi sleep 10 From 55f1fb15466c7b9c7f694be9ce5b8a39ec510425 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 30 Aug 2022 09:19:58 +0800 Subject: [PATCH 12/26] Fix vs check install login timeout issue (#11727) Why I did it Fix a build not stable issue: #11620 The vs vm has started successfully, but failed to wait for the message "sonic login:". There were 55 builds failed caused by the issue in the last 30 days. AzurePipelineBuildLogs | where startTime > ago(30d) | where type =~ "task" | where result =~ "failed" | where name =~ "Build sonic image" | where content contains "Timeout exceeded" | where content contains "re.compile('sonic login:')" | project-away content | extend branchName=case(reason=~"pullRequest", tostring(todynamic(parameters)['system.pullRequest.targetBranch']), replace("refs/heads/", "", sourceBranch)) | summarize FailedCount=dcount(buildId) by branchName branchName FailedCount master 37 202012 9 202106 4 202111 2 202205 1 201911 1 It is caused by the login message mixed with the output message of the /etc/rc.local, one of the examples as below: (see the message rc.local[307]: sonic+ onie_disco_subnet=255.255.255.0 login: ) The check_install.py was waiting for the message "sonic login:", and Linux console was waiting for the username input (the login message has already printed in the console). https://dev.azure.com/mssonic/build/_build/results?buildId=123294&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=359769c4-8b5e-5976-a793-85da132e0a6f 2022-07-17T15:00:58.9198877Z [ 25.493855] rc.local[307]: + onie_disco_opt53=05 2022-07-17T15:00:58.9199330Z [ 25.595054] rc.local[307]: + onie_disco_router=10.0.2.2 2022-07-17T15:00:58.9199781Z [ 25.699409] rc.local[307]: + onie_disco_serverid=10.0.2.2 2022-07-17T15:00:58.9200252Z [ 25.789891] rc.local[307]: + onie_disco_siaddr=10.0.2.2 2022-07-17T15:00:58.9200622Z [ 25.880920] 2022-07-17T15:00:58.9200745Z 2022-07-17T15:00:58.9201019Z Debian GNU/Linux 10 sonic ttyS0 2022-07-17T15:00:58.9201201Z 2022-07-17T15:00:58.9201542Z rc.local[307]: sonic+ onie_disco_subnet=255.255.255.0 login: 2022-07-17T15:00:58.9202309Z [ 26.079767] rc.local[307]: + onie_exec_url=file://dev/vdb/onie-installer.bin How I did it Input a newline when finished to run the script /etc/rc.local. If entering a newline, the message "sonic login:" will prompt again. --- check_install.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check_install.py b/check_install.py index ecd3a8ee9a3..b8fc3936f75 100755 --- a/check_install.py +++ b/check_install.py @@ -19,6 +19,7 @@ def main(): passwd_prompt = 'Password:' cmd_prompt = "{}@sonic:~\$ $".format(args.u) grub_selection = "The highlighted entry will be executed" + firsttime_prompt = 'firsttime_exit' i = 0 while True: @@ -38,13 +39,17 @@ def main(): # bootup sonic image while True: - i = p.expect([login_prompt, passwd_prompt, cmd_prompt]) + i = p.expect([login_prompt, passwd_prompt, firsttime_prompt, cmd_prompt]) if i == 0: # send user name p.sendline(args.u) elif i == 1: # send password p.sendline(args.P) + elif i == 2: + # fix a login timeout issue, caused by the login_prompt message mixed with the output message of the rc.local + time.sleep(1) + p.sendline() else: break From 68392279404458bb9c30235633fb6410a10d6869 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 30 Aug 2022 14:23:09 +0800 Subject: [PATCH 13/26] [ci] Fix bug involved by PR 11810 which affect official build pipeline (#11891) Why I did it Fix the official build not triggered correctly issue, caused by the azp template path not existing. How I did it Change the azp template path. --- .azure-pipelines/official-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index c73124f2e91..3ebb106a621 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -38,7 +38,7 @@ stages: variables: - name: CACHE_MODE value: wcache - - template: azure-pipelines-repd-build-variables.yml@buildimage + - template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage jobs: - template: azure-pipelines-build.yml parameters: From 677b19d717743d9b0f979ff50467b0ebba6a44c9 Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Tue, 30 Aug 2022 23:53:52 +0530 Subject: [PATCH 14/26] DellEMC: Z9332f - Graceful platform reboot (#10240) Why I did it To gracefully unmount filesystems and stop containers while performing a cold reboot. Unmount ONIE-BOOT if mounted during fast/soft/warm reboot How I did it Override systemd-reboot service to perform a cold reboot. Unmount ONIE-BOOT if mounted using fast/soft/warm-reboot plugins. How to verify it On reboot, verify that the container stop and filesystem unmount services have completed execution before the platform reboot. --- .../debian/platform-modules-z9332f.install | 6 ++++- .../z9332f/scripts/fast-reboot_plugin | 8 +++++++ .../z9332f/scripts/override.conf | 3 +++ .../z9332f/scripts/platform_reboot_override | 23 +++++++++++++++++++ .../z9332f/scripts/soft-reboot_plugin | 1 + .../z9332f/scripts/warm-reboot_plugin | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/fast-reboot_plugin create mode 100644 platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/override.conf create mode 100755 platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/platform_reboot_override create mode 120000 platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/soft-reboot_plugin create mode 120000 platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/warm-reboot_plugin diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install index ad25015472d..ecbd88a6ffe 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install @@ -4,7 +4,11 @@ z9332f/scripts/sensors usr/bin z9332f/cfg/z9332f-modules.conf etc/modules-load.d z9332f/systemd/platform-modules-z9332f.service etc/systemd/system z9332f/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 -common/platform_reboot usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 +z9332f/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 +z9332f/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d +z9332f/scripts/fast-reboot_plugin usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 +z9332f/scripts/soft-reboot_plugin usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 +z9332f/scripts/warm-reboot_plugin usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 common/pcisysfs.py usr/bin common/io_rd_wr.py usr/local/bin common/fw-updater usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/fast-reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/fast-reboot_plugin new file mode 100755 index 00000000000..0335f71d02b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/fast-reboot_plugin @@ -0,0 +1,8 @@ +#!/bin/bash + +ONIE_PATH="/mnt/onie-boot" + +# Unmount ONIE partition if mounted +if grep -qs ${ONIE_PATH} /proc/mounts; then + umount ${ONIE_PATH} +fi diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/override.conf b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/override.conf new file mode 100644 index 00000000000..9f17da1c233 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/override.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0/platform_reboot_override diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/platform_reboot_override b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/platform_reboot_override new file mode 100755 index 00000000000..ca04ac0635a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/platform_reboot_override @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +import os +import struct + +PORT_RES = '/dev/port' + + +def portio_reg_write(resource, offset, val): + fd = os.open(resource, os.O_RDWR) + if(fd < 0): + print('file open failed %s' % resource) + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print('lseek failed on %s' % resource) + return + ret = os.write(fd, struct.pack('B', val)) + if(ret != 1): + print('write failed %d' % ret) + return + os.close(fd) + +if __name__ == "__main__": + portio_reg_write(PORT_RES, 0xcf9, 0xe) diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/soft-reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/soft-reboot_plugin new file mode 120000 index 00000000000..180742bbc4d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/soft-reboot_plugin @@ -0,0 +1 @@ +fast-reboot_plugin \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/warm-reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/warm-reboot_plugin new file mode 120000 index 00000000000..180742bbc4d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/warm-reboot_plugin @@ -0,0 +1 @@ +fast-reboot_plugin \ No newline at end of file From 12c8db01b9cc9ba8605947ea03b96782704d5b05 Mon Sep 17 00:00:00 2001 From: saksarav-nokia Date: Tue, 30 Aug 2022 23:23:17 -0400 Subject: [PATCH 15/26] [Nokia][Nokia-IXR7250E-36x100G & Nokia-IXR7250E-36x400G] Update BCM (#11577) config to support ERSPAN egress mirror and also set flag to preserve ECN --- .../0/jr2cp-nokia-18x100g-4x25g-config.bcm | 44 +++++++++++++++++-- .../0/sai_postinit_cmd.soc | 37 +--------------- .../1/jr2cp-nokia-18x100g-4x25g-config.bcm | 44 +++++++++++++++++-- .../1/sai_postinit_cmd.soc | 7 +-- .../0/jr2cp-nokia-18x400g-config.bcm | 43 ++++++++++++++++-- .../0/sai_postinit_cmd.soc | 2 + .../1/jr2cp-nokia-18x400g-config.bcm | 43 ++++++++++++++++-- .../1/sai_postinit_cmd.soc | 2 + 8 files changed, 168 insertions(+), 54 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm index 72c101facb3..3eb3ba20a42 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm @@ -8,7 +8,7 @@ dma_desc_aggregator_chain_length_max.BCM8885X=1000 dma_desc_aggregator_enable_specific_MDB_LPM.BCM8885X=1 dma_desc_aggregator_timeout_usec.BCM8885X=1000 dport_map_direct.BCM8885X=1 - +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc dtm_flow_mapping_mode_region_64.BCM8885X=3 dtm_flow_mapping_mode_region_65.BCM8885X=3 dtm_flow_mapping_mode_region_66.BCM8885X=3 @@ -1532,12 +1532,50 @@ ucode_port_15.BCM8885X=CGE6:core_0.15 ucode_port_16.BCM8885X=CGE4:core_0.16 ucode_port_17.BCM8885X=CGE2:core_0.17 ucode_port_18.BCM8885X=CGE0:core_0.18 - - ucode_port_19.BCM8885X=RCY0:core_0.19 ucode_port_20.BCM8885X=RCY1:core_1.20 ucode_port_21.BCM8885X=OLP:core_1.21 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 port_init_speed_1.BCM8885X=100000 port_init_speed_2.BCM8885X=100000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc index 26466f89ae4..20e19b8faeb 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/sai_postinit_cmd.soc @@ -1,36 +1 @@ -phy set 3 reg=0xd134 data=-8 lane=0 -phy set 3 reg=0xd135 data=132 lane=0 -phy set 3 reg=0xd136 data=-8 lane=0 -phy set 3 reg=0xd137 data=0 lane=0 -phy set 3 reg=0xd138 data=0 lane=0 -phy set 3 reg=0xd133 data=0x1802 lane=0 - -phy set 3 reg=0xd134 data=-8 lane=1 -phy set 3 reg=0xd135 data=132 lane=1 -phy set 3 reg=0xd136 data=-12 lane=1 -phy set 3 reg=0xd137 data=0 lane=1 -phy set 3 reg=0xd138 data=0 lane=1 -phy set 3 reg=0xd133 data=0x1800 lane=1 - -phy set 3 reg=0xd134 data=-8 lane=7 -phy set 3 reg=0xd135 data=132 lane=7 -phy set 3 reg=0xd136 data=-8 lane=7 -phy set 3 reg=0xd137 data=0 lane=7 -phy set 3 reg=0xd138 data=0 lane=7 -phy set 3 reg=0xd133 data=0x1804 lane=7 - - -phy set 6 reg=0xd134 data=-8 lane=1 -phy set 6 reg=0xd135 data=132 lane=1 -phy set 6 reg=0xd136 data=-8 lane=1 -phy set 6 reg=0xd137 data=0 lane=1 -phy set 6 reg=0xd138 data=0 lane=1 -phy set 6 reg=0xd133 data=0x1802 lane=1 - - -phy set 8 reg=0xd134 data=-8 lane=1 -phy set 8 reg=0xd135 data=132 lane=1 -phy set 8 reg=0xd136 data=-8 lane=1 -phy set 8 reg=0xd137 data=0 lane=1 -phy set 8 reg=0xd138 data=0 lane=1 -phy set 8 reg=0xd133 data=0x1802 lane=1 +mod ETPPC_MAP_FWD_QOS_DP_TO_TYPE_FWD 0 128 TYPE_FWD_KEEP_ECN_BITS=1 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm index cc6d41ea3da..57e966b3531 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm @@ -8,7 +8,7 @@ dma_desc_aggregator_chain_length_max.BCM8885X=1000 dma_desc_aggregator_enable_specific_MDB_LPM.BCM8885X=1 dma_desc_aggregator_timeout_usec.BCM8885X=1000 dport_map_direct.BCM8885X=1 - +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc dtm_flow_mapping_mode_region_64.BCM8885X=3 dtm_flow_mapping_mode_region_65.BCM8885X=3 dtm_flow_mapping_mode_region_66.BCM8885X=3 @@ -1551,12 +1551,50 @@ ucode_port_15.BCM8885X=CGE6:core_0.15 ucode_port_16.BCM8885X=CGE4:core_0.16 ucode_port_17.BCM8885X=CGE2:core_0.17 ucode_port_18.BCM8885X=CGE0:core_0.18 - - ucode_port_19.BCM8885X=RCY0:core_0.19 ucode_port_20.BCM8885X=RCY1:core_1.20 ucode_port_21.BCM8885X=OLP:core_1.21 +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 port_init_speed_1.BCM8885X=100000 port_init_speed_2.BCM8885X=100000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc index db5ad5ebb26..20e19b8faeb 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/sai_postinit_cmd.soc @@ -1,6 +1 @@ -phy set 8 reg=0xd134 data=-8 lane=1 -phy set 8 reg=0xd135 data=132 lane=1 -phy set 8 reg=0xd136 data=-8 lane=1 -phy set 8 reg=0xd137 data=0 lane=1 -phy set 8 reg=0xd138 data=0 lane=1 -phy set 8 reg=0xd133 data=0x1802 lane=1 +mod ETPPC_MAP_FWD_QOS_DP_TO_TYPE_FWD 0 128 TYPE_FWD_KEEP_ECN_BITS=1 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm index 5303bb263ba..1da65733155 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm @@ -1551,13 +1551,50 @@ ucode_port_15.BCM8885X=CDGE3:core_0.15 ucode_port_16.BCM8885X=CDGE2:core_0.16 ucode_port_17.BCM8885X=CDGE1:core_0.17 ucode_port_18.BCM8885X=CDGE0:core_0.18 - - ucode_port_19.BCM8885X=RCY0:core_0.19 ucode_port_20.BCM8885X=RCY1:core_1.20 ucode_port_21.BCM8885X=OLP:core_1.21 - +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 serdes_lane_config_dfe_1.BCM8885X=on serdes_lane_config_dfe_2.BCM8885X=on diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc index 650134e7e58..fd18216d3c8 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/sai_postinit_cmd.soc @@ -35,3 +35,5 @@ phy set 17 reg=0xd136 data=-16 lane=2 phy set 17 reg=0xd137 data=0 lane=2 phy set 17 reg=0xd138 data=0 lane=2 phy set 17 reg=0xd133 data=0x1804 lane=2 + +mod ETPPC_MAP_FWD_QOS_DP_TO_TYPE_FWD 0 128 TYPE_FWD_KEEP_ECN_BITS=1 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm index eb58c1ca42e..4d6790d5398 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm @@ -1551,13 +1551,50 @@ ucode_port_15.BCM8885X=CDGE3:core_0.15 ucode_port_16.BCM8885X=CDGE2:core_0.16 ucode_port_17.BCM8885X=CDGE1:core_0.17 ucode_port_18.BCM8885X=CDGE0:core_0.18 - - ucode_port_19.BCM8885X=RCY0:core_0.19 ucode_port_20.BCM8885X=RCY1:core_1.20 ucode_port_21.BCM8885X=OLP:core_1.21 - +ucode_port_100.BCM8885X=RCY_MIRROR.0:core_0.100 +ucode_port_101.BCM8885X=RCY_MIRROR.1:core_0.101 +ucode_port_102.BCM8885X=RCY_MIRROR.2:core_0.102 +ucode_port_103.BCM8885X=RCY_MIRROR.3:core_0.103 +ucode_port_104.BCM8885X=RCY_MIRROR.4:core_0.104 +ucode_port_105.BCM8885X=RCY_MIRROR.5:core_0.105 +ucode_port_106.BCM8885X=RCY_MIRROR.6:core_0.106 +ucode_port_107.BCM8885X=RCY_MIRROR.7:core_0.107 +ucode_port_108.BCM8885X=RCY_MIRROR.8:core_0.108 +ucode_port_109.BCM8885X=RCY_MIRROR.9:core_0.109 +ucode_port_110.BCM8885X=RCY_MIRROR.10:core_0.110 +ucode_port_111.BCM8885X=RCY_MIRROR.11:core_0.111 +ucode_port_112.BCM8885X=RCY_MIRROR.12:core_0.112 +ucode_port_113.BCM8885X=RCY_MIRROR.13:core_0.113 +ucode_port_114.BCM8885X=RCY_MIRROR.14:core_0.114 +ucode_port_115.BCM8885X=RCY_MIRROR.15:core_0.115 +ucode_port_116.BCM8885X=RCY_MIRROR.16:core_0.116 +ucode_port_117.BCM8885X=RCY_MIRROR.17:core_0.117 +ucode_port_118.BCM8885X=RCY_MIRROR.18:core_0.118 +ucode_port_119.BCM8885X=RCY_MIRROR.19:core_0.119 +ucode_port_120.BCM8885X=RCY_MIRROR.0:core_1.120 +ucode_port_121.BCM8885X=RCY_MIRROR.1:core_1.121 +ucode_port_122.BCM8885X=RCY_MIRROR.2:core_1.122 +ucode_port_123.BCM8885X=RCY_MIRROR.3:core_1.123 +ucode_port_124.BCM8885X=RCY_MIRROR.4:core_1.124 +ucode_port_125.BCM8885X=RCY_MIRROR.5:core_1.125 +ucode_port_126.BCM8885X=RCY_MIRROR.6:core_1.126 +ucode_port_127.BCM8885X=RCY_MIRROR.7:core_1.127 +ucode_port_128.BCM8885X=RCY_MIRROR.8:core_1.128 +ucode_port_129.BCM8885X=RCY_MIRROR.9:core_1.129 +ucode_port_130.BCM8885X=RCY_MIRROR.10:core_1.130 +ucode_port_131.BCM8885X=RCY_MIRROR.11:core_1.131 +ucode_port_132.BCM8885X=RCY_MIRROR.12:core_1.132 +ucode_port_133.BCM8885X=RCY_MIRROR.13:core_1.133 +ucode_port_134.BCM8885X=RCY_MIRROR.14:core_1.134 +ucode_port_135.BCM8885X=RCY_MIRROR.15:core_1.135 +ucode_port_136.BCM8885X=RCY_MIRROR.16:core_1.136 +ucode_port_137.BCM8885X=RCY_MIRROR.17:core_1.137 +ucode_port_138.BCM8885X=RCY_MIRROR.18:core_1.138 +ucode_port_139.BCM8885X=RCY_MIRROR.19:core_1.139 serdes_lane_config_dfe_1.BCM8885X=on serdes_lane_config_dfe_2.BCM8885X=on diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc index b22dde09313..109b18ecaaf 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/sai_postinit_cmd.soc @@ -12,3 +12,5 @@ phy set 8 reg=0xd136 data=-8 lane=1 phy set 8 reg=0xd137 data=0 lane=1 phy set 8 reg=0xd138 data=0 lane=1 phy set 8 reg=0xd133 data=0x1802 lane=1 + +mod ETPPC_MAP_FWD_QOS_DP_TO_TYPE_FWD 0 128 TYPE_FWD_KEEP_ECN_BITS=1 From d2a5dcfad89da7c44cc7334e55cae7415203d606 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Wed, 31 Aug 2022 10:48:15 -0700 Subject: [PATCH 16/26] Align API get_device_runtime_metadata() for python version < 3.9 (#11900) Why I did it: API get_device_runtime_metadata() added by #11795 uses merge operator for dict but that is supported only for python version >=3.9. This API will be be used by scrips eg:hostcfgd which is still build for buster which does not have python 3.9 support. --- src/sonic-py-common/sonic_py_common/device_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 6605c798ec1..8173c267727 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -476,7 +476,10 @@ def get_device_runtime_metadata(): 'chassis_type': 'voq' if is_voq_chassis() else 'packet'}} port_metadata = {'ETHERNET_PORTS_PRESENT': True if get_path_to_port_config_file(hwsku=None, asic="0" if is_multi_npu() else None) else False} - return {'DEVICE_RUNTIME_METADATA': chassis_metadata | port_metadata } + runtime_metadata = {} + runtime_metadata.update(chassis_metadata) + runtime_metadata.update(port_metadata) + return {'DEVICE_RUNTIME_METADATA': runtime_metadata } def get_npu_id_from_name(npu_name): if npu_name.startswith(NPU_NAME_PREFIX): From f92c3389ac6392db24dce233a3882659933ec0db Mon Sep 17 00:00:00 2001 From: Dev Ojha <47282568+developfast@users.noreply.github.com> Date: Wed, 31 Aug 2022 11:08:32 -0700 Subject: [PATCH 17/26] [Arista7050cx3] TD3 SKU changes for pg headroom value after interop testing with cisco 8102 (#11901) Why I did it After PFC interop testing between 8102 and 7050cx3, data packet losses were observed on the Rx ports of the 7050cx3 (inflow from 8102) during testing. This was primarily due to the slower response times to react to PFC pause packets for the 8102, when receiving such frames from neighboring devices. To solve for the packet drops, the 7050cx3 pg headroom size has to be increased to 160kB. How I did it Modified the xoff threshold value to 160kB in the pg_profile file to allow for the buffer manager to read that value when building the image, and configuring the device How to verify it run "mmuconfig -l" once image is built Signed-off-by: dojha --- .../Arista-7050CX3-32S-C32/pg_profile_lookup.ini | 12 ++++++------ .../Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini index dd405301f72..5b4482bc74c 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini @@ -1,8 +1,8 @@ # PG lossless profiles. # speed cable size xon xoff threshold xon_offset - 50000 5m 4608 4608 33792 0 4608 - 100000 5m 4608 4608 49408 0 4608 - 50000 40m 4608 4608 36352 0 4608 - 100000 40m 4608 4608 54528 0 4608 - 50000 300m 4608 4608 55296 0 4608 - 100000 300m 4608 4608 92672 0 4608 + 50000 5m 4608 4608 160000 0 4608 + 100000 5m 4608 4608 160000 0 4608 + 50000 40m 4608 4608 160000 0 4608 + 100000 40m 4608 4608 160000 0 4608 + 50000 300m 4608 4608 160000 0 4608 + 100000 300m 4608 4608 160000 0 4608 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini index 8ee7a6714b1..5b4482bc74c 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini @@ -1,8 +1,8 @@ # PG lossless profiles. # speed cable size xon xoff threshold xon_offset - 50000 5m 4608 4608 79872 0 4608 - 100000 5m 4608 4608 54528 0 4608 - 50000 40m 4608 4608 39936 0 4608 - 100000 40m 4608 4608 60416 0 4608 - 50000 300m 4608 4608 61440 0 4608 - 100000 300m 4608 4608 103680 0 4608 + 50000 5m 4608 4608 160000 0 4608 + 100000 5m 4608 4608 160000 0 4608 + 50000 40m 4608 4608 160000 0 4608 + 100000 40m 4608 4608 160000 0 4608 + 50000 300m 4608 4608 160000 0 4608 + 100000 300m 4608 4608 160000 0 4608 From be9af74af2402da5f11694b5b899bd950b5a416a Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Wed, 31 Aug 2022 21:40:11 +0000 Subject: [PATCH 18/26] Add peer review comments on bgp --- .../yang-events/sonic-events-bgp.yang | 106 +++++++++--------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-bgp.yang b/src/sonic-yang-models/yang-events/sonic-events-bgp.yang index 852fb39f5e0..8a3c99fc2f5 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-bgp.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-bgp.yang @@ -1,15 +1,18 @@ module sonic-events-bgp { namespace "http://github.com/Azure/sonic-events-bgp"; - + prefix events-bgp; yang-version 1.1; import sonic-events-common { prefix evtcmn; + revision-date 2022-12-01; } - import openconfig-alarm-types { prefix oc-alarm-types; } + import sonic-types { + prefix stypes; + } revision 2022-12-01 { description "BGP alert events."; @@ -17,66 +20,61 @@ module sonic-events-bgp { organization "SONiC"; - contact "SONiC"; - description "SONIC BGP events"; - container bgp-state { - oc-alarm-types:MINOR - - description " - Declares an event for BGP state for a neighbor IP going up/down.; - leaf ip { - type inet:ip-address; - description "IP of neighbor"; - } - leaf status { - type enumeration { - enum "up"; - enum "down"; + container sonic-events-bgp { + container bgp-state { + oc-alarm-types:MINOR + description " + Declares an event for BGP state for a neighbor IP going up/down."; + leaf ip { + type inet:ip-address; + description "IP of neighbor"; } - description "Provides the status as up (true) or down (false)"; - } - uses evtcmn:sonic-events-cmn; - } - container notification { - oc-alarm-types:MAJOR - description " - Reports an notification. - The error codes as per IANA. - The other params are as in the message"; - leaf major-code { - type uint8; - description "Major IANA error code; [RFC4271][RFC7313]"; - } - leaf minor-code { - type uint8; - description "Minor IANA error code; [RFC4271][RFC7313]"; - } - leaf ip { - type inet:ip-address; - description "IP of neighbor associated with this notification"; + leaf status { + type stypes:admin_status; + description "Provides the status as up (true) or down (false)"; + } + uses evtcmn:sonic-events-cmn; } - leaf ASN { - type uint32; - description "ASN number from the notification"; + container notification { + oc-alarm-types:MAJOR + description " + Reports an notification. + The error codes as per IANA. + The other params are as in the message"; + leaf major-code { + type uint8; + description "Major IANA error code; [RFC4271][RFC7313]"; + } + leaf minor-code { + type uint8; + description "Minor IANA error code; [RFC4271][RFC7313]"; + } + leaf ip { + type inet:ip-address; + description "IP of neighbor associated with this notification"; + } + leaf ASN { + type uint32; + description "ASN number from the notification"; + } + leaf is-sent { + type boolean; + description "true - if this notification was for sent messages; false if it was for received."; + } + uses evtcmn:sonic-events-cmn; } - leaf is-sent { - type boolean; - description "true - if this notification was for sent messages; false if it was for received."; + container zebra-no-buff { + oc-alarm-types:MAJOR + description " + Declares an event for zebra running out of buffer. + This event does not have any other parameter. + Hence source + tag identifies an event"; + uses evtcmn:sonic-events-cmn; } - uses evtcmn:sonic-events-cmn; - } - container zebra-no-buff { - oc-alarm-types:MAJOR - description " - Declares an event for zebra running out of buffer. - This event does not have any other parameter. - Hence source + tag identifies an event"; - - uses evtcmn:sonic-events-cmn; } } From e676a520ba68d1aab2cb745b3756a04cffdb06c0 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Wed, 31 Aug 2022 22:29:54 +0000 Subject: [PATCH 19/26] Add peer review changes + spacing --- .../yang-events/sonic-events-bgp.yang | 15 +++++ .../yang-events/sonic-events-common.yang | 3 - .../yang-events/sonic-events-syncd.yang | 60 +++++++++---------- 3 files changed, 45 insertions(+), 33 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-bgp.yang b/src/sonic-yang-models/yang-events/sonic-events-bgp.yang index 8a3c99fc2f5..44a4a79e72f 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-bgp.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-bgp.yang @@ -28,52 +28,67 @@ module sonic-events-bgp { container sonic-events-bgp { container bgp-state { oc-alarm-types:MINOR + description " Declares an event for BGP state for a neighbor IP going up/down."; + leaf ip { type inet:ip-address; description "IP of neighbor"; } + leaf status { type stypes:admin_status; description "Provides the status as up (true) or down (false)"; } + uses evtcmn:sonic-events-cmn; } + container notification { oc-alarm-types:MAJOR + description " Reports an notification. The error codes as per IANA. The other params are as in the message"; + leaf major-code { type uint8; description "Major IANA error code; [RFC4271][RFC7313]"; } + leaf minor-code { type uint8; description "Minor IANA error code; [RFC4271][RFC7313]"; } + leaf ip { type inet:ip-address; description "IP of neighbor associated with this notification"; } + leaf ASN { type uint32; description "ASN number from the notification"; } + leaf is-sent { type boolean; description "true - if this notification was for sent messages; false if it was for received."; } + uses evtcmn:sonic-events-cmn; } + container zebra-no-buff { oc-alarm-types:MAJOR + description " Declares an event for zebra running out of buffer. This event does not have any other parameter. Hence source + tag identifies an event"; + uses evtcmn:sonic-events-cmn; } } diff --git a/src/sonic-yang-models/yang-events/sonic-events-common.yang b/src/sonic-yang-models/yang-events/sonic-events-common.yang index bbff8f87796..132ff1ed7d3 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-common.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-common.yang @@ -5,13 +5,10 @@ module sonic-events-common { organization "SONiC"; - contact "SONiC"; - description "SONIC Events common definition"; - revision 2022-12-01 { description "Common reusable definitions"; diff --git a/src/sonic-yang-models/yang-events/sonic-events-syncd.yang b/src/sonic-yang-models/yang-events/sonic-events-syncd.yang index 8a8a62579c9..6965ff4fe5a 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-syncd.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-syncd.yang @@ -1,60 +1,60 @@ module sonic-events-syncd { namespace "http://github.com/sonic-net/sonic-events-syncd"; yang-version 1.1; + prefix events-syncd; import openconfig-alarm-types { prefix oc-alarm-types; } - import sonic-events-common { prefix evtcmn; + revision-date 2022-12-01; } - revision 2022-12-01 { description "syncd alert events."; } organization "SONiC"; - contact "SONiC"; - description "SONIC syncd events"; - container syncd_failure { - oc-alarm-types:MAJOR + container sonic-events-syncd { + container syncd_failure { + oc-alarm-types:MAJOR - description " - Declares an event for all types of syncd failure. - The type of failure and the asic-index of failing syncd are - provided along with a human readable message to give the - dev debugging additional info."; + description " + Declares an event for all types of syncd failure. + The type of failure and the asic-index of failing syncd are + provided along with a human readable message to give the + dev debugging additional info."; - leaf asic_index { - type uint8; - description "ASIC index in case of multi asic platform"; - default 0; - } + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + default 0; + } - leaf fail_type { - type enumeration { - enum "route_add_failed"; - enum "switch_event_2"; - enum "brcm_sai_switch_assert"; - enum "assert"; - enum "mmu_err"; + leaf fail_type { + type enumeration { + enum "route_add_failed"; + enum "switch_event_2"; + enum "brcm_sai_switch_assert"; + enum "assert"; + enum "mmu_err"; + } } - } - leaf msg { - type string; - description "human readable hint text" - default ""; - } + leaf msg { + type string; + description "human readable hint text" + default ""; + } - uses evtcmn:sonic-events-cmn; + uses evtcmn:sonic-events-cmn; + } } } From ca41dde28c4d112a33f0bba4d8603f47b05a7e23 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Wed, 31 Aug 2022 23:01:11 +0000 Subject: [PATCH 20/26] Add changes to events-swss --- .../yang-events/sonic-events-swss.yang | 155 +++++++++--------- 1 file changed, 74 insertions(+), 81 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-swss.yang b/src/sonic-yang-models/yang-events/sonic-events-swss.yang index c459aa873d1..06e31d1db63 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-swss.yang @@ -1,131 +1,124 @@ module sonic-events-swss { namespace "http://github.com/sonic-net/sonic-events-swss"; yang-version 1.1; + prefix events-swss; import openconfig-alarm-types { prefix oc-alarm-types; } - import sonic-events-common { prefix evtcmn; } - revision 2022-12-01 { description "SWSS alert events."; } organization "SONiC"; - contact "SONiC"; - description "SONIC SWSS events"; - container redis-generic { - oc-alarm-types:MAJOR + container sonic-events-swss { + container redis-generic { + oc-alarm-types:MAJOR - description " - Declares an event for a fatal error encountered by swss. - The asic-index of the failing process is the only param."; - - leaf asic_index { - type uint8; - description "ASIC index in case of multi asic platform"; - default 0; - } + description " + Declares an event for a fatal error encountered by swss. + The asic-index of the failing process is the only param."; - uses evtcmn:sonic-events-cmn; - } + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + default 0; + } - container if-state { - oc-alarm-types:MINOR + uses evtcmn:sonic-events-cmn; + } - description " - Declares an event for i/f flap. - - The name of the flapping i/f and status are the only params."; + container if-state { + oc-alarm-types:MINOR - leaf ifname { - type string; - description "Interface name"; - } + description " + Declares an event for i/f flap. + The name of the flapping i/f and status are the only params."; - type leafref { - path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; - } + leaf ifname { + type string; + description "Interface name"; + } - leaf status { - type enumeration { - enum "up"; - enum "down"; + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; } - description "Provides the status as up (true) or down (false)"; - } - uses evtcmn:sonic-events-cmn; + leaf status { + type enumeration { + enum "up"; + enum "down"; + } + description "Provides the status as up (true) or down (false)"; + } - } + uses evtcmn:sonic-events-cmn; + } - container pfc-storm { - oc-alarm-types:MAJOR + container pfc-storm { + oc-alarm-types:MAJOR - description " - Declares an event for PFC storm. - - The name of the i/f facing the storm is the only param."; + description " + Declares an event for PFC storm. + The name of the i/f facing the storm is the only param."; - leaf ifname { - type string; - description "Interface name"; - } + leaf ifname { + type string; + description "Interface name"; + } - type leafref { - path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; - } + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } - leaf queue_index { - type uint8; - } + leaf queue_index { + type uint8; + } - leaf queue_id { - type uint64_t; - } + leaf queue_id { + type uint64_t; + } - leaf port_id { - type uint64_t; - } + leaf port_id { + type uint64_t; + } - leaf timestamp { - type yang::date-and-time; - description "time of the event"; + uses evtcmn:sonic-events-cmn; } - } - container chk_crm_threshold { - oc-alarm-types:MAJOR + container chk_crm_threshold { + oc-alarm-types:MAJOR - description " - Declares an event for CRM threshold."; + description " + Declares an event for CRM threshold."; - leaf percent { - type uint8 { - range "0..100" { - error-message "Invalid percentage value"; + leaf percent { + type uint8 { + range "0..100" { + error-message "Invalid percentage value"; + } } + description "percentage used"; } - description "percentage used"; - } - leaf used_cnt { - type uint8; - } + leaf used_cnt { + type uint8; + } - leaf free_cnt { - type uint64_t; - } + leaf free_cnt { + type uint64_t; + } - uses evtcmn:sonic-events-cmn; + uses evtcmn:sonic-events-cmn; + } } } From e961ae0382c6fdce6ee89f38749fd2e121b2a334 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Wed, 31 Aug 2022 23:12:29 +0000 Subject: [PATCH 21/26] Add peer review changes in pmon swss --- .../yang-events/sonic-events-pmon.yang | 27 +++++++++---------- .../yang-events/sonic-events-swss.yang | 9 ++++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-pmon.yang b/src/sonic-yang-models/yang-events/sonic-events-pmon.yang index 0339406c1d1..a653e955915 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-pmon.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-pmon.yang @@ -1,41 +1,40 @@ module sonic-events-pmon { namespace "http://github.com/sonic-net/sonic-events-pmon"; yang-version 1.1; + prefix events-pmon; import openconfig-alarm-types { prefix oc-alarm-types; } - import sonic-events-common { prefix evtcmn; + revision-date 2022-12-01; } - revision 2022-12-01 { description "pmon alert events."; } organization "SONiC"; - contact "SONiC"; - description "SONIC pmon events"; + container sonic-events-pmon { + container pmon-exited { + oc-alarm-types:MAJOR - container pmon-exited { - oc-alarm-types:MAJOR + description " + Declares an event reportes by pmon for an unexpected exit. + The exited entity is the only param"; - description " - Declares an event reportes by pmon for an unexpected exit. - The exited entity is the only param"; + leaf entity { + type string; + description "entity that had unexpected exit"; + } - leaf entity { - type string; - description "entity that had unexpected exit"; + uses evtcmn:sonic-events-cmn; } - - uses evtcmn:sonic-events-cmn; } } diff --git a/src/sonic-yang-models/yang-events/sonic-events-swss.yang b/src/sonic-yang-models/yang-events/sonic-events-swss.yang index 06e31d1db63..e4ce6dce53d 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-swss.yang @@ -8,6 +8,10 @@ module sonic-events-swss { } import sonic-events-common { prefix evtcmn; + revision-date 2022-12-01; + } + import sonic-types { + prefix stypes; } revision 2022-12-01 { description "SWSS alert events."; @@ -54,10 +58,7 @@ module sonic-events-swss { } leaf status { - type enumeration { - enum "up"; - enum "down"; - } + type stypes:admin_status; description "Provides the status as up (true) or down (false)"; } From b47e82a0b85399ef54dee014c5cf298faf8bcb69 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Wed, 31 Aug 2022 23:51:59 +0000 Subject: [PATCH 22/26] Add review changes dhcp-relay --- .../yang-events/sonic-events-dhcp_relay.yang | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang b/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang index bd4e6b92df6..452bfab7c49 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang @@ -1,78 +1,78 @@ module sonic-events-dhcp-relay { namespace "http://github.com/sonic-net/sonic-events-dhcp-relay"; yang-version 1.1; + prefix events-dhcp-relay; import openconfig-alarm-types { prefix oc-alarm-types; } - import sonic-events-common { prefix evtcmn; + revision-date 2022-12-01; } - revision 2022-12-01 { description "dhcp-relay alert events."; } organization "SONiC"; - contact "SONiC"; - description "SONIC dhcp-relay events"; - container dhcp-relay-discard { - oc-alarm-types:MAJOR - - description " - Declares an event for dhcp-relay discarding packet on an - interface due to missing IP address assigned. - Params: - name of the interface discarding. - class of the missing IP address as IPv4 or IPv6."; - - leaf ip_class { - type enumeration { - enum "ipV4"; - enum "ipV6"; + container sonic-events-dhcp-relay { + container dhcp-relay-discard { + oc-alarm-types:MAJOR + + description " + Declares an event for dhcp-relay discarding packet on an + interface due to missing IP address assigned. + Params: + name of the interface discarding. + class of the missing IP address as IPv4 or IPv6."; + + leaf ip_class { + type enumeration { + enum "IPv4"; + enum "IPv6"; + } + description "Class of IP address missing"; } - description "Class of IP address missing"; - } - leaf ifname { - type string; - description "Name of the i/f discarding"; - } + leaf ifname { + type leafref { + path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name"; + } + description "Name of the i/f discarding"; + } - type leafref { - path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + uses evtcmn:sonic-events-cmn; } - uses evtcmn:sonic-events-cmn; - } - - container dhcp-relay-disparity { - oc-alarm-types:MAJOR - - description " - Declares an event for disparity detected in - DHCP Relay behavior by dhcpmon. - parameters: - vlan that shows this disparity - The duration of disparity"; + container dhcp-relay-disparity { + oc-alarm-types:MAJOR + + description " + Declares an event for disparity detected in + DHCP Relay behavior by dhcpmon. + parameters: + vlan that shows this disparity + The duration of disparity"; + + leaf vlan { + type leafref { + path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; + } + description "Name of the vlan affected"; + } - leaf vlan { - type string; - description "Name of the vlan affected"; - } + leaf duration { + type uint32; + description "Duration of disparity"; + } - leaf duration { - type uint32; - description "Duration of disparity"; + uses evtcmn:sonic-events-cmn; } - - uses evtcmn:sonic-events-cmn; } } From f7b8a1155bd8ed7df9d7000a6fc9c8ed046e7ca8 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Thu, 1 Sep 2022 17:03:17 +0000 Subject: [PATCH 23/26] Add peer review changes to host --- .../yang-events/sonic-events-common.yang | 12 + .../yang-events/sonic-events-host.yang | 267 +++++++++--------- 2 files changed, 144 insertions(+), 135 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-common.yang b/src/sonic-yang-models/yang-events/sonic-events-common.yang index 132ff1ed7d3..f21233d6bfb 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-common.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-common.yang @@ -21,6 +21,18 @@ module sonic-events-common { } } + grouping sonic-events-severity { + leaf severity { + type uint8 { + range "0..12" { + error-message "Incorrect val for %"; + } + } + default "2" + description "Severity level"; + } + } + grouping sonic-events-usage { leaf usage { type uint8 { diff --git a/src/sonic-yang-models/yang-events/sonic-events-host.yang b/src/sonic-yang-models/yang-events/sonic-events-host.yang index 95da1106ee5..fbaf81fb16d 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-host.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-host.yang @@ -1,188 +1,185 @@ -module events-host { +module sonic-events-host { namespace "http://github.com/sonic-net/sonic-events-host"; yang-version 1.1; + prefix events-host; import openconfig-alarm-types { prefix oc-alarm-types; } - import sonic-events-common { prefix evtcmn; + revision-date 2022-12-01; } revision 2022-12-01 { description "BGP alert events."; } - container disk-usage { - oc-alarm-types:MINOR + container sonic-events-host { + container disk-usage { + oc-alarm-types:MINOR - description " - Declares an event for disk usage crossing set limit - The parameters describe the usage & limit set."; + description " + Declares an event for disk usage crossing set limit + The parameters describe the usage & limit set."; - leaf fs { - type string; - description "Name of the file system"; - default ""; - } + leaf fs { + type string; + description "Name of the file system"; + default ""; + } - uses evtcmn:sonic-events-usage; + uses evtcmn:sonic-events-usage; - uses evtcmn:sonic-events-cmn; - } + uses evtcmn:sonic-events-cmn; + } - container memory-usage { - oc-alarm-types:MINOR + container memory-usage { + oc-alarm-types:MINOR - description " - Declares an event for memory usage crossing set limit - The parameters describe the usage & limit set."; + description " + Declares an event for memory usage crossing set limit + The parameters describe the usage & limit set."; - uses evtcmn:sonic-events-usage; + uses evtcmn:sonic-events-usage; - uses evtcmn:sonic-events-cmn; - } + uses evtcmn:sonic-events-cmn; + } - container event-sshd { - oc-alarm-types:MINOR + container event-sshd { + oc-alarm-types:MINOR - description " - Declares an event reported by sshd. - The fail type declares the type of failure. - INCORRECT_PASSWORD - denotes that sshd is sending - wrong password to AAA to intentionally fail this login."; + description " + Declares an event reported by sshd. + The fail type declares the type of failure. + INCORRECT_PASSWORD - denotes that sshd is sending + wrong password to AAA to intentionally fail this login."; - leaf fail_type { - type enumeration { - enum "INCORRECT_PASSWD"; + leaf fail_type { + type enumeration { + enum "INCORRECT_PASSWD"; + } + description "Type of failure"; } - description "Type of failure"; - } - uses evtcmn:sonic-events-cmn; - } + uses evtcmn:sonic-events-cmn; + } - container event-disk { - oc-alarm-types:MINOR + container event-disk { + oc-alarm-types:MINOR - description " - Declares an event reported by disk check. - The fail type declares the type of failure. - read-only - denotes that disk is in RO state."; + description " + Declares an event reported by disk check. + The fail type declares the type of failure. + read-only - denotes that disk is in RO state."; - leaf fail_type { - type enumeration { - enum "read_only"; + leaf fail_type { + type enumeration { + enum "read_only"; + } + description "Type of failure"; } - description "Type of failure"; + + uses evtcmn:sonic-events-cmn; } - uses evtcmn:sonic-events-cmn; - } + container event-kernel { + oc-alarm-types:MINOR + + description " + Declares an event reported by kernel. + The fail type declares the type of failure."; + + leaf fail_type { + type enumeration { + enum "write_failed"; + enum "write_protected"; + enum "remount_read_only"; + enum "aufs_read_lock"; + enum "invalid_freelist"; + enum "zlib_decompress"; + } + description "Type of failure"; + } - container event-kernel { - oc-alarm-types:MINOR - - description " - Declares an event reported by kernel. - The fail type declares the type of failure."; - - leaf fail_type { - type enumeration { - enum "write_failed"; - enum "write_protected"; - enum "remount_read_only"; - enum "aufs_read_lock"; - enum "invalid_freelist"; - enum "zlib_decompress"; + leaf msg { + type string; + description "human readable hint text"; + default ""; } - description "Type of failure"; - } - leaf msg { - type string; - description "human readable hint text"; - default ""; + uses evtcmn:sonic-events-cmn; } - uses evtcmn:sonic-events-cmn; - } - - container event-monit-proc { - evtcmn:severity "2" - - description " - Declares an event reported by monit for a process - that is not running. - - Params: - Name of the process that is not running. - The ASIC-index of that process."; + container event-monit-proc { + description " + Declares an event reported by monit for a process + that is not running. + Params: + Name of the process that is not running. + The ASIC-index of that process."; - leaf proc_name { - type string; - description "Name of the process not running"; - default ""; - } + leaf proc_name { + type string; + description "Name of the process not running"; + } - leaf asic_index { - type uint8; - description "ASIC index in case of multi asic platform"; - default 0; - } + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + } - uses evtcmn:sonic-events-cmn; - } + uses evtcmn:sonic-events-cmn; - container event-monit-status { - evtcmn:severity "2" + uses evtcmn:sonic-events-severity; + } - description " - Declares an event reported by monit for status check - failure for a process - - Params: - Name of the process that is not running. - The ASIC-index of that process."; + container event-monit-status { + description " + Declares an event reported by monit for status check + failure for a process + Params: + Name of the process that is not running. + The ASIC-index of that process."; - leaf entity { - type string; - description "Name of the failing entity"; - default ""; - } + leaf entity { + type string; + description "Name of the failing entity"; + } - leaf asic_index { - type uint8; - description "ASIC index in case of multi asic platform"; - default 0; - } + leaf asic_index { + type uint8; + description "ASIC index in case of multi asic platform"; + } - leaf reason { - type string; - description "Human readble text explaining failure"; - default ""; - } + leaf reason { + type string; + description "Human readble text explaining failure"; + default ""; + } - uses evtcmn:sonic-events-cmn; - } + uses evtcmn:sonic-events-cmn; - container event-platform { - evtcmn:severity "2" + uses evtcmn:sonic-events-severity; + } - description " - Declares an event for platform related failure. - Params: - fail_type provides the type of failure."; + container event-platform { + description " + Declares an event for platform related failure. + Params: + fail_type provides the type of failure."; - leaf fail_type { - type enumeration { - enum "watchdog_timeout"; - enum "switch_parity_error"; - enum "SEU_error"; + leaf fail_type { + type enumeration { + enum "watchdog_timeout"; + enum "switch_parity_error"; + enum "SEU_error"; + } + description "Type of failure"; } - description "Type of failure"; - } - uses evtcmn:sonic-events-cmn; + uses evtcmn:sonic-events-cmn; + + uses evtcmn:sonic-events-severity; + } } } From 247db787768088c5fc133e7810e7aa029e868daa Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Thu, 1 Sep 2022 21:54:35 +0000 Subject: [PATCH 24/26] Add changes to severity, leafref --- .../yang-events/sonic-events-common.yang | 24 +++++++++++++++++++ .../yang-events/sonic-events-host.yang | 12 +++++----- .../yang-events/sonic-events-swss.yang | 18 ++++++-------- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-common.yang b/src/sonic-yang-models/yang-events/sonic-events-common.yang index f21233d6bfb..6494ac43cc9 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-common.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-common.yang @@ -52,4 +52,28 @@ module sonic-events-common { description "Percentage limit set"; } } + + identity EVENT_SEVERITY { + description + "Base identity for event severities. Severities 2-4 + are supported"; + } + + identity EVENT_SEVERITY_2 { + base EVENT_SEVERITY; + description + "Indicates that the severity level of this type of event is 2"; + } + + identity EVENT_SEVERITY_3 { + base EVENT_SEVERITY; + description + "Indicates that the severity level of this type of event is 3"; + } + + identity EVENT_SEVERITY_4 { + base EVENT_SEVERITY; + description + "Indicates that the severity level of this type of event is 4"; + } } diff --git a/src/sonic-yang-models/yang-events/sonic-events-host.yang b/src/sonic-yang-models/yang-events/sonic-events-host.yang index fbaf81fb16d..e5a0913cff4 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-host.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-host.yang @@ -111,6 +111,8 @@ module sonic-events-host { } container event-monit-proc { + eventcmn:EVENT_SEVERITY_2; + description " Declares an event reported by monit for a process that is not running. @@ -129,11 +131,11 @@ module sonic-events-host { } uses evtcmn:sonic-events-cmn; - - uses evtcmn:sonic-events-severity; } container event-monit-status { + eventcmn: EVENT_SEVERITY_2; + description " Declares an event reported by monit for status check failure for a process @@ -158,11 +160,11 @@ module sonic-events-host { } uses evtcmn:sonic-events-cmn; - - uses evtcmn:sonic-events-severity; } container event-platform { + evtcmn:EVENT_SEVERITY_2; + description " Declares an event for platform related failure. Params: @@ -178,8 +180,6 @@ module sonic-events-host { } uses evtcmn:sonic-events-cmn; - - uses evtcmn:sonic-events-severity; } } } diff --git a/src/sonic-yang-models/yang-events/sonic-events-swss.yang b/src/sonic-yang-models/yang-events/sonic-events-swss.yang index e4ce6dce53d..5bd72c3d720 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-swss.yang @@ -49,13 +49,11 @@ module sonic-events-swss { The name of the flapping i/f and status are the only params."; leaf ifname { - type string; + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } description "Interface name"; - } - - type leafref { - path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; - } + } leaf status { type stypes:admin_status; @@ -73,14 +71,12 @@ module sonic-events-swss { The name of the i/f facing the storm is the only param."; leaf ifname { - type string; + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } description "Interface name"; } - type leafref { - path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; - } - leaf queue_index { type uint8; } From a98044e4188d7382599183fc1f73ae414ad4ad9e Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Thu, 1 Sep 2022 21:55:53 +0000 Subject: [PATCH 25/26] Remove unused grouping --- .../yang-events/sonic-events-common.yang | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-common.yang b/src/sonic-yang-models/yang-events/sonic-events-common.yang index 6494ac43cc9..595bf39ca9b 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-common.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-common.yang @@ -21,18 +21,6 @@ module sonic-events-common { } } - grouping sonic-events-severity { - leaf severity { - type uint8 { - range "0..12" { - error-message "Incorrect val for %"; - } - } - default "2" - description "Severity level"; - } - } - grouping sonic-events-usage { leaf usage { type uint8 { From f60c7d298b40c5608db12d9c1694468efdd1a8f3 Mon Sep 17 00:00:00 2001 From: zbud-msft Date: Sat, 10 Sep 2022 01:45:33 +0000 Subject: [PATCH 26/26] Remove redis generic --- .../yang-events/sonic-events-host.yang | 10 +++++++--- .../yang-events/sonic-events-swss.yang | 16 ---------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/sonic-yang-models/yang-events/sonic-events-host.yang b/src/sonic-yang-models/yang-events/sonic-events-host.yang index e5a0913cff4..606ce661051 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-host.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-host.yang @@ -111,7 +111,7 @@ module sonic-events-host { } container event-monit-proc { - eventcmn:EVENT_SEVERITY_2; + eventcmn:EVENT_SEVERITY_2 description " Declares an event reported by monit for a process @@ -123,18 +123,20 @@ module sonic-events-host { leaf proc_name { type string; description "Name of the process not running"; + default ""; } leaf asic_index { type uint8; description "ASIC index in case of multi asic platform"; + default 0; } uses evtcmn:sonic-events-cmn; } container event-monit-status { - eventcmn: EVENT_SEVERITY_2; + eventcmn:EVENT_SEVERITY_2 description " Declares an event reported by monit for status check @@ -146,11 +148,13 @@ module sonic-events-host { leaf entity { type string; description "Name of the failing entity"; + default ""; } leaf asic_index { type uint8; description "ASIC index in case of multi asic platform"; + default 0; } leaf reason { @@ -163,7 +167,7 @@ module sonic-events-host { } container event-platform { - evtcmn:EVENT_SEVERITY_2; + evtcmn:EVENT_SEVERITY_2 description " Declares an event for platform related failure. diff --git a/src/sonic-yang-models/yang-events/sonic-events-swss.yang b/src/sonic-yang-models/yang-events/sonic-events-swss.yang index 5bd72c3d720..ded47fead53 100644 --- a/src/sonic-yang-models/yang-events/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-events/sonic-events-swss.yang @@ -25,22 +25,6 @@ module sonic-events-swss { "SONIC SWSS events"; container sonic-events-swss { - container redis-generic { - oc-alarm-types:MAJOR - - description " - Declares an event for a fatal error encountered by swss. - The asic-index of the failing process is the only param."; - - leaf asic_index { - type uint8; - description "ASIC index in case of multi asic platform"; - default 0; - } - - uses evtcmn:sonic-events-cmn; - } - container if-state { oc-alarm-types:MINOR