Skip to content

Commit

Permalink
upgrade FRR to version 10.0.1, upgrade libyang2 to 2.1.148. Tested us…
Browse files Browse the repository at this point in the history
…ing basic BGP neighborship formation with routes using BGP docker
  • Loading branch information
sudhanshukumar22 committed Sep 17, 2024
1 parent dfa5002 commit 8b65364
Show file tree
Hide file tree
Showing 19 changed files with 1,828 additions and 1,042 deletions.
6 changes: 3 additions & 3 deletions rules/frr.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# FRRouting (frr) package

FRR_VERSION = 8.5.4
FRR_VERSION = 10.0.1
FRR_SUBVERSION = 0
FRR_BRANCH = frr/8.5
FRR_TAG = frr-8.5.4
FRR_BRANCH = frr/10.0.1
FRR_TAG = frr-10.0.1
export FRR_VERSION FRR_SUBVERSION FRR_BRANCH FRR_TAG


Expand Down
10 changes: 5 additions & 5 deletions rules/libyang2.mk
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# libyang2

LIBYANG2_VERSION_BASE = 2.0
LIBYANG2_VERSION = $(LIBYANG2_VERSION_BASE).112
LIBYANG2_SUBVERSION = 6
LIBYANG2_VERSION_BASE = 2.1
LIBYANG2_VERSION = $(LIBYANG2_VERSION_BASE).148
LIBYANG2_SUBVERSION = 0.1
LIBYANG2_FULLVERSION = $(LIBYANG2_VERSION)-$(LIBYANG2_SUBVERSION)

export LIBYANG2_VERSION_BASE
export LIBYANG2_VERSION
export LIBYANG2_SUBVERSION
export LIBYANG2_FULLVERSION

LIBYANG2 = libyang2_$(LIBYANG2_FULLVERSION)_$(CONFIGURED_ARCH).deb
LIBYANG2 = libyang2t64_$(LIBYANG2_FULLVERSION)_$(CONFIGURED_ARCH).deb
$(LIBYANG2)_SRC_PATH = $(SRC_PATH)/libyang2
SONIC_MAKE_DEBS += $(LIBYANG2)

LIBYANG2_DEV = libyang2-dev_$(LIBYANG2_FULLVERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBYANG2),$(LIBYANG2_DEV)))

LIBYANG2_DBG = libyang2-dbgsym_$(LIBYANG2_FULLVERSION)_$(CONFIGURED_ARCH).deb
LIBYANG2_DBG = libyang2t64-dbgsym_$(LIBYANG2_FULLVERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBYANG2),$(LIBYANG2_DBG)))


Expand Down
4 changes: 3 additions & 1 deletion sonic-slave-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install
libjson-c-dev \
libsystemd-dev \
libcmocka-dev \
libprotobuf-c-dev \
protobuf-c-compiler \
#{%- if CROSS_BUILD_ENVIRON != "y" %}
python3-all-dev \
python3-all-dbg \
Expand Down Expand Up @@ -750,4 +752,4 @@ RUN mkdir -p /.cargo && $RUST_ROOT/bin/rustup target add armv7-unknown-linux-gnu
RUN mkdir -p /.cargo && $RUST_ROOT/bin/rustup target add aarch64-unknown-linux-gnu && echo "[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" >> /.cargo/config.toml
{% endif -%}
ENV RUSTUP_HOME $RUST_ROOT
ENV PATH $PATH:$RUST_ROOT/bin
ENV PATH $PATH:$RUST_ROOT/bin
2 changes: 2 additions & 0 deletions sonic-slave-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install
libsystemd-dev \
python3-ipaddr \
libcmocka-dev \
libprotobuf-c-dev \
protobuf-c-compiler \
#{%- if CROSS_BUILD_ENVIRON != "y" %}
python3-all-dev \
python3-all-dbg \
Expand Down
7 changes: 5 additions & 2 deletions src/libyang2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

LIBYANG_URL = https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang
LIBYANG_URL = https://deb.debian.org/debian/pool/main/liby/libyang2

DSC_FILE = libyang2_$(LIBYANG2_FULLVERSION).dsc
ORIG_FILE = libyang2_$(LIBYANG2_VERSION).orig.tar.gz
ORIG_FILE = libyang2_$(LIBYANG2_VERSION).orig.tar.xz
DEBIAN_FILE = libyang2_$(LIBYANG2_FULLVERSION).debian.tar.xz

DSC_FILE_URL = $(LIBYANG_URL)/$(DSC_FILE)
Expand All @@ -26,6 +26,9 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
dpkg-source -x libyang2_$(LIBYANG2_FULLVERSION).dsc

