Skip to content

Commit

Permalink
Revert "Revert suppress FIB pending feature (#19027)" (#19836)
Browse files Browse the repository at this point in the history
Reverts #19027

The support for BGP zebra enhancements is merged in #19717. Hence re-enabling BGP suppress fib pending feature.
  • Loading branch information
dgsudharsan authored Sep 2, 2024
1 parent 40834d5 commit 0b4c3a1
Show file tree
Hide file tree
Showing 34 changed files with 89 additions and 4 deletions.
1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
!
{% block bgp_init %}
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'].lower() == 'dualtor') %}
Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stderr_logfile=syslog
dependent_startup=true

[program:zebra]
command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp
command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp --asic-offload=notify_on_offload
priority=4
autostart=false
autorestart=false
Expand Down
2 changes: 1 addition & 1 deletion platform/vs/docker-sonic-vs/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ environment=ASAN_OPTIONS="log_path=/var/log/asan/teammgrd-asan.log{{ asan_extra_
{% endif %}

[program:zebra]
command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl
command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl --asic-offload=notify_on_offload
priority=13
autostart=false
autorestart=false
Expand Down
5 changes: 3 additions & 2 deletions src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,11 @@ def apply_op(self, cmd, vrf):
:return: True if no errors, False if there are errors
"""
bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"]
enable_bgp_suppress_fib_pending_cmd = 'bgp suppress-fib-pending'
if vrf == 'default':
cmd = ('router bgp %s\n' % bgp_asn) + cmd
cmd = ('router bgp %s\n %s\n' % (bgp_asn, enable_bgp_suppress_fib_pending_cmd)) + cmd
else:
cmd = ('router bgp %s vrf %s\n' % (bgp_asn, vrf)) + cmd
cmd = ('router bgp %s vrf %s\n %s\n' % (bgp_asn, vrf, enable_bgp_suppress_fib_pending_cmd)) + cmd
self.cfg_mgr.push(cmd)
return True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ route-map HIDE_INTERNAL permit 20
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ipv6 prefix-list PL_LoopbackV6 permit fc00::1/128
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 55555
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
console_device_types = ['MgmtTsToR']
dhcp_server_enabled_device_types = ['BmcMgmtToRRouter']
mgmt_device_types = ['BmcMgmtToRRouter', 'MgmtToRRouter', 'MgmtTsToR']
leafrouter_device_types = ['LeafRouter']

# Counters disabled on management devices
mgmt_disabled_counters = ["BUFFER_POOL_WATERMARK", "PFCWD", "PG_DROP", "PG_WATERMARK", "PORT_BUFFER_DROP", "QUEUE", "QUEUE_WATERMARK"]
Expand Down Expand Up @@ -2707,6 +2708,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
if current_device and current_device['type'] in mgmt_device_types:
results["FLEX_COUNTER_TABLE"] = {counter: {"FLEX_COUNTER_STATUS": "disable"} for counter in mgmt_disabled_counters}

# Enable bgp-suppress-fib by default for leafrouter
if current_device and current_device['type'] in leafrouter_device_types:
results['DEVICE_METADATA']['localhost']['suppress-fib-pending'] = 'enabled'

return results

def get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, tunnel_qos_remap, mux_tunnel_name, peer_switch_ip):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
coalesce-time 10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
1 change: 1 addition & 0 deletions src/sonic-config-engine/tests/sample_output/py2/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32
router bgp 4000
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
coalesce-time 10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ route-map HIDE_INTERNAL permit 10
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
1 change: 1 addition & 0 deletions src/sonic-config-engine/tests/sample_output/py3/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
router bgp 65100
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32
router bgp 4000
!
bgp log-neighbor-changes
bgp suppress-fib-pending
no bgp default ipv4-unicast
no bgp ebgp-requires-policy
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@
"DEVICE_METADATA_ADVERTISE_LO_PREFIX_AS_128": {
"desc": "Verifying advertising lo prefix as /128."
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": {
"desc": "Enable bgp-suppress-fib-pending"
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": {
"desc": "Disable bgp-suppress-fib-pending"
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": {
"desc": "Enable bgp-suppress-fib-pending when synchronous mode is disabled",
"eStr": ["ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"]
},
"DEVICE_METADATA_VALID_RACK_MGMT_MAP": {
"desc": "Verifying rack_mgmt_map configuration."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,36 @@
}
}
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"synchronous_mode": "enable",
"suppress-fib-pending": "enabled"
}
}
}
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"synchronous_mode": "disable",
"suppress-fib-pending": "disabled"
}
}
}
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"synchronous_mode": "disable",
"suppress-fib-pending": "enabled"
}
}
}
},
"DEVICE_METADATA_VALID_RACK_MGMT_MAP": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
Expand Down
12 changes: 12 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-device_metadata.yang
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ module sonic-device_metadata {
By default SONiC advertises /128 subnet prefix in Loopback0 as /64 subnet route";
}

leaf suppress-fib-pending {
description "Enable BGP suppress FIB pending feature. BGP will wait for route FIB installation before announcing routes";
type enumeration {
enum enabled;
enum disabled;
}
default disabled;

must "((current() = 'disabled') or (current() = 'enabled' and ../synchronous_mode = 'enable'))" {
error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature";
}
}
leaf rack_mgmt_map {
type string {
length 0..128 {
Expand Down

0 comments on commit 0b4c3a1

Please sign in to comment.