-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[FRR] Switch to dplane_fpm_nl plugin instead of fpm #12852
Changes from all commits
ae44caf
112797f
3079089
ad59c4f
8b4db68
0880950
58026cc
226c7ab
0b88bd1
c99ca4a
3ceb01d
15671f0
57e85e5
0328b2e
4cbb06b
d94304f
902b654
fc57184
995e00f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the behavior if the user has split mode and performs an upgrade? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fpmsyncd will get RTN_NEWROUTE without next hops and routes won't be programmed. User needs to update his own configs |
||
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" %} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
no fpm use-next-hop-groups | ||
|
||
fpm address 127.0.0.1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to the comment by @dgsudharsan #12852 (comment).
SONiC supports split mode FRR configuration. That is, user provides own zebra.conf, bgp.conf, etc. in /etc/sonic/frr folder, instead of generated from templates by SONiC.
In case user upgrades from older version to image with these changes he will not have mandatory configuration in his zebra.conf copied from the old image. I added this line to insert this configuration in case user does not have it.