Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dockers/docker-fpm-frr/base_image_files/TS
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment

PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
type=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'type'`
subtype=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'subtype'`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subtype may not be defined for all sonic SpineRouter sku's?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly used for reliable TSA from supervisor on modular chassis.
subtype is being used to check if the device is a linecard (UpstreamLC/DownstreamLC). If not set, assumption is that it is not a linecard.

TSA_CHASSIS_STATE=false

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

Expand Down
16 changes: 6 additions & 10 deletions dockers/docker-fpm-frr/base_image_files/TSA
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,9 @@ if [ -z "$STARTED_BY_TSA_TSB_SERVICE" ]; then
fi

/usr/bin/TS TSA
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then
if [[ "$1" != "chassis" ]] ; then
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
if [[ $disaggregated_chassis -ne 1 ]]; then
echo -e "\nWARNING: Please execute 'TSA' on all other linecards of the chassis to fully isolate this device"
fi
fi
else
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
fi
Comment on lines -61 to -70
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 62 was only applicable for rexec-based TSA where we were passing "TSA chassis" from sup. It is no longer needed.
Other changes are just making that warning message print on modular chassis alone by looking for upstream/downstreamLC

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TSA from sup can still be done by DRI on sup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rlhui - no functional change to TSA from sup in this PR. This is just code cleanup while printing warning message on linecard. Instead of using Spinerouter to identify linecard, we have switched to using subtype UpsteamLC/DownstreamLC

echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"

subtype=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'subtype'`
if [[ $subtype == *"UpstreamLC"* || $subtype == *"DownstreamLC"* ]] ; then
echo -e "\nWARNING: Please execute 'TSA' on Supervisor or on all other linecards of the chassis to fully isolate the chassis"
fi
8 changes: 1 addition & 7 deletions dockers/docker-fpm-frr/base_image_files/TSB
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,4 @@ if [ -z "$STARTED_BY_TSA_TSB_SERVICE" ]; then
fi

/usr/bin/TS TSB
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then
if [[ "$1" != "chassis" ]] ; then
echo "Please execute 'sudo config save' to preserve System mode in Normal state after reboot or config reload"
fi
else
echo "Please execute 'sudo config save' to preserve System mode in Normal state after reboot or config reload"
fi
Comment on lines -60 to -66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some previous code cleanup issue. It is the same message being printed in all cases, so removed the conditional check

echo "Please execute 'sudo config save' to preserve System mode in Normal state after reboot or config reload"
10 changes: 6 additions & 4 deletions dockers/docker-fpm-frr/base_image_files/prefix_list
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ check_spine_router() {
type=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)
subtype=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype)

# only supported on spine routers and UpstreamLC
if [[ "$type" != "SpineRouter" || "$subtype" != "UpstreamLC" ]]; then
echo "Operation is only supported on UpstreamLC of SpineRouter." >&2
exit 1
# only supported on UpstreamLC or UpperSpineRouter
if [[ ("$type" == "SpineRouter" && "$subtype" == "UpstreamLC") || "$type" == "UpperSpineRouter" ]]
exit 0
fi

echo "Operation is only supported on Upstream SpineRouter." >&2
exit 1
}

# Function to skip operation on chassis supervisor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
! template: bgpd/templates/BGPMON/peer-group.conf.j2
!
neighbor BGPMON peer-group
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
{% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'voq' or CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
neighbor BGPMON update-source Loopback4096
{% elif loopback0_ipv4 %}
neighbor BGPMON update-source {{ loopback0_ipv4 | ip }}
Expand All @@ -16,7 +16,7 @@
neighbor BGPMON maximum-prefix 1
exit-address-family

{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
{% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'voq' or CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %}
address-family ipv6
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
Expand Down
4 changes: 4 additions & 0 deletions dockers/docker-orchagent/switch.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
{% set lag_hash_offset_value = 10 %}
{% elif "SpineRouter" in DEVICE_METADATA.localhost.type %}
{% set hash_seed = 25 %}
{% elif "FabricSpineRouter" in DEVICE_METADATA.localhost.type %}
{% set hash_seed = 40 %}
{% elif "UpperSpineRouter" in DEVICE_METADATA.localhost.type %}
{% set hash_seed = 50 %}
{% endif %}
{% endif %}
{% if DEVICE_METADATA.localhost.namespace_id %}
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-bgpcfgd/bgpcfgd/managers_prefix_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def generate_prefix_list_config(self, data, add):
if data["prefix_list_name"] != "ANCHOR_PREFIX":
log_warn("PrefixListMgr:: Prefix list %s is not supported" % data["prefix_list_name"])
return False
if localhost_type != "SpineRouter" or subtype != "UpstreamLC":
log_warn("PrefixListMgr:: Prefix list %s is only supported on UpstreamLC of SpineRouter" % data["prefix_list_name"])
if localhost_type not in ["UpperSpineRouter", "SpineRouter"] or (localhost_type == "SpineRouter" and subtype != "UpstreamLC"):
log_warn("PrefixListMgr:: Prefix list %s is only supported on Upstream SpineRouter" % data["prefix_list_name"])
return False

# Add the anchor prefix to the radian configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"CONFIG_DB__DEVICE_METADATA": {
"localhost": {
"type": "SpineRouter"
"type": "SpineRouter",
"switch_type": "voq"
}
}
}
Loading