pushd libyang2-$(LIBYANG2_VERSION)
#The package libyang2.1.148 is taken from debian trixie, which only has dpkg-dev version 1.21.22
#The bullseye package has dpkg-dev version 1.20.13
sed -i 's/dpkg-dev (>= 1.22.5)/dpkg-dev (>= 1.20.13)/' debian/control
#sed -i 's/set(LIBYANG_MAJOR_SOVERSION 1)/set(LIBYANG_MAJOR_SOVERSION 2)/' CMakeLists.txt
#sed -i 's/libyang2/libyang2/' debian/libyang2.install
# Enable large file support for 32-bit arch
Expand Down
30 changes: 11 additions & 19 deletions src/sonic-frr/patch/0008-Use-vrf_id-for-vrf-not-tabled_id.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
From 44f3736ee601e06e43e978fa075402c3da4823bd Mon Sep 17 00:00:00 2001
From: Stepan Blyschak <stepanb@nvidia.com>
Date: Mon, 16 Jan 2023 11:45:19 +0000
Subject: [PATCH] From 349e3f758860be0077b69919c39764d3486ec44a Mon Sep 17
00:00:00 2001 Subject: [PATCH] use vrf id instead of table id

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>

diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 325199eff..587045eac 100644
index b8d097e58..b81a9db6d 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -406,6 +406,30 @@ vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
return VRF_DEFAULT;
@@ -385,6 +385,31 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop)
return proto;
}

+static uint32_t table_lookup_by_vrf(vrf_id_t vrf_id, ns_id_t ns_id)
Expand All @@ -37,11 +29,12 @@ index 325199eff..587045eac 100644
+
+ return RT_TABLE_UNSPEC;
+}
+
+
/**
* @parse_encap_mpls() - Parses encapsulated mpls attributes
* @tb: Pointer to rtattr to look for nested items in.
@@ -782,14 +806,26 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h,
@@ -817,14 +842,26 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h,
if (rtm->rtm_family == AF_MPLS)
return 0;

Expand All @@ -58,7 +51,7 @@ index 325199eff..587045eac 100644
+ table = rtm->rtm_table;
+
+ /* Map to VRF */
+ vrf_id = vrf_lookup_by_table(table, ns_id);
+ vrf_id = zebra_vrf_lookup_by_table(table, ns_id);
+ } else {
+ /* With FPM, rtm_table contains vrf id, see netlink_route_multipath_msg_encode */
+ if (tb[RTA_TABLE])
Expand All @@ -71,11 +64,11 @@ index 325199eff..587045eac 100644
+ }

- /* Map to VRF */
- vrf_id = vrf_lookup_by_table(table, ns_id);
- vrf_id = zebra_vrf_lookup_by_table(table, ns_id);
if (vrf_id == VRF_DEFAULT) {
if (!is_zebra_valid_kernel_table(table)
&& !is_zebra_main_routing_table(table))
@@ -2102,12 +2138,24 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
@@ -2283,13 +2320,25 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx

/* Table corresponding to this route. */
table_id = dplane_ctx_get_table(ctx);
Expand All @@ -85,6 +78,7 @@ index 325199eff..587045eac 100644
- 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;
Expand All @@ -103,9 +97,7 @@ index 325199eff..587045eac 100644
+ if (!nl_attr_put32(&req->n, datalen, RTA_TABLE, vrf))
+ return 0;
+ }
}
+ }

if (IS_ZEBRA_DEBUG_KERNEL)
--
2.17.1

zlog_debug(
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
From a05f213343ee7ee5dbfcfd1984c40db5c262db3c Mon Sep 17 00:00:00 2001
From: stormliang <stormliang@microsoft.com>
Date: Mon, 19 Jun 2023 13:57:01 +0000
Subject: [PATCH] From c423bce4db804c1d07d65ce3d06a9e62c4eceb2b Mon Sep 17
00:00:00 2001 Subject: [PATCH] change log level for graceful restart events


diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 9624adfbe..74b4dfc4a 100644
index 504343994..f58ab7c02 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -778,10 +778,10 @@ static void bgp_graceful_restart_timer_expire(struct thread *thread)

peer = THREAD_ARG(thread);
@@ -739,9 +739,9 @@ static void bgp_graceful_restart_timer_expire(struct event *thread)
afi_t afi;
safi_t safi;

- if (bgp_debug_neighbor_events(peer)) {
- zlog_debug("%pBP graceful restart timer expired", peer);
- zlog_debug("%pBP graceful restart stalepath timer stopped",
- peer);
+ if (peer) {
+ zlog_info("%pBP graceful restart timer expired", peer);
+ zlog_info("%pBP graceful restart stalepath timer stopped",
+ peer);
peer);
}

FOREACH_AFI_SAFI (afi, safi) {
@@ -842,8 +842,8 @@ static void bgp_graceful_stale_timer_expire(struct thread *thread)

peer = THREAD_ARG(thread);
@@ -801,8 +801,8 @@ static void bgp_graceful_stale_timer_expire(struct event *thread)
afi_t afi;
safi_t safi;

- if (bgp_debug_neighbor_events(peer))
- zlog_debug("%pBP graceful restart stalepath timer expired",
Expand All @@ -35,17 +26,15 @@ index 9624adfbe..74b4dfc4a 100644
peer);

/* NSF delete stale route */
@@ -1412,20 +1412,17 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer)
@@ -1380,20 +1380,17 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection)
/* graceful restart */
if (peer->t_gr_stale) {
THREAD_OFF(peer->t_gr_stale);
if (connection->t_gr_stale) {
EVENT_OFF(connection->t_gr_stale);
- if (bgp_debug_neighbor_events(peer))
- zlog_debug(
- "%pBP graceful restart stalepath timer stopped",
- peer);
+ zlog_info(
+ "%pBP graceful restart stalepath timer stopped",
+ peer);
+ zlog_info(
"%pBP graceful restart stalepath timer stopped",
peer);
}
if (CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT)) {
- if (bgp_debug_neighbor_events(peer)) {
Expand All @@ -62,55 +51,46 @@ index 9624adfbe..74b4dfc4a 100644
+ zlog_info(
+ "%pBP graceful restart stalepath timer started for %d sec",
+ peer, peer->bgp->stalepath_time);
BGP_TIMER_ON(peer->t_gr_restart,
BGP_TIMER_ON(connection->t_gr_restart,
bgp_graceful_restart_timer_expire,
peer->v_gr_restart);
@@ -2225,17 +2222,15 @@ static enum bgp_fsm_state_progress bgp_establish(struct peer *peer)
@@ -2216,8 +2213,7 @@ bgp_establish(struct peer_connection *connection)
UNSET_FLAG(peer->sflags, PEER_STATUS_NSF_MODE);
if (peer->t_gr_stale) {
THREAD_OFF(peer->t_gr_stale);
if (connection->t_gr_stale) {
EVENT_OFF(connection->t_gr_stale);
- if (bgp_debug_neighbor_events(peer))
- zlog_debug(
- "%pBP graceful restart stalepath timer stopped",
- peer);
+ zlog_info(
+ "%pBP graceful restart stalepath timer stopped",
+ peer);
"%pBP graceful restart stalepath timer stopped",
peer);
}
}
@@ -2225,8 +2221,7 @@ bgp_establish(struct peer_connection *connection)

if (peer->t_gr_restart) {
THREAD_OFF(peer->t_gr_restart);
if (connection->t_gr_restart) {
EVENT_OFF(connection->t_gr_restart);
- if (bgp_debug_neighbor_events(peer))
- zlog_debug("%pBP graceful restart timer stopped", peer);
+ zlog_info("%pBP graceful restart timer stopped", peer);
}

/* Reset uptime, turn on keepalives, send current table. */
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 8b3a1e3dd..2f3b837a5 100644
index d6d874be2..337879a2d 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2453,15 +2453,13 @@ void peer_nsf_stop(struct peer *peer)
@@ -2629,13 +2629,11 @@ void peer_nsf_stop(struct peer *peer)

if (peer->t_gr_restart) {
THREAD_OFF(peer->t_gr_restart);
if (peer->connection->t_gr_restart) {
EVENT_OFF(peer->connection->t_gr_restart);
- if (bgp_debug_neighbor_events(peer))
- zlog_debug("%pBP graceful restart timer stopped", peer);
+ zlog_info("%pBP graceful restart timer stopped", peer);
}
if (peer->t_gr_stale) {
THREAD_OFF(peer->t_gr_stale);
if (peer->connection->t_gr_stale) {
EVENT_OFF(peer->connection->t_gr_stale);
- if (bgp_debug_neighbor_events(peer))
- zlog_debug(
- "%pBP graceful restart stalepath timer stopped",
- peer);
+ zlog_info(
+ "%pBP graceful restart stalepath timer stopped",
+ peer);
"%pBP graceful restart stalepath timer stopped",
peer);
}
bgp_clear_route_all(peer);
}
--
2.17.1

Loading

0 comments on commit 8b65364

Please sign in to comment.