Commit graph

93 commits

Author SHA1 Message Date
Mark Stapp 660cbf5651 bgpd: clean up variable-shadowing compiler warnings
Clean up -Wshadow warnings in bgp.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
Rajasekar Raja 0f2cb27310 bgpd: backpressure - Optimize EVPN L3VNI remote routes processing
Anytime BGP gets a L3 VNI ADD/DEL from zebra,
 - Walking the entire global routing table per L3VNI is very expensive.
 - The next read (say of another VNI ADD/DEL) from the socket does
   not proceed unless this walk is complete.

So for triggers where a bulk of L3VNI's are flapped, this results in
huge output buffer FIFO growth spiking up the memory in zebra since bgp
is slow/busy processing the first message.

To avoid this, idea is to hookup the BGP-VRF off the struct bgp_master
and maintain a struct bgp FIFO list which is processed later on, where
we walk a chunk of BGP-VRFs and do the remote route install/uninstall.

Ticket :#3864372

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-12-09 08:46:16 -08:00
Rajasekar Raja 07a80709c7 bgpd: backpressure - Optimize EVPN L2VNI remote routes processing
Anytime BGP gets a L2 VNI ADD from zebra,
 - Walking the entire global routing table per L2VNI is very expensive.
 - The next read (say of another VNI ADD) from the socket does
   not proceed unless this walk is complete.

So for triggers where a bulk of L2VNI's are flapped, this results in
huge output buffer FIFO growth spiking up the memory in zebra since bgp
is slow/busy processing the first message.

To avoid this, idea is to hookup the VPN off the bgp_master struct and
maintain a VPN FIFO list which is processed later on, where we walk a
chunk of VPNs and do the remote route install.

Note: So far in the L3 backpressure cases(#15524), we have considered
the fact that zebra is slow, and the buffer grows in the BGP.

However this is the reverse i.e. BGP is very busy processing the first
ZAPI message from zebra due to which the buffer grows huge in zebra
and memory spikes up.

Ticket :#3864372

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-12-09 08:46:16 -08:00
Carmine Scarpitta b0be30bbef bgpd: Add API to get/release SRv6 SIDs
Add an API to get/release SRv6 SIDs through the SRv6 SID Manager.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-05 10:59:59 +02:00
Carmine Scarpitta c50b4b9afc bgpd: Add API to get SRv6 locator info
Add an API to request information from the SRv6 SID Manager (zebra)
regarding a specific SRv6 locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-05 10:59:59 +02:00
Louis Scalbert a6de910448 bgpd: store number of labels with 8 bits
8 bits are sufficient to store the number of labels because the current
maximum is 2.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-05 13:11:29 +02:00
Rajasekar Raja a07df6f754 bgpd : backpressure - Handle BGP-Zebra(EPVN) Install evt Creation
Current changes deals with EVPN routes installation to zebra.

In evpn_route_select_install() we invoke evpn_zebra_install/uninstall
which sends zclient_send_message().

This is a continuation of code changes (similar to
ccfe452763) but to handle evpn part
of the code.

Ticket: #3390099

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-04-08 10:51:43 -07:00
Donald Sharp ccfe452763 bgpd : backpressure - Handle BGP-Zebra Install evt Creation
BGP is now keeping a list of dests with the dest having a pointer
to the bgp_path_info that it will be working on.

1) When bgp receives a prefix, process it, add the bgp_dest of the
prefix into the new Fifo list if not present, update the flags (Ex:
earlier if the prefix was advertised and now it is a withdrawn),
increment the ref_count and DO NOT advertise the install/withdraw
to zebra yet.

2) Schedule an event to wake up to invoke the new function which will
walk the list one by one and installs/withdraws the routes into zebra.
  a) if BUFFER_EMPTY, process the next item on the list
  b) if BUFFER_PENDING, bail out and the callback in
  zclient_flush_data() will invoke the same function when BUFFER_EMPTY

Changes
 - rename old bgp_zebra_announce to bgp_zebra_announce_actual
 - rename old bgp_zebra_withdrw to bgp_zebra_withdraw_actual
 - Handle new fifo list cleanup in bgp_exit()
 - New funcs: bgp_handle_route_announcements_to_zebra() and
   bgp_zebra_route_install()
 - Define a callback function to invoke
   bgp_handle_route_announcements_to_zebra() when BUFFER_EMPTY in
   zclient_flush_data()

