Skip to content

Commit 1886d1c

Browse files
authored
[202503] Changes to support other SpineRouter roles (#1069)
<!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md ** Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> Manual cherry-pick of sonic-net/sonic-buildimage#22337 #### Why I did it To support additional SpineRouter roles introduced in sonic-net/sonic-buildimage#22285 ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Added additional roles to checks of spinerouter, changed chassis specific code to look for upstream/downstreamLC #### How to verify it Test with switch role set to one of the new SpineRouter roles <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
2 parents cd7a2f0 + 27d374e commit 1886d1c

6 files changed

Lines changed: 17 additions & 21 deletions

File tree

dockers/docker-fpm-frr/base_image_files/TS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
55

66
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
7-
type=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'type'`
7+
subtype=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'subtype'`
88
TSA_CHASSIS_STATE=false
99

10-
if [[ $type == *"SpineRouter"* ]]; then
10+
if [[ $subtype == *"UpstreamLC"* || $subtype == *"DownstreamLC"* ]]; then
11+
# Check supervisor TSA state, only required on chassis linecard
1112
TSA_CHASSIS_STATE="$(sonic-db-cli CHASSIS_APP_DB HGET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled)"
1213
fi
1314

dockers/docker-fpm-frr/base_image_files/TSA

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ if [ -z "$STARTED_BY_TSA_TSB_SERVICE" ]; then
5353
fi
5454

5555
/usr/bin/TS TSA
56-
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then
57-
if [[ "$1" != "chassis" ]] ; then
58-
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
59-
if [[ $disaggregated_chassis -ne 1 ]]; then
60-
echo -e "\nWARNING: Please execute 'TSA' on all other linecards of the chassis to fully isolate this device"
61-
fi
62-
fi
63-
else
64-
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
56+
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
57+
58+
subtype=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'subtype'`
59+
if [[ $subtype == *"UpstreamLC"* || $subtype == *"DownstreamLC"* ]] ; then
60+
echo -e "\nWARNING: Please execute 'TSA' on Supervisor or on all other linecards of the chassis to fully isolate the chassis"
6561
fi

dockers/docker-fpm-frr/base_image_files/TSB

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,4 @@ if [ -z "$STARTED_BY_TSA_TSB_SERVICE" ]; then
5252
fi
5353

5454
/usr/bin/TS TSB
55-
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then
56-
if [[ "$1" != "chassis" ]] ; then
57-
echo "Please execute 'sudo config save' to preserve System mode in Normal state after reboot or config reload"
58-
fi
59-
else
60-
echo "Please execute 'sudo config save' to preserve System mode in Normal state after reboot or config reload"
61-
fi
55+
echo "Please execute 'sudo config save' to preserve System mode in Normal state after reboot or config reload"

dockers/docker-fpm-frr/frr/bgpd/templates/monitors/peer-group.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
! template: bgpd/templates/BGPMON/peer-group.conf.j2
33
!
44
neighbor BGPMON peer-group
5-
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
5+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'voq' or CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
66
neighbor BGPMON update-source Loopback4096
77
{% elif loopback0_ipv4 %}
88
neighbor BGPMON update-source {{ loopback0_ipv4 | ip }}
@@ -16,7 +16,7 @@
1616
neighbor BGPMON maximum-prefix 1
1717
exit-address-family
1818

19-
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
19+
{% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'voq' or CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
2020
address-family ipv6
2121
neighbor BGPMON activate
2222
neighbor BGPMON route-map FROM_BGPMON in

dockers/docker-orchagent/switch.json.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
{% set lag_hash_offset_value = 10 %}
1414
{% elif "SpineRouter" in DEVICE_METADATA.localhost.type %}
1515
{% set hash_seed = 25 %}
16+
{% elif "FabricSpineRouter" in DEVICE_METADATA.localhost.type %}
17+
{% set hash_seed = 40 %}
18+
{% elif "UpperSpineRouter" in DEVICE_METADATA.localhost.type %}
19+
{% set hash_seed = 50 %}
1620
{% endif %}
1721
{% endif %}
1822
{% if DEVICE_METADATA.localhost.namespace_id %}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"CONFIG_DB__DEVICE_METADATA": {
33
"localhost": {
4-
"type": "SpineRouter"
4+
"type": "SpineRouter",
5+
"switch_type": "voq"
56
}
67
}
78
}

0 commit comments

Comments
 (0)