Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[202311] Revert bgp suppress fib pending" #17882

Merged
merged 1 commit into from
Jan 23, 2024
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
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 @@ -66,6 +66,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
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 fpm -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 fpm
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 @@ -304,10 +304,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 @@ -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 @@ -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
6 changes: 5 additions & 1 deletion src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def parse_dpg(dpg, hname):
else:
prefix = prefix + "/32"
static_routes[prefix] = {'nexthop': ",".join(nexthop), 'ifname': ",".join(ifname), 'advertise': advertise}

if port_nhipv4_map and port_nhipv6_map:
subnet_check_ip = list(port_nhipv4_map.values())[0]
for subnet_range in ip_intfs_map:
Expand Down Expand Up @@ -2131,6 +2131,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
121 changes: 121 additions & 0 deletions src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
From f5f0018266c98ad96cdbe69ae60d501de21e5600 Mon Sep 17 00:00:00 2001
From: Stepan Blyschak <[email protected]>
Date: Thu, 20 Oct 2022 13:19:31 +0000
Subject: [PATCH] From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 Mon Sep 17
00:00:00 2001 Subject: [PATCH 07/13] Added support of L3VNI EVPN

This is temp patch till Prefix to ARP indirection is add in neighorch

Signed-off-by: Kishore Kunal <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>

diff --git a/lib/nexthop.c b/lib/nexthop.c
index 7ebc4fefb..2f7bb0e7b 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -813,6 +813,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy,
memcpy(&copy->src, &nexthop->src, sizeof(nexthop->src));
memcpy(&copy->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src));
copy->rparent = rparent;
+ memcpy(&copy->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN);
if (nexthop->nh_label)
nexthop_add_labels(copy, nexthop->nh_label_type,
nexthop->nh_label->num_labels,
diff --git a/lib/nexthop.h b/lib/nexthop.h
index f1309aa52..7b4bbbafd 100644
--- a/lib/nexthop.h
+++ b/lib/nexthop.h
@@ -66,6 +66,11 @@ enum nh_encap_type {
/* Backup index value is limited */
#define NEXTHOP_BACKUP_IDX_MAX 255

+struct vxlan_nh_encap {
+ vni_t vni;
+ struct ethaddr rmac;
+};
+
/* Nexthop structure. */
struct nexthop {
struct nexthop *next;
@@ -137,7 +142,7 @@ struct nexthop {
/* Encapsulation information. */
enum nh_encap_type nh_encap_type;
union {
- vni_t vni;
+ struct vxlan_nh_encap encap_data;
} nh_encap;

/* SR-TE color used for matching SR-TE policies */
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 79d79d74b..325199eff 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1969,6 +1969,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen,
struct nexthop *nh)
{
struct rtattr *nest;
+ struct vxlan_nh_encap* encap_data;

switch (nh->nh_encap_type) {
case NET_VXLAN:
@@ -1979,9 +1980,21 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen,
if (!nest)
return false;

+ encap_data = &nh->nh_encap.encap_data;
+
if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */,
- nh->nh_encap.vni))
+ encap_data->vni))
+ return false;
+
+ if (ZEBRA_DEBUG_KERNEL)
+ zlog_debug(
+ "%s: VNI:%d RMAC:%pEA", __func__, encap_data->vni,
+ &encap_data->rmac);
+
+ if (!nl_attr_put(n, nlen, 1 /* VXLAN_RMAC */,
+ &encap_data->rmac, sizeof(encap_data->rmac)))
return false;
+
nl_attr_nest_end(n, nest);
break;
}
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index c0945eae2..157c33ced 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh,
vtep_ip.ipa_type = IPADDR_V4;
memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4),
sizeof(struct in_addr));
+ memcpy(&(nexthop->nh_encap.encap_data.rmac),
+ &api_nh->rmac, ETH_ALEN);
zebra_rib_queue_evpn_route_add(
api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN);
@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh,
vtep_ip.ipa_type = IPADDR_V6;
memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6),
sizeof(struct in6_addr));
+ memcpy(&(nexthop->nh_encap.encap_data.rmac),
+ &api_nh->rmac, ETH_ALEN);
zebra_rib_queue_evpn_route_add(
api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN);
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index f6f436f39..c8511bd28 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -2917,7 +2917,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
zl3vni = zl3vni_from_vrf(nexthop->vrf_id);
if (zl3vni && is_l3vni_oper_up(zl3vni)) {
nexthop->nh_encap_type = NET_VXLAN;
- nexthop->nh_encap.vni = zl3vni->vni;
+ nexthop->nh_encap.encap_data.vni = zl3vni->vni;
}
}

--
2.17.1

31 changes: 31 additions & 0 deletions src/sonic-frr/patch/0007-ignore-route-from-default-table.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 1a639f2dcd400997345dab424a2adbc091752661 Mon Sep 17 00:00:00 2001
From: Stepan Blyschak <[email protected]>
Date: Thu, 20 Oct 2022 13:07:18 +0000
Subject: [PATCH] From ca66350aecf7db3354019480d11754fabae3a97c Mon Sep 17
00:00:00 2001 Subject: [PATCH 09/13] ignore route from default table

Signed-off-by: Stepan Blyschak <[email protected]>

diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c
index 0a9fecc9d..b18a96353 100644
--- a/zebra/dplane_fpm_nl.c
+++ b/zebra/dplane_fpm_nl.c
@@ -814,6 +814,15 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
|| op == DPLANE_OP_NH_UPDATE))
return 0;

+ /*
+ * Ignore route from default table, because when mgmt port goes down,
+ * zebra will remove the default route and causing ASIC to blackhole IO.
+ */
+ if (dplane_ctx_get_table(ctx) == RT_TABLE_DEFAULT) {
+ zlog_debug("%s: discard default table route", __func__);
+ return 0;
+ }
+
nl_buf_len = 0;

frr_mutex_lock_autounlock(&fnc->obuf_mutex);
--
2.17.1

Loading