]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: allocate label bound to received mpls vpn routes
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 11 May 2023 11:56:16 +0000 (13:56 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 16 Jun 2023 08:54:58 +0000 (10:54 +0200)
commit1069425868d108bd6e582f6b67a78a1d9ac4bd85
treeaee07885b7faa1c1ed29666d4cc4fa5babfd2754
parent28d5c6e531b685725ee4c6fec90813041bfb2bc3
bgpd: allocate label bound to received mpls vpn routes

Current implementation does not offer a new label to bind
to a received VPN route entry to redistribute with that new
label.

This commit allocates a label for VPN entries that have
a valid label, and a reachable next-hop interface that is
configured as follows:

> interface eth0
>  mpls bgp l3vpn-multi-domain-switching
> exit

An mplsvpn next-hop label binding entry is created in an mpls
vpn nexthop label bind hash table of the current BGP instance.
That mpls vpn next-hop label entry is indexed by the (next-hop,
orig_label) values provided by the incoming updates, and shared
with other updates having the same (next-hop, orig_label) values.

A new 'LP_TYPE_BGP_L3VPN_BIND' label value is picked up from the
zebra mpls label pool, and assigned to the new_label attribute.

The 'bgp_path_info' appends a 'bgp_mplsvpn_nh_label_bind' structure
to the 'mplsvpn' union structure. Both structures in the union are not
used at the same, as the paths are either VRF updates to export, or MPLS
VPN updates. Using an union gives a 24 bytes memory gain compared to if
the structures had not been in an union (24 bytes compared to 48 bytes).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_mplsvpn.c
bgpd/bgp_mplsvpn.h
bgpd/bgp_nexthop.c
bgpd/bgp_nht.c
bgpd/bgp_route.c
bgpd/bgp_route.h
bgpd/bgpd.c