Skip to content

Commit

Permalink
Merge pull request sonic-net#24 from gechiang/202205
Browse files Browse the repository at this point in the history
Manual Cherry-pick PRs with labels "Chassis for 202205 Branch" from sonic-net/sonic-buildimage
  • Loading branch information
gechiang committed Jun 3, 2023
2 parents f23a107 + aea8921 commit c229648
Show file tree
Hide file tree
Showing 57 changed files with 34,395 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- macro generate_wred_profiles() %}
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "10000000",
"green_min_threshold" : "2000000",
"yellow_max_threshold" : "10000000",
"yellow_min_threshold" : "2000000",
"red_max_threshold" : "10000000",
"red_min_threshold" : "2000000",
"green_drop_probability" : "5",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
{%- endmacro %}

{%- include 'qos_config.j2' %}
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/TS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ switch_type=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['switch_type']"`
# Check whether the routemap is for internal BGP sessions.
function is_internal_route_map()
{
[[ "$1" =~ .*"_INTERNAL_".* && $switch_type != "chassis-packet" ]]
[[ "$1" =~ .*"_INTERNAL_".* || "$1" =~ .*"VOQ_".* ]]
}

function check_not_installed()
Expand Down
15 changes: 14 additions & 1 deletion dockers/docker-fpm-frr/base_image_files/TSA
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

if [ -f /etc/sonic/chassisdb.conf ]; then
rexec all -c "TSA chassis"
echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Maintenance after reboot\
or config reload on all linecards"
exit 0
fi
# toggle the mux to standby if dualtor and any mux active
if
[[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]] &&
Expand All @@ -10,4 +16,11 @@ then
fi

/usr/bin/TS TSA
echo "Please execute 'config save' to preserve System mode in Maintenance after reboot or config reload"
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"
echo -e "\nWARNING: Please execute 'TSA' on all other linecards of the chassis to fully isolate this device"
fi
else
echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload"
fi
16 changes: 15 additions & 1 deletion dockers/docker-fpm-frr/base_image_files/TSB
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

# If run on supervisor of chassis, trigger remote execution of TSB on all linecards
if [ -f /etc/sonic/chassisdb.conf ]; then
rexec all -c "TSB chassis"
echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Normal state after reboot\
or config reload on all linecards"
exit 0
fi

# toggle the mux to auto if dualtor
if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]];
then
Expand All @@ -8,4 +16,10 @@ then
fi

/usr/bin/TS TSB
echo "Please execute 'config save' to preserve System mode in Normal state after reboot or config reload"
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
12 changes: 10 additions & 2 deletions dockers/docker-fpm-frr/base_image_files/TSC
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#!/bin/bash

/usr/bin/TS TSC
if [ -f /etc/sonic/chassisdb.conf ]; then
if [[ $1 == "no-stats" ]]; then
rexec all -c "TSC no-stats"
else
rexec all -c "TSC"
fi
exit 0
fi

portstat -p 5
/usr/bin/TS TSC
[[ $1 != "no-stats" ]] && portstat -p 5

if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@
! template: bgpd/templates/BGPMON/peer-group.conf.j2
!
neighbor BGPMON peer-group
{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
neighbor BGPMON update-source Loopback4096
{% else %}
neighbor BGPMON update-source {{ loopback0_ipv4 | ip }}
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
{% endif %}

address-family ipv4
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family

{% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}
address-family ipv6
neighbor BGPMON activate
neighbor BGPMON route-map FROM_BGPMON in
neighbor BGPMON route-map TO_BGPMON out
neighbor BGPMON send-community
neighbor BGPMON maximum-prefix 1
exit-address-family
{% endif %}
!
! end of template: bgpd/templates/BGPMON/peer-group.conf.j2
!

1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/frr/zebra/zebra.interfaces.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vni {{ vnet_metadata['vni'] }}
{% block interfaces %}
! Enable nht through default route
ip nht resolve-via-default
ipv6 nht resolve-via-default
! Enable link-detect (default disabled)
{% for (name, prefix) in INTERFACE|pfx_filter %}
interface {{ name }}
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __generate_routemaps_from_template(self, route_map_names, template):
for rm in sorted(route_map_names):
# For packet-based chassis, the bgp session between the linecards are also considered internal sessions
# While isolating a single linecard, these sessions should not be skipped
if "_INTERNAL_" in rm and self.switch_type != "chassis-packet":
if "_INTERNAL_" in rm or "VOQ_" in rm:
continue
if "V4" in rm:
ipv="V4" ; ipp="ip"
Expand Down
Loading

0 comments on commit c229648

Please sign in to comment.