The current change deals with bgp installing routes via
bgp_process_main_one()

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-03-25 17:49:35 -07:00
Donald Sharp 5f379bebe8 bgpd: backpressure - cleanup bgp_zebra_XX func args
Since installing/withdrawing routes into zebra is going to be changed
around to be dest based in a list,
 - Retrieve the afi/safi to use based upon the dest's afi/safi
   instead of passing it in.
 - Prefix is known by the dest. Remove this arg as well

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-03-25 14:30:18 -07:00
Philippe Guibert ec6e09c271 bgpd: fix flushing ipv6 flowspec entries when peering stops
When a BGP flowspec peering stops, the BGP RIB entries for IPv6
flowspec entries are removed, but not the ZEBRA RIB IPv6 entries.

Actually, when calling bgp_zebra_withdraw() function call, only
the AFI_IP parameter is passed to the bgp_pbr_update_entry() function
in charge of the Flowspec add/delete in zebra. Fix this by passing
the AFI parameter to the bgp_zebra_withdraw() function.

Note that using topotest does not show up the problem as the
flowspec driver code is not present and was refused. Without that,
routes are not installed, and can not be uninstalled.

Fixes: 529efa2346 ("bgpd: allow flowspec entries to be announced to zebra")
Link: https://github.com/FRRouting/frr/pull/2025

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-02-07 23:01:25 +01:00
Philippe Guibert d162d5f6f5 bgpd: fix hardset l3vpn label available in mpls pool
Today, when configuring BGP L3VPN mpls, the operator may
use that command to hardset a label value:

> router bgp 65500 vrf vrf1
> address-family ipv4 unicast
> label vpn export <hardset_label_value>

Today, BGP uses this value without checks, leading to potential
conflicts with other control planes like LDP. For instance, if
LDP initiates with a label chunk of [16;72] and BGP also uses the
50 label value, a conflict arises.

The 'label manager' service in zebra oversees label allocations.
While all the control plane daemons use it, BGP doesn't when a
hardset label is in place.

This update fixes this problem. Now, when a hardset label is set for
l3vpn export, a request is made to the label manager for approval,
ensuring no conflicts with other daemons. But, this means some existing
BGP configurations might become non-operational if they conflict with
labels already allocated to another daemon but not used.

note: Labels below 16 are reserved and won't be checked for consistency
by the label manager.

Fixes: ddb5b4880b ("bgpd: vpn-vrf route leaking")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-18 09:41:02 +02:00
Philippe Guibert 82b11d8889 bgpd: fix redistribute table command after bgp restarts
When the BGP 'redistribute table' command is used for a given route
table, and BGP configuration is flushed and rebuilt, the redistribution
does not work.

Actually, when flushing the BGP configuration with the 'no router bgp'
command, the BGP redistribute entries related to the 'redistribute table'
entries are not flushed. Actually, at BGP deletion, the table number is
not given as parameter in bgp_redistribute_unset() function, and the
redistribution entry is not removed in zebra.
Fix this by adding some code to flush all the redistribute table
instances.

Fixes: 7c8ff89e93 ("Multi-Instance OSPF  Summary")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-08-29 11:37:18 +02:00
Valerian_He 98efa5bc6b bgpd: bgp_path_info_extra memory optimization
Even if some of the attributes in bgp_path_info_extra are
not used, their memory is still allocated every time. It
cause a waste of memory.
This commit code deletes all unnecessary attributes and
changes the optional attributes to pointer storage. Memory
will only be allocated when they are actually used. After
optimization, extra info related memory is reduced by about
half(~400B -> ~200B).

Signed-off-by: Valerian_He <1826906282@qq.com>
2023-08-08 10:48:07 +00:00
Donald Sharp 1e0b6a601e bgpd: Fix table manager to use the synchronous client
bgp_zebra_tm_connect calls bgp_zebra_get_table_range which
just used the global zclient.  Which of course still had
us exposing the global zclient to read and drop important
data from zebra.  This fixes commit 787c61e03c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 10:47:17 -04:00
Donatas Abraitis 0043ebab99 bgpd: Use synchronous way to get labels from Zebra
Both the label manager and table manager zapi code send data requests via zapi
to zebra and then immediately listen for a response from zebra. The problem here
is of course that the listen part is throwing away any zapi command that is not
the one it is looking for.

