]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: add LP_TYPE_BGP_L3VPN_BIND label type
authorLouis Scalbert <louis.scalbert@6wind.com>
Tue, 2 May 2023 14:30:20 +0000 (16:30 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 16 Jun 2023 08:54:58 +0000 (10:54 +0200)
Redistributing mpls vpn prefixes with a new label
requires picking up unused MPLS local labels.

Today, there is an MPLS label pool which is owned
by the zebra daemon. BGP gets a chunk of labels
that are shared with the multiple usage of the BGP
daemon. A label type attribute is used whenever
BGP needs a new label value.

The 'LP_TYPE_BGP_L3VPN_BIND' label type will be used
to allocate the MPLS labels that will be bound to
the original next-hop, and label value of an L3VPN
update.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_labelpool.c
bgpd/bgp_labelpool.h

index faddfc995f3ef7e894aed2bcb4aae64922faa09f..91763b85a0d598098fbe2831a15275ec6745d656 100644 (file)
@@ -843,6 +843,16 @@ DEFUN(show_bgp_labelpool_ledger, show_bgp_labelpool_ledger_cmd,
                                vty_out(vty, "%-18s         %u\n", "nexthop",
                                        lcb->label);
                        break;
+               case LP_TYPE_BGP_L3VPN_BIND:
+                       if (uj) {
+                               json_object_string_add(json_elem, "prefix",
+                                                      "l3vpn-bind");
+                               json_object_int_add(json_elem, "label",
+                                                   lcb->label);
+                       } else
+                               vty_out(vty, "%-18s         %u\n", "l3vpn-bind",
+                                       lcb->label);
+                       break;
                }
        }
        if (uj)
@@ -941,6 +951,15 @@ DEFUN(show_bgp_labelpool_inuse, show_bgp_labelpool_inuse_cmd,
                                vty_out(vty, "%-18s         %u\n", "nexthop",
                                        label);
                        break;
+               case LP_TYPE_BGP_L3VPN_BIND:
+                       if (uj) {
+                               json_object_string_add(json_elem, "prefix",
+                                                      "l3vpn-bind");
+                               json_object_int_add(json_elem, "label", label);
+                       } else
+                               vty_out(vty, "%-18s         %u\n", "l3vpn-bind",
+                                       label);
+                       break;
                }
        }
        if (uj)
@@ -1020,6 +1039,13 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,
                        else
                                vty_out(vty, "Nexthop\n");
                        break;
+               case LP_TYPE_BGP_L3VPN_BIND:
+                       if (uj)
+                               json_object_string_add(json_elem, "prefix",
+                                                      "l3vpn-bind");
+                       else
+                               vty_out(vty, "L3VPN-BIND\n");
+                       break;
                }
        }
        if (uj)
index b33527186e0a10b876494ec4a9db104a48352c36..9a110e6297e95f6f131ea4c4405fd3786dfd83a0 100644 (file)
@@ -18,6 +18,7 @@
 #define LP_TYPE_VRF    0x00000001
 #define LP_TYPE_BGP_LU 0x00000002
 #define LP_TYPE_NEXTHOP 0x00000003
+#define LP_TYPE_BGP_L3VPN_BIND 0x00000004
 
 PREDECL_LIST(lp_fifo);