]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: refactor label allocation code
authorPat Ruddy <pat@voltanet.io>
Thu, 17 Dec 2020 10:41:07 +0000 (10:41 +0000)
committerPat Ruddy <pat@voltanet.io>
Mon, 4 Jan 2021 14:29:44 +0000 (14:29 +0000)
commit992dd67ec76de375b967b408c26f9c9f9e0608c5
treebeb593cd4aea8b15d6fbbab0cf0fcd76ca20ee09
parent189982283ad88132fbdb1342895c7404fa5fc34a
bgpd: refactor label allocation code

To prepare for fixing an issue where labels do not get released back
to the labelpool when the route is deleted some refactoring is
necessary. There are 2 parts to this.
1. restructure the code to remove the circular nature of label
allocations via the labelpool and decouple the label type decision
from the notification fo the FEC.
The code to notify the FEC association to zebra has been split out
into a separate function so that it can be called from the synchronous
path (for registration of index-based labels and de-registration of all
labels), and from the asynchronous path where we need to wait for a
callback from the labelpool code with a label allocation.
The decision about whether we are using an index-based label or an
allocated label is reflected in the state of the BGP_NODE_LABEL_REQUESTED
flag so the checks on the path_info in the labelpool callback code are
no longer required.
2. change the owned of a labelpool allocated label from the path info
structure to the bgp_dest structure. This allows labels to be released
(in a subsequent commit) when the owner (bgp_dest) goes away.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
bgpd/bgp_label.c
bgpd/bgp_labelpool.c
bgpd/bgp_route.c
bgpd/bgp_table.h