ISIS/OSPF and PIM all have synchronous abilities via zapi, which they all
do through a special zapi connection to zebra. BGP needs to follow this model
as well. Additionally the new zclient_sync connection that should be created,
a once a second timer should wake up and read any data on the socket to
prevent problems too much data accumulating in the socket.

```
r3# sh bgp labelpool summary
Labelpool Summary
-----------------
Ledger:       3
InUse:        3
Requests:     0
LabelChunks:  1
Pending:      128
Reconnects:   1
r3# sh bgp labelpool inuse
Prefix                Label
---------------------------
10.0.0.1/32           16
192.168.31.0/24       17
192.168.32.0/24       18
r3#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-20 20:50:10 +03:00
Philippe Guibert 27f4deed0a bgpd: update the mpls entry to handle return traffic
When advertising an mpls vpn entry with a new label,
the return traffic is redirected to the local machine,
but the MPLS traffic is dropped.

Add an MPLS entry to handle MPLS packets which have
the new label value. Traffic is swapped to the original
label value from the mpls vpn next-hop entry; then it is
sent to the resolved next-hop of the original next-hop
from the mpls vpn next-hop entry.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-06-16 10:54:58 +02:00
Philippe Guibert 1c6aa043ef bgpd: use nexthop interface when adding LSP in BGP MPLSVPN
BGP MPLSVPN next hop label allocation was using only the next-hop
IP address. As MPLSVPN contexts rely on bnc contexts, the real
nexthop interface is known, and the LSP entry to enter can apply
to the specific interface. To illustrate, the BGP service is able
to handle the following two iproute2 commands:

 > ip -f mpls route add 105 via inet 192.0.2.45 dev r1-eth1
 > ip -f mpls route add 105 via inet 192.0.2.46 dev r1-eth2

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-09 21:00:57 +02:00
Philippe Guibert 577be36a41 bgpd: add support for l3vpn per-nexthop label
This commit introduces a new method to associate a label to
prefixes to export to a VPNv4 backbone. All the methods to
associate a label to a BGP update is documented in rfc4364,
chapter 4.3.2. Initially, the "single label for an entire
VRF" method was available. This commit adds "single label
for each attachment circuit" method.

The change impacts the control-plane, because each BGP update
is checked to know if the nexthop has reachability in the VRF
or not. If this is the case, then a unique label for a given
destination IP in the VRF will be picked up. This label will
be reused for an other BGP update that will have the same
nexthop IP address.

The change impacts the data-plane, because the MPLs pop
mechanism applied to incoming labelled packets changes: the
MPLS label is popped, and the packet is directly sent to the
connected nexthop described in the previous outgoing BGP VPN
update.

By default per-vrf mode is done, but the user may choose
the per-nexthop mode, by using the vty command from the
previous commit. In the latter case, a per-vrf label
will however be allocated to handle networks that are not directly
connected. This is the case for local traffic for instance.

The change also include the following:

-  ECMP case
In case a route is learnt in a given VRF, and is resolved via an
ECMP nexthop. This implies that when exporting the route as a BGP
update, if label allocation per nexthop is used, then two possible
MPLS values could be picked up, which is not possible with the
current implementation. Actually, the NLRI for VPNv4 stores one
prefix, and one single label value, not two. Today, RFC8277 with
multiple label capability is not yet available.
To avoid this corner case, when a route is resolved via more than one
nexthop, the label allocation per nexthop will not apply, and the
default per-vrf label will be chosen.
Let us imagine BGP redistributes a static route using the `172.31.0.20`
nexthop. The nexthop resolution will find two different nexthops fo a
unique BGP update.

 > r1# show running-config
 > [..]
 > vrf vrf1
 >  ip route 172.31.0.30/32 172.31.0.20
 > r1# show bgp vrf vrf1 nexthop
 > [..]
 > 172.31.0.20 valid [IGP metric 0], #paths 1
 >  gate 192.0.2.11
 >  gate 192.0.2.12
 >  Last update: Mon Jan 16 09:27:09 2023
 >  Paths:
 >    1/1 172.31.0.30/32 VRF vrf1 flags 0x20018

To avoid this situation, BGP updates that resolve over multiple
nexthops are using the unique per-vrf label.

- recursive route case

Prefixes that need a recursive route to be resolved can
also be eligible for mpls allocation per nexthop. In that
case, the nexthop will be the recursive nexthop calculated.

To achieve this, all nexthop types in bnc contexts are valid,
except for the blackhole nexthops.

- network declared prefixes

Nexthop tracking is used to look for the reachability of the
prefixes. When the the 'no bgp network import-check' command
is used, network declared prefixes are maintained active,
even if there is no active nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-09 21:00:57 +02:00
Donatas Abraitis 786e2b8bdb Revert "MPLS allocation mode per next hop"
Broken tests, let's revert now.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-03 13:52:46 +03:00
Donatas Abraitis 99a1ab0b21
Merge pull request #12646 from pguibert6WIND/mpls_alloc_per_nh
MPLS allocation mode per next hop
2023-05-02 18:36:45 +03:00
Donald Sharp cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Philippe Guibert aa27437604 bgpd: use nexthop interface when adding LSP in BGP MPLSVPN
BGP MPLSVPN next hop label allocation was using only the next-hop
IP address. As MPLSVPN contexts rely on bnc contexts, the real
nexthop interface is known, and the LSP entry to enter can apply
to the specific interface. To illustrate, the BGP service is able
to handle the following two iproute2 commands:

 > ip -f mpls route add 105 via inet 192.0.2.45 dev r1-eth1
 > ip -f mpls route add 105 via inet 192.0.2.46 dev r1-eth2

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-22 12:06:29 +01:00
Philippe Guibert 92d5e31ace bgpd: add support for l3vpn per-nexthop label
This commit introduces a new method to associate a label to
prefixes to export to a VPNv4 backbone. All the methods to
associate a label to a BGP update is documented in rfc4364,
chapter 4.3.2. Initially, the "single label for an entire
VRF" method was available. This commit adds "single label
for each attachment circuit" method.

The change impacts the control-plane, because each BGP update
is checked to know if the nexthop has reachability in the VRF
or not. If this is the case, then a unique label for a given
destination IP in the VRF will be picked up. This label will
be reused for an other BGP update that will have the same
nexthop IP address.

The change impacts the data-plane, because the MPLs pop
mechanism applied to incoming labelled packets changes: the
MPLS label is popped, and the packet is directly sent to the
connected nexthop described in the previous outgoing BGP VPN
update.

By default per-vrf mode is done, but the user may choose
the per-nexthop mode, by using the vty command from the
previous commit. In the latter case, a per-vrf label
will however be allocated to handle networks that are not directly
connected. This is the case for local traffic for instance.

The change also include the following:

-  ECMP case
In case a route is learnt in a given VRF, and is resolved via an
ECMP nexthop. This implies that when exporting the route as a BGP
update, if label allocation per nexthop is used, then two possible
MPLS values could be picked up, which is not possible with the
current implementation. Actually, the NLRI for VPNv4 stores one
prefix, and one single label value, not two. Today, RFC8277 with
multiple label capability is not yet available.
To avoid this corner case, when a route is resolved via more than one
nexthop, the label allocation per nexthop will not apply, and the
default per-vrf label will be chosen.
Let us imagine BGP redistributes a static route using the `172.31.0.20`
nexthop. The nexthop resolution will find two different nexthops fo a
unique BGP update.

 > r1# show running-config
 > [..]
 > vrf vrf1
 >  ip route 172.31.0.30/32 172.31.0.20
 > r1# show bgp vrf vrf1 nexthop
 > [..]
 > 172.31.0.20 valid [IGP metric 0], #paths 1
 >  gate 192.0.2.11
 >  gate 192.0.2.12
 >  Last update: Mon Jan 16 09:27:09 2023
 >  Paths:
 >    1/1 172.31.0.30/32 VRF vrf1 flags 0x20018

To avoid this situation, BGP updates that resolve over multiple
nexthops are using the unique per-vrf label.

- recursive route case

Prefixes that need a recursive route to be resolved can
also be eligible for mpls allocation per nexthop. In that
case, the nexthop will be the recursive nexthop calculated.

To achieve this, all nexthop types in bnc contexts are valid,
except for the blackhole nexthops.

- network declared prefixes

Nexthop tracking is used to look for the reachability of the
prefixes. When the the 'no bgp network import-check' command
is used, network declared prefixes are maintained active,
even if there is no active nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-22 12:06:29 +01:00
Donald Sharp 115ccb9acf lib, bgpd: Add more debugs to GR Capability exchange
a) Make it legible what type of message is being passed
back and forth instead of having to guess it from
the insufficient debugs

b) Make it explicit which bgp instance is sending this
data

c) Cleanup bgp_zebra_update to have a cleaner api

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-09 08:36:51 -05:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Philippe Guibert 4cd690ae4d bgpd: add 'mpls bgp forwarding' to ease mpls vpn ebgp peering
RFC4364 describes peerings between multiple AS domains, to ease
the continuity of VPN services across multiple SPs. This commit
implements a sub-set of IETF option b) described in chapter 10 b.

The ASBR to ASBR approach is taken, with an EBGP peering between
the two routers. The EBGP peering must be directly connected to
the outgoing interface used. In those conditions, the next hop
is directly connected, and there is no need to have a transport
label to convey the VPN label. A new vty command is added on a
per interface basis:

This command if enabled, will permit to convey BGP VPN labels
without any transport labels (i.e. with implicit-null label).

restriction:
this command is used only for EBGP directly connected peerings.
Other use cases are not covered.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Donald Sharp 50b3ceb003 bgpd: Align bgp_zebra.h to our standards
bgp_zebra.h has function declarations that are
not properly aligned with our standard on how
to do so.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-12 10:20:28 -04:00
Iqra Siddiqui ad1844f7bd bgpd: Few code optimisations
Description:
Added a macro which optimises some part of the code.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2021-11-19 07:33:22 +05:30
Hiroki Shirokura 0249b8b612 bgpd: add no-cli for srv6 on bgpd-side
(1) Implement zapi wrapper func to release srv6-locator-chunk

(2) Implement no locator NAME command
router bgp 1
 segment-routing srv6
  no locator loc1

(3) Implement no segment-routing srv6 command
router bgp 1
 no segment-routing srv6

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-13 22:38:25 +00:00
Hiroki Shirokura a0281b2eab bgpd: cli for srv6-locator assignment (step4)
This commit add command to speficy SRv6 locator for BGP SRv6-VPN.
CLI example is follow. CLI block of "segment-routing" is already
implemented by previous commits and it's managed by zebra.

Zebra manage just the ownership of locator's prefix.
Zlient can request to get srv6-locator's prefix chunk using
srv6_manager_get_locator_chunk() which is usuful func to
execute ZEBRA_SRV6_MANAGER_GET_LOCATOR_CHUNK api. This request
is wokring as async, And zebra calls same api to Zclients when
zebra allocate locator prefix chunk.

And then, finally zclient(bgpd) catch the information via
process_srv6_lcoator_chunk callback function.

router bgp 1
 segment-routing srv6
  locator loc1
 !
!
segment-routing
 srv6
  locators
   locator loc1
    prefix 2001:db8:1:1::/64
   !
  !
 !
!

[POINT_OF_REVIEW]
In current implementation, user can just configure srv6 locator
but user can't de-configure srv6 locator.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
David Schweizer c163f2971b
bgpd: set/unset bgpd no-rib option at runtime
* Added vtysh cli commands and functions to set/unset bgp daemons no-rib
  option during runtime and withdraw/announce routes in bgp instances
  RIB from/to Zebra.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2020-09-02 18:20:08 +02:00
Donald Sharp 9bcb3eef54 bgp: rename bgp_node to bgp_dest
This is the bulk part extracted from "bgpd: Convert from `struct
bgp_node` to `struct bgp_dest`".  It should not result in any functional
change.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-06-23 17:32:52 +02:00
vivek f7e1c681f4 bgpd: Implement options for link bandwidth handling
Support configurable options to control how link bandwidth is handled
by the receiver. The default behavior is to automatically honor the
link bandwidths received and use it to perform a weighted ECMP BUT only
if all paths in the multipath have associated link bandwidth; if one or
more paths do not have link bandwidth, normal ECMP is performed among
the multipaths. This behavior is as recommended by
https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth.

The additional options available are to (a) completely ignore any link
bandwidth (i.e., weighted ECMP is effectively disabled), (b) skip paths
in the multipath which do not have link bandwidth and perform weighted
ECMP among the other paths (if at least some paths have the bandwidth)
or (c) use a default weight (value chosen is 1) for the paths which
do not have link bandwidth.

The command syntax is
bgp bestpath bandwidth <ignore|skip-missing|default-weight-for-missing>

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2020-03-30 20:12:31 -07:00
Donald Sharp 5a1ae2c237 bgpd: Rework code to use const struct prefix
Future work needs the ability to specify a
const struct prefix value.  Iterate into
bgp a bit to get this started.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-24 07:51:41 -04:00
Donald Sharp b8685f9bea bgpd: Add some const struct prefix for a couple more functions
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-23 08:10:55 -04:00
Donatas Abraitis 3dc339cdc2 bgpd: Convert lots of int type functions to bool/void
Some were converted to bool, where true/false status is needed.
Converted to void only those, where the return status was only false or true.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-21 14:59:18 +02:00
Quentin Young 362353195a bgpd, lib: fix style from BGP GR code
This patch fixes the noncompliant style for the following commit range:

4a6e80fbf
2ba1fe695
efcb2ebbb
8c48b3b69
dc95985fe
0f0444fbd
85ef4179a
eb451ee58
2d3dd828d
9e3b51a7f
d6e3c15b6
34aa74486
6102cb7fe
d7b3cda6f
2bb5d39b1
5f9c1aa29
5cce3f054
3a75afa4b
f009ff269
cfd47646b
2986cac29
055679e91
034e185dc
794b37d52
b0965c44e
949b0f24f
63696f1d8

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-04 15:19:04 -05:00
bisdhdh 2ba1fe6951 bgpd: BGP Garaceful Restart debug logs.
Reorganizing bgp gr debug logs and code review comments.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:36:33 +05:30
bisdhdh 2d3dd828db bgpd: Adding header files for BGPD-ZEBRA integration for GR.
Data Structures, function declaration and Macros forSignalling
from BGPD to ZEBRA to enable or disable GR feature in ZEBRA
depending on bgp per peer gr configuration.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
David Lamparter dd65f45ebc bgpd: move config-write to bgp_vty.c
There's no good reason to have this in bgpd.c;  it's just there
historically.  Move it to bgp_vty.c where it makes more sense.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
Don Slice fc2408ec18 bgpd: move bgp_update_redist_vrf_bitmaps to bgp_zebra.c for wider use beyond bgp_vty
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-03-14 15:05:38 +00:00
Chirag Shah a80161574c bgpd: advertise svi ip as macip zebra parse api
Ticket:CM-23782

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-02-06 19:57:40 -08:00
Philippe Guibert 6cfe5d1533 bgpd: ip rule zebra layer adapted to handle both cases
now, ip rule can be created from two differnt ways; however a single
zebra API has been defined. so make it consistent by adding a parameter
to the bgp zebra layer. the function will handle the rest.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-29 14:15:10 +01:00
Chirag Shah 0b9d9cd013 bgpd: dup addr detect config cli
Duplicate address detection configuration clis
under bgp l2vpn evpn config mode.
- Enabled/Disable (global knob) for feature.
- Configure cli for duplicate detection action
freeze and freze until time (auto-recovery).

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:16 -08:00
Russ White 79e8a97c1a
Merge pull request #3024 from ton31337/fix/validate_route-map
bgpd: Check if route-map really exists before applying to the peer
2018-10-14 08:48:48 -04:00
Donald Sharp fd06964433 bgpd: Add '[no] flood <disable|head-end-replication>'
Add the '[no] flood <disable|head-end-replication>' command
to the l2vpn evpn afi/safi sub commands for bgp.  This command
when entered as 'flood disable' will turn off type 3 route
generation for the transmittal of the type 3 route necessary
for BUM replication on the remote VTEP.  Additionally it will
turn off the BUM handling via the new zebra command,
ZEBRA_VXLAN_FLOOD_CONTROL.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 20:27:28 -04:00
Donatas Abraitis 1de2762153 bgpd: Check if route-map really exists before applying to the peer
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2018-10-11 10:56:12 +03:00
Donald Sharp 4b7e606625 bgpd: Convert struct bgp_info to struct bgp_path_info
Do a straight conversion of `struct bgp_info` to `struct bgp_path_info`.
This commit will setup the rename of variables as well.

This is being done because `struct bgp_info` is not descriptive
of what this data actually is.  It is path information for routes
that we keep to build the actual routes nexthops plus some extra
information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-09 14:14:25 -04:00
paco f533be73f6
bgpd, doc, ldpd, lib, tests, zebra: LM fixes
Corrections so that the BGP daemon can work with the label manager properly
through a label-manager proxy. Details:

- Correction so the BGP daemon behind a proxy label manager gets the range
  correctly (-I added to the BGP daemon, to set the daemon instance id)
- For the BGP case, added an asynchronous label manager connect command so
  the labels get recycled in case of a BGP daemon reconnection. With this,
  BGPd and LDPd would behave similarly.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-18 17:39:16 +02:00