[FRR] Switch to dplane_fpm_nl plugin instead of fpm (#12852)
Why I did it dplane_fpm_nl is a new FPM implementation in FRR. The old plugin fpm will not have any new features implemented. Usage of the new plugin gives us ability to use BGP suppression feature and next hop groups in the future. How I did it Switch to dplane_fpm_nl zebra plugin from old fpm plugin which is not supported anymore Remove stale patches for old fpm plugin and add similar patches for dplane_fpm_nl How to verify it Build and run on the switch. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This commit is contained in:
parent
1dec473495
commit
68e1079202
@ -41,6 +41,15 @@ update_default_gw()
|
||||
fi
|
||||
}
|
||||
|
||||
write_default_zebra_config()
|
||||
{
|
||||
FILE_NAME=${1}
|
||||
|
||||
grep -q '^no fpm use-next-hop-groups' $FILE_NAME || {
|
||||
sed -i '1i no fpm use-next-hop-groups\nfpm address 127.0.0.1' $FILE_NAME
|
||||
}
|
||||
}
|
||||
|
||||
if [[ ! -z "$NAMESPACE_ID" ]]; then
|
||||
update_default_gw 4
|
||||
update_default_gw 6
|
||||
@ -69,9 +78,11 @@ if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then
|
||||
elif [ "$CONFIG_TYPE" == "split" ]; then
|
||||
echo "no service integrated-vtysh-config" > /etc/frr/vtysh.conf
|
||||
rm -f /etc/frr/frr.conf
|
||||
write_default_zebra_config /etc/frr/zebra.conf
|
||||
elif [ "$CONFIG_TYPE" == "split-unified" ]; then
|
||||
echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
|
||||
rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf
|
||||
write_default_zebra_config /etc/frr/frr.conf
|
||||
elif [ "$CONFIG_TYPE" == "unified" ]; then
|
||||
CFGGEN_PARAMS=" \
|
||||
-d \
|
||||
|
@ -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
|
||||
priority=4
|
||||
autostart=false
|
||||
autorestart=false
|
||||
|
@ -6,6 +6,13 @@
|
||||
!
|
||||
{% endblock banner %}
|
||||
!
|
||||
{% block fpm %}
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
{% endblock fpm %}
|
||||
!
|
||||
{% include "common/daemons.common.conf.j2" %}
|
||||
!
|
||||
{% include "zebra.interfaces.conf.j2" %}
|
||||
|
@ -206,6 +206,8 @@ RUN touch /etc/quagga/zebra.conf
|
||||
# disable integrated vtysh config
|
||||
RUN rm /etc/frr/frr.conf
|
||||
|
||||
COPY ["frr/zebra.conf", "/etc/frr/"]
|
||||
|
||||
# Create /var/warmboot/teamd folder for teammgrd
|
||||
RUN mkdir -p /var/warmboot/teamd
|
||||
|
||||
|
4
platform/vs/docker-sonic-vs/frr/zebra.conf
Normal file
4
platform/vs/docker-sonic-vs/frr/zebra.conf
Normal file
@ -0,0 +1,4 @@
|
||||
no fpm use-next-hop-groups
|
||||
|
||||
fpm address 127.0.0.1
|
||||
|
@ -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
|
||||
priority=13
|
||||
autostart=false
|
||||
autorestart=false
|
||||
|
@ -3,6 +3,12 @@
|
||||
! generated by templates/zebra/zebra.conf.j2 using config DB data
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname new_hostname
|
||||
|
@ -4,6 +4,11 @@
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname SpineFront01
|
||||
|
@ -4,6 +4,11 @@
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname SpineFront01
|
||||
|
@ -4,6 +4,11 @@
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname switch-t0
|
||||
|
@ -4,6 +4,11 @@
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname SpineFront01
|
||||
|
@ -4,6 +4,11 @@
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname SpineFront01
|
||||
|
@ -4,6 +4,11 @@
|
||||
! file: zebra.conf
|
||||
!
|
||||
!
|
||||
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
|
||||
no fpm use-next-hop-groups
|
||||
!
|
||||
fpm address 127.0.0.1
|
||||
!
|
||||
! template: common/daemons.common.conf.j2
|
||||
!
|
||||
hostname switch-t0
|
||||
|
@ -1,25 +1,48 @@
|
||||
From 39bb40dc4bad4462e4ae9c98580d75fa2c92e032 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Shirshov <pavelsh@microsoft.com>
|
||||
Date: Mon, 16 Nov 2020 18:29:46 -0800
|
||||
Subject: [PATCH 3/8] Use vrf_id for vrf, not tabled_id
|
||||
From 5dba497fb3810f9e5cb4b23bec151ec44d8dcec4 Mon Sep 17 00:00:00 2001
|
||||
From: Stepan Blyschak <stepanb@nvidia.com>
|
||||
Date: Mon, 16 Jan 2023 11:24:16 +0000
|
||||
Subject: [PATCH] Use vrf_id for vrf, not tabled_id
|
||||
|
||||
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
|
||||
---
|
||||
zebra/zebra_fpm_netlink.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
zebra/rt_netlink.c | 24 ++++++++++++++++++------
|
||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
|
||||
index ec22c5dd4..aad0156b3 100644
|
||||
--- a/zebra/zebra_fpm_netlink.c
|
||||
+++ b/zebra/zebra_fpm_netlink.c
|
||||
@@ -287,7 +287,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
|
||||
ri->nlmsg_pid = zvrf->zns->netlink_dplane_out.snl.nl_pid;
|
||||
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
|
||||
index 24c01b7f5..d4567990e 100644
|
||||
--- a/zebra/rt_netlink.c
|
||||
+++ b/zebra/rt_netlink.c
|
||||
@@ -1969,12 +1969,24 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
|
||||
#endif
|
||||
/* Table corresponding to this route. */
|
||||
table_id = dplane_ctx_get_table(ctx);
|
||||
- if (table_id < 256)
|
||||
- req->r.rtm_table = table_id;
|
||||
- else {
|
||||
- req->r.rtm_table = RT_TABLE_UNSPEC;
|
||||
- if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id))
|
||||
- return 0;
|
||||
+ if (!fpm) {
|
||||
+ if (table_id < 256)
|
||||
+ req->r.rtm_table = table_id;
|
||||
+ else {
|
||||
+ req->r.rtm_table = RT_TABLE_UNSPEC;
|
||||
+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, table_id))
|
||||
+ return 0;
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* Put vrf if_index instead of table id */
|
||||
+ vrf_id_t vrf = dplane_ctx_get_vrf(ctx);
|
||||
+ if (vrf < 256)
|
||||
+ req->r.rtm_table = vrf;
|
||||
+ else {
|
||||
+ req->r.rtm_table = RT_TABLE_UNSPEC;
|
||||
+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, vrf))
|
||||
+ return 0;
|
||||
+ }
|
||||
}
|
||||
|
||||
ri->nlmsg_type = cmd;
|
||||
- ri->rtm_table = table_info->table_id;
|
||||
+ ri->rtm_table = zvrf_id(rib_dest_vrf(dest));
|
||||
ri->rtm_protocol = RTPROT_UNSPEC;
|
||||
|
||||
/*
|
||||
if (IS_ZEBRA_DEBUG_KERNEL)
|
||||
--
|
||||
2.12.2
|
||||
2.30.2
|
||||
|
||||
|
@ -1,39 +1,40 @@
|
||||
From 74ee34e4990dbd168b7b8072894eb0cf8927f9d1 Mon Sep 17 00:00:00 2001
|
||||
From: Kishore Kunal <kishore.kunal@broadcom.com>
|
||||
Date: Fri, 15 Jan 2021 15:52:13 -0800
|
||||
Subject: [PATCH 7/8] This is temp patch till Prefix to ARP indirection is
|
||||
add in neighorch
|
||||
From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 Mon Sep 17 00:00:00 2001
|
||||
From: Stepan Blyschak <stepanb@nvidia.com>
|
||||
Date: Thu, 20 Oct 2022 13:19:31 +0000
|
||||
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 <kishore.kunal@broadcom.com>
|
||||
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
|
||||
---
|
||||
lib/nexthop.c | 2 ++
|
||||
lib/nexthop.h | 6 ++++++
|
||||
zebra/rt_netlink.c | 2 +-
|
||||
zebra/zapi_msg.c | 4 ++++
|
||||
zebra/zebra_dplane.c | 1 +
|
||||
zebra/zebra_fpm_netlink.c | 20 ++++++++++++++++++++
|
||||
6 files changed, 34 insertions(+), 1 deletion(-)
|
||||
lib/nexthop.c | 1 +
|
||||
lib/nexthop.h | 7 ++++++-
|
||||
zebra/rt_netlink.c | 15 ++++++++++++++-
|
||||
zebra/zapi_msg.c | 4 ++++
|
||||
zebra/zebra_dplane.c | 2 +-
|
||||
5 files changed, 26 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/nexthop.c b/lib/nexthop.c
|
||||
index a1ce22e3b..6f3fe2a5f 100644
|
||||
index a1ce22e3b..10a87f072 100644
|
||||
--- a/lib/nexthop.c
|
||||
+++ b/lib/nexthop.c
|
||||
@@ -813,6 +813,8 @@ void nexthop_copy_no_recurse(struct nexthop *copy,
|
||||
@@ -813,6 +813,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy,
|
||||
memcpy(©->src, &nexthop->src, sizeof(nexthop->src));
|
||||
memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src));
|
||||
copy->rparent = rparent;
|
||||
+ memcpy(©->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 320b46315..0f98dc3c2 100644
|
||||
index 320b46315..77eea3674 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;
|
||||
@ -42,27 +43,50 @@ index 320b46315..0f98dc3c2 100644
|
||||
/* Nexthop structure. */
|
||||
struct nexthop {
|
||||
struct nexthop *next;
|
||||
@@ -136,6 +141,7 @@ struct nexthop {
|
||||
@@ -135,7 +140,7 @@ struct nexthop {
|
||||
/* Encapsulation information. */
|
||||
enum nh_encap_type nh_encap_type;
|
||||
union {
|
||||
vni_t vni;
|
||||
- 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 24c01b7f5..5e0f4cd8f 100644
|
||||
index 03c84d6dc..a56a95276 100644
|
||||
--- a/zebra/rt_netlink.c
|
||||
+++ b/zebra/rt_netlink.c
|
||||
@@ -1856,7 +1856,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen,
|
||||
@@ -1869,6 +1869,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:
|
||||
@@ -1879,9 +1880,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))
|
||||
+ nh->nh_encap.encap_data.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 5cf7d815d..529cbb44b 100644
|
||||
--- a/zebra/zapi_msg.c
|
||||
@ -86,80 +110,18 @@ index 5cf7d815d..529cbb44b 100644
|
||||
api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p);
|
||||
}
|
||||
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
|
||||
index 656ebcf3b..8d125d77e 100644
|
||||
index 656ebcf3b..bd59df189 100644
|
||||
--- a/zebra/zebra_dplane.c
|
||||
+++ b/zebra/zebra_dplane.c
|
||||
@@ -2421,6 +2421,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
|
||||
@@ -2420,7 +2420,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.vni = zl3vni->vni;
|
||||
+ nexthop->nh_encap.encap_data.vni = zl3vni->vni;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
|
||||
index aad0156b3..34be9fb39 100644
|
||||
--- a/zebra/zebra_fpm_netlink.c
|
||||
+++ b/zebra/zebra_fpm_netlink.c
|
||||
@@ -95,10 +95,12 @@ static const char *fpm_nh_encap_type_to_str(enum fpm_nh_encap_type_t encap_type)
|
||||
|
||||
struct vxlan_encap_info_t {
|
||||
vni_t vni;
|
||||
+ struct ethaddr rmac;
|
||||
};
|
||||
|
||||
enum vxlan_encap_info_type_t {
|
||||
VXLAN_VNI = 0,
|
||||
+ VXLAN_RMAC = 1,
|
||||
};
|
||||
|
||||
struct fpm_nh_encap_info_t {
|
||||
@@ -234,6 +236,9 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri,
|
||||
}
|
||||
|
||||
nhi.encap_info.vxlan_encap.vni = vni;
|
||||
+ memcpy(&nhi.encap_info.vxlan_encap.rmac,
|
||||
+ &(nexthop->nh_encap.encap_data.rmac),
|
||||
+ ETH_ALEN);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -456,9 +461,16 @@ static int netlink_route_info_encode(struct netlink_route_info *ri,
|
||||
nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE,
|
||||
encap);
|
||||
vxlan = &nhi->encap_info.vxlan_encap;
|
||||
+ char buf[ETHER_ADDR_STRLEN];
|
||||
+
|
||||
+ zfpm_debug(
|
||||
+ "%s: VNI:%d RMAC:%s", __func__, vxlan->vni,
|
||||
+ prefix_mac2str(&vxlan->rmac, buf, sizeof(buf)));
|
||||
nest = nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP);
|
||||
nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI,
|
||||
vxlan->vni);
|
||||
+ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC,
|
||||
+ &vxlan->rmac, sizeof(vxlan->rmac));
|
||||
nl_attr_nest_end(&req->n, nest);
|
||||
break;
|
||||
}
|
||||
@@ -494,10 +506,18 @@ static int netlink_route_info_encode(struct netlink_route_info *ri,
|
||||
nl_attr_put16(&req->n, in_buf_len, RTA_ENCAP_TYPE,
|
||||
encap);
|
||||
vxlan = &nhi->encap_info.vxlan_encap;
|
||||
+ char rmac_buf[ETHER_ADDR_STRLEN];
|
||||
+
|
||||
+ zfpm_debug("%s: Multi VNI:%d RMAC:%s", __func__,
|
||||
+ vxlan->vni,
|
||||
+ prefix_mac2str(&vxlan->rmac, rmac_buf,
|
||||
+ sizeof(rmac_buf)));
|
||||
inner_nest =
|
||||
nl_attr_nest(&req->n, in_buf_len, RTA_ENCAP);
|
||||
nl_attr_put32(&req->n, in_buf_len, VXLAN_VNI,
|
||||
vxlan->vni);
|
||||
+ nl_attr_put(&req->n, in_buf_len, VXLAN_RMAC,
|
||||
+ &vxlan->rmac, sizeof(vxlan->rmac));
|
||||
nl_attr_nest_end(&req->n, inner_nest);
|
||||
break;
|
||||
}
|
||||
--
|
||||
2.12.2
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
@ -1,54 +1,32 @@
|
||||
commit 8b78a43ba243df281f2096a84893ad87cb2a79ff
|
||||
Author: Stephen Xu <stexu@linkedin.com>
|
||||
Date: Wed Nov 16 16:07:37 2022 -0500
|
||||
From ca66350aecf7db3354019480d11754fabae3a97c Mon Sep 17 00:00:00 2001
|
||||
From: Stepan Blyschak <stepanb@nvidia.com>
|
||||
Date: Thu, 20 Oct 2022 13:07:18 +0000
|
||||
Subject: [PATCH 09/13] ignore route from default table
|
||||
|
||||
[PATCH] ignore route from default table
|
||||
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
|
||||
---
|
||||
zebra/dplane_fpm_nl.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
Signed-off-by: Stephen Xu <stexu@linkedin.com>
|
||||
diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c
|
||||
index 3b02128c9..da8504adf 100644
|
||||
--- a/zebra/dplane_fpm_nl.c
|
||||
+++ b/zebra/dplane_fpm_nl.c
|
||||
@@ -699,6 +699,15 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
|
||||
|| op == DPLANE_OP_NH_UPDATE))
|
||||
return 0;
|
||||
|
||||
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
|
||||
index 43958fdfd..de7e246d4 100644
|
||||
--- a/zebra/zebra_fpm.c
|
||||
+++ b/zebra/zebra_fpm.c
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "libfrr.h"
|
||||
+#include "rib.h"
|
||||
#include "stream.h"
|
||||
#include "thread.h"
|
||||
#include "network.h"
|
||||
@@ -1016,8 +1017,15 @@ static int zfpm_build_route_updates(void)
|
||||
else
|
||||
zfpm_g->stats.route_dels++;
|
||||
} else {
|
||||
- zlog_err("%s: Encoding Prefix: %pRN No valid nexthops",
|
||||
- __func__, dest->rnode);
|
||||
+ struct rib_table_info *table_info =
|
||||
+ rib_table_info(rib_dest_table(dest));
|
||||
+ if (table_info && table_info->table_id == RT_TABLE_DEFAULT) {
|
||||
+ zfpm_debug("%s: Skip encoding default table prefix: %pRN",
|
||||
+ __func__, dest->rnode);
|
||||
+ } else {
|
||||
+ zlog_err("%s: Encoding Prefix: %pRN No valid nexthops",
|
||||
+ __func__, dest->rnode);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
|
||||
index ec22c5dd4..53e5f59fb 100644
|
||||
--- a/zebra/zebra_fpm_netlink.c
|
||||
+++ b/zebra/zebra_fpm_netlink.c
|
||||
@@ -278,6 +278,11 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
|
||||
rib_table_info(rib_dest_table(dest));
|
||||
struct zebra_vrf *zvrf = table_info->zvrf;
|
||||
|
||||
+ if (table_info->table_id == RT_TABLE_DEFAULT) {
|
||||
+ zfpm_debug("%s: Discard default table route", __func__);
|
||||
+ 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;
|
||||
+ }
|
||||
+
|
||||
memset(ri, 0, sizeof(*ri));
|
||||
|
||||
ri->prefix = rib_dest_prefix(dest);
|
||||
nl_buf_len = 0;
|
||||
|
||||
frr_mutex_lock_autounlock(&fnc->obuf_mutex);
|
||||
--
|
||||
2.30.2
|
||||
|
@ -0,0 +1,62 @@
|
||||
From 551fa8c3549e24020dfce33d06ade4a14f72abfe Mon Sep 17 00:00:00 2001
|
||||
From: Donald Sharp <sharpd@nvidia.com>
|
||||
Date: Mon, 14 Nov 2022 08:28:45 -0500
|
||||
Subject: [PATCH] zebra: Fix dplane_fpm_nl to allow for fast configuration
|
||||
|
||||
If you have this order in your configuration file:
|
||||
|
||||
no fpm use-next-hop-groups
|
||||
fpm address 127.0.0.1
|
||||
|
||||
the dplane code was using the same event thread t_event and the second
|
||||
add event in the code was going, you already have an event scheduled
|
||||
and as such the second event does not overwrite it. Leaving
|
||||
no code to actually start the whole processing. There are probably
|
||||
other cli iterations that will cause this fun as well, but I'm
|
||||
not going to spend the time sussing them out at the moment.
|
||||
|
||||
Fixes: #12314
|
||||
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
|
||||
---
|
||||
zebra/dplane_fpm_nl.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c
|
||||
index 7383c982baa..c5e1c113cb0 100644
|
||||
--- a/zebra/dplane_fpm_nl.c
|
||||
+++ b/zebra/dplane_fpm_nl.c
|
||||
@@ -98,6 +98,7 @@ struct fpm_nl_ctx {
|
||||
struct thread *t_read;
|
||||
struct thread *t_write;
|
||||
struct thread *t_event;
|
||||
+ struct thread *t_nhg;
|
||||
struct thread *t_dequeue;
|
||||
|
||||
/* zebra events. */
|
||||
@@ -271,7 +272,7 @@ DEFUN(fpm_use_nhg, fpm_use_nhg_cmd,
|
||||
return CMD_SUCCESS;
|
||||
|
||||
thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
|
||||
- FNE_TOGGLE_NHG, &gfnc->t_event);
|
||||
+ FNE_TOGGLE_NHG, &gfnc->t_nhg);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@@ -287,7 +288,7 @@ DEFUN(no_fpm_use_nhg, no_fpm_use_nhg_cmd,
|
||||
return CMD_SUCCESS;
|
||||
|
||||
thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
|
||||
- FNE_TOGGLE_NHG, &gfnc->t_event);
|
||||
+ FNE_TOGGLE_NHG, &gfnc->t_nhg);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@@ -1367,6 +1368,8 @@ static int fpm_nl_finish_early(struct fpm_nl_ctx *fnc)
|
||||
THREAD_OFF(fnc->t_ribwalk);
|
||||
THREAD_OFF(fnc->t_rmacreset);
|
||||
THREAD_OFF(fnc->t_rmacwalk);
|
||||
+ THREAD_OFF(fnc->t_event);
|
||||
+ THREAD_OFF(fnc->t_nhg);
|
||||
thread_cancel_async(fnc->fthread->master, &fnc->t_read, NULL);
|
||||
thread_cancel_async(fnc->fthread->master, &fnc->t_write, NULL);
|
||||
thread_cancel_async(fnc->fthread->master, &fnc->t_connect, NULL);
|
@ -12,3 +12,4 @@ cross-compile-changes.patch
|
||||
0010-zebra-Note-when-the-netlink-DUMP-command-is-interrup.patch
|
||||
0011-bgpd-enhanced-capability-is-always-turned-on-for-int.patch
|
||||
0012-Ensure-ospf_apiclient_lsa_originate-cannot-accidently-write-into-stack.patch
|
||||
0013-zebra-fix-dplane-fpm-nl-to-allow-for-fast-configuration.patch
|
||||
|
Loading…
Reference in New Issue
Block a user