From 5b6ff85402154bc2437d7646c7a23585237de23b Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:18:38 +0530 Subject: [PATCH] [FRR Patch] Added patch in FRR to send tag value associated with route via Netlink to fpmsyncd (#20692) * Added patch in FRR to send tag value associated with route via NETLINK RTA_PRIORITY field which can be used as attribute/metadata in fpmsyncd for different use-cases. --------- Signed-off-by: Abhishek Dosi --- ...g-value-associated-with-route-via-ne.patch | 49 +++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 50 insertions(+) create mode 100644 src/sonic-frr/patch/0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch diff --git a/src/sonic-frr/patch/0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch b/src/sonic-frr/patch/0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch new file mode 100644 index 000000000000..606f1ff3f38f --- /dev/null +++ b/src/sonic-frr/patch/0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch @@ -0,0 +1,49 @@ +From c0418c02dabe901f5dc39c85ce2e80bd361d7c78 Mon Sep 17 00:00:00 2001 +From: Abhishek Dosi +Date: Wed, 11 Dec 2024 11:19:05 +0000 +Subject: [PATCH] Patch to send tag value associated with route via netlink in + RTA_PRIORITY field. + +Signed-off-by: Abhishek Dosi +--- + zebra/rt_netlink.c | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index 976c245c3..1f73f5759 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -2348,10 +2348,28 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx + * path(s) + * by the routing protocol and for communicating with protocol peers. + */ +- if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY, +- ROUTE_INSTALLATION_METRIC)) ++ if (fpm) ++ { ++ /* Patch to send tag value as route attribute using RTA_PRIORITY ++ * which can be used as metadata/attribute to take application specific ++ * action. As seen in above comment this field is not use anyways and can be ++ * use by fpmsyncd */ ++ if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY, ++ cmd == RTM_DELROUTE ? dplane_ctx_get_old_tag(ctx) : ++ dplane_ctx_get_tag(ctx))) ++ { + return 0; + ++ } ++ } ++ else ++ { ++ if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY, ++ ROUTE_INSTALLATION_METRIC)) ++ { ++ return 0; ++ } ++ } + #if defined(SUPPORT_REALMS) + if (cmd == RTM_DELROUTE) + tag = dplane_ctx_get_old_tag(ctx); +-- +2.25.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index 86ec826af8c0..3c68abe241e8 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -42,3 +42,4 @@ 0060-bgpd-Validate-both-nexthop-information-NEXTHOP-and-N.patch 0061-Set-multipath-to-514-and-disable-bgp-vnc-for-optimiz.patch 0062-zebra-lib-use-internal-rbtree-per-ns.patch +0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch