From 32fd89b608a78cc1810fa666f06575483fa86975 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 15 Feb 2022 08:28:19 +0000 Subject: fib: Use the same adjacency that BFD is using Type: improvement When the adj subsystem is notified of a BFD session, it attempts to find the appropriate adjacency from the session's key. This could lead to a mismatch between the adj used by BFD and that of FIB. The BFD session stores the adj it is using, so FIB uses that instead. Since adj is now using the same adj as BFD, it does not need to maintain its own locks. In BFD it is necessary to initialise the adj index used in INVALID and ensure it is not unlock before listeners are notified of the session delete. Signed-off-by: Neale Ranns Change-Id: I9630867b10bb18969475299a0c754942a8df0f44 --- src/plugins/unittest/fib_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/unittest/fib_test.c') diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c index cc9a572b5ce..57ab29e1f72 100644 --- a/src/plugins/unittest/fib_test.c +++ b/src/plugins/unittest/fib_test.c @@ -8408,12 +8408,14 @@ fib_test_bfd (void) bfd_10_10_10_1.hop_type = BFD_HOP_TYPE_SINGLE; bfd_10_10_10_1.udp.key.sw_if_index = tm->hw[0]->sw_if_index; - adj_bfd_notify(BFD_LISTEN_EVENT_CREATE, &bfd_10_10_10_1); - ai_10_10_10_1 = adj_nbr_add_or_lock(FIB_PROTOCOL_IP4, VNET_LINK_IP4, &nh_10_10_10_1, tm->hw[0]->sw_if_index); + bfd_10_10_10_1.udp.adj_index = ai_10_10_10_1; + + adj_bfd_notify(BFD_LISTEN_EVENT_CREATE, &bfd_10_10_10_1); + /* * whilst the BFD session is not signalled, the adj is up */ -- cgit 1.2.3-korg