summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.h
AgeCommit message (Collapse)Author
2024-12-12zebra,yang: Completely remove multicast mode from zebraNathan Bahr
Multicast mode belongs in PIM, so removing it completely from zebra. Modified `show (ip|ipv6) rpf ADDRESS` to always lookup from SAFI_MULTICAST. This means this command is now specific to the multicast table and does not necessarily reflect the PIM RPF lookup, but that should be implemented in PIM instead. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-01zebra: Delay some processing until after startup is finishedDonald Sharp
Currently zebra starts the graceful restart timer as well as allows connections from clients before all data is read in from the kernel as well as the possiblity of allowing client connections before this happens as well. Let's move the graceful restart timer start till after this is done as well as not allowing client connections till then as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-01*: Add and use option for graceful (re)startvivek
Add a new start option "-K" to libfrr to denote a graceful start, and use it in zebra and bgpd. zebra will use this option to denote a planned FRR graceful restart (supporting only bgpd currently) to wait for a route sync completion from bgpd before cleaning up old stale routes from the FIB. An optional timer provides an upper-bounds for this cleanup. bgpd will use this option to denote either a planned FRR graceful restart or a bgpd-only graceful restart, and this will drive the BGP GR restarting router procedures. Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2023-12-28zebra: support yielding between oper state routes queryChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-06zebra: Move v6_rr_semantics to be part of zrouter structureDonald Sharp
Move global variable v6_rr_semantics from a global data structure into the zrouter data structure. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-10-12zebra: Make ucmp scale value owned by zrouterDonald Sharp
The weight scale value might be useful to have it change it's behavior at a later time or controlled by something depending on how FRR is compiled/ran. Let's start that process Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-03zebra: Allow zebra cli to accept v6 routes with v4 nexthopsDonald Sharp
add --v6-with-v4-nexthop cli to zebra to allow operator to specify that this functionality is allowed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-05zebra: Move protodown_r_bit to a better spotDonald Sharp
Since we are moving some code handling out of the dataplane and into zebra proper, lets move the protodown r bit as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-12-12zebra: Add `zrouter.asic_notification_nexthop_control`Donald Sharp
Volta submitted notification changes for the dplane that had a special use case for their system. Volta is no more, the code is not being actively developed and from talking with ex-Volta employees there is no current plans to even maintain this code. Wrap the special handling of nexthops that their asic-dataplane did in a bit of code to isolate it and allow for future removal, as that I do not actually believe anyone else is using this code. Add a CPP_NOTICE several years into the future that will tell us to remove the code. If someone starts using it then they will have to notice this variable to set it and hopefully they will see my CPP_NOTICE to come talk to us. If this is being used then we can just remove this wrapper. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-22zebra: traffic control state managementSiger Yang
This allows Zebra to manage QDISC, TCLASS, TFILTER in kernel and do cleaning jobs when it starts up. Signed-off-by: Siger Yang <siger.yang@outlook.com>
2022-08-05zebra: zrouter.in_shutdown is an atomic variableDonald Sharp
So let's treat the variable like it is atomic and properly load it when we need to look at it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-01zebra: move allow_delete to zrouter.allow_deleteDonald Sharp
Instead of having global allow_delete move it to where it belongs in the zrouter data structure. Additionally show this data in `show zebra` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-28Merge pull request #11474 from donaldsharp/dp-dpdkRuss White
Dp dpdk
2022-06-27zebra: Add ability for netconf dplane to handle global valuesDonald Sharp
Add the ability for the netconf dplane code to handle the global NETCONFA_IFINDEX_DEFAULT and NETCONF_IFINDEX_ALL values. Then store our interested values when we get them from the kernel as well as being able to display them to the end operator. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-27zebra: add support for maintaining local neigh entriesAnuradha Karuppiah
Currently specific local neighbors (attached to SVIs) are maintatined in an EVPN specific database. There is a need to maintain L3 neighbors for other purposes including MAC resolution for PBR nexthops. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Cleanup compile and fix crash Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-06-16zebra: Add a configurable knob `zebra nexthop-group keep (1-3600)`Donald Sharp
Allow end operator to set how long a nexthop-group is kept around in the system after it is no-longer being used. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-09zebra: clear protodown_rc on shutdown and sweepStephen Worley
Add functionality to clear any reason code set on shutdown of zebra when we are freeing the interface, in case a bad client didn't tell us to clear it when the shutdown. Also, in case of a crash or failure to do the above, clear reason on startup if it is set. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09zebra: add support for protodown reason codeStephen Worley
Add support for setting the protodown reason code. https://github.com/torvalds/linux/commit/829eb208e80d6db95c0201cb8fa00c2f9ad87faf These patches handle all our netlink code for setting the reason. For protodown reason we only set `frr` as the reason externally but internally we have more descriptive reasoning available via `show interface IFNAME`. The kernel only provides a bitwidth of 32 that all userspace programs have to share so this makes the most sense. Since this is new functionality, it needs to be added to the dplane pthread instead. So these patches, also move the protodown setting we were doing before into the dplane pthread. For this, we abstract it a bit more to make it a general interface LINK update dplane API. This API can be expanded to support gernal link creation/updating when/if someone ever adds that code. We also move a more common entrypoint for evpn-mh and from zapi clients like vrrpd. They both call common code now to set our internal flags for protodown and protodown reason. Also add debugging code for dumping netlink packets with protodown/protodown_reason. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-02-27zebra: Allow *BSD to specify a receive buffer sizeDonald Sharp
End operator is reporting that they are receiving buffer overruns when attempting to read from the kernel receive socket. It is possible to adjust this size to more modern levels especially for when the system is under load. Modify the code base so that *BSD operators can use the zebra `-s XXX` option to specify a read buffer. Additionally setup the default receive buffer size on *BSD to be 128k instead of the 8k so that FRR does not run into this issue again. Fixes: #10666 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-04zebra: Add kernel nexthop group support to `show zebra`Donald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-29zebra: Prevent thread usage of data after it being freedDonald Sharp
On startup we create a thread timer event to do a rib sweep of the system. On shutdown we never stopped this timer and as such we have a situation where a thread event could be run on shutdown after the data for it has been freed. Here is the crash I am seeing: (gdb) bt (gdb) Save the thread data in zebra_router and stop the thread so we don't accidently do work on shutdown we don't mean to. In this case it happened in our topotests with some severe system load. Essentially we happened to kill the zebra daemon just as the graceful_restart timer popped here. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-06-08zebra: rework RA handling for vrf-liteStephen Worley
Rework RA handling for vrf-lite scenarios. Before we were using a single FD descriptor for polling across multiple zvrf's. This would cause us to hit this assert() in some bgp unnumbered and vrrp configs: ``` /* * What happens if we have a thread already * created for this event? */ if (thread_array[fd]) assert(!"Thread already scheduled for file descriptor"); ``` We were scheduling a thread_read on the same FD for every zvrf. With vrf-lite, RAs and ARPs are not vrf-bound, so we can just use one rtadv instance to manage them for all VRFs. We will choose the default VRF for this. This patch removes the rtadv_sock altogether for zrouter and moves the functionality this represented to the default VRF. All RAs will be handled in the default VRF under vrf-lite configs with only one poll thread started for it. This patch also extends how we track subscribed interfaces (s or msec) to use an actual sorted list by interface names rather than just a counter. With multiple daemons turning interfaces/on/off these counters can get very wrong during ifup/down events. Making them a sorted list prevents this from happening by preventing duplicates. With netns-vrf's nothing should change other than the interface list. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2020-11-15zebra: Add `--asic-offload` commandDonald Sharp
Add a command that allows FRR to know it's being used with an underlying asic offload, from the linux kernel perspective. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-27zebra: uplink tracking and startup delay for EVPN-MHAnuradha Karuppiah
Local ethernet segments are held in a protodown or error-disabled state if access to the VxLAN overlay is not ready - 1. When FRR comes up the local-ESs/access-port are kept protodown for the startup-delay duration. During this time the underlay and EVPN routes via it are expected to converge. 2. When all the uplinks/core-links attached to the underlay go down the access-ports are similarly protodowned. The ES-bond protodown state is propagated to each ES-bond member and programmed in the dataplane/kernel (per-bond-member). Configuring uplinks - vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink" Configuring startup delay - vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> EVPN protodown display - ======================== root@torm-11:mgmt:~# vtysh -c "show evpn" L2 VNIs: 10 L3 VNIs: 3 Advertise gateway mac-ip: No Advertise svi mac-ip: No Duplicate address detection: Disable Detection max-moves 5, time 180 EVPN MH: mac-holdtime: 60s, neigh-holdtime: 60s startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<< uplink-cfg-cnt: 4, uplink-active-cnt: 4 protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ES-bond protodown display - =========================== root@torm-11:mgmt:~# vtysh -c "show interface hostbond1" Interface hostbond1 is up, line protocol is down Link ups: 0 last: (never) Link downs: 1 last: 2020/04/26 20:38:03.53 PTM status: disabled vrf: default OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1 index 58 metric 0 mtu 9152 speed 4294967295 flags: <UP,BROADCAST,MULTICAST> Type: Ethernet HWaddr: 00:02:00:00:00:35 Interface Type bond Master interface: bridge EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11 protodown: off rc: startup-delay <<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ES-bond member protodown display - ================================== root@torm-11:mgmt:~# vtysh -c "show interface swp5" Interface swp5 is up, line protocol is down Link ups: 0 last: (never) Link downs: 3 last: 2020/04/26 20:38:03.52 PTM status: disabled vrf: default index 7 metric 0 mtu 9152 speed 10000 flags: <UP,BROADCAST,MULTICAST> Type: Ethernet HWaddr: 00:02:00:00:00:35 Interface Type Other Master interface: hostbond1 protodown: on rc: startup-delay <<<<<<<<<<<<<<<< root@torm-11:mgmt:~# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-09-22zebra: Add basic knowledge of asic offload availableDonald Sharp
Some linux kernels are starting to support the idea of knowledge about the underlying asic. Add a boolean that we can set/unset to track whether or not we think the router has this functionality available. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-08-05zebra: Ethernet segment management and support for MAC-ECMPAnuradha Karuppiah
1. Local ethernet segments are configured in zebra by attaching a local-es-id and sys-mac to a access interface - >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! interface hostbond1 evpn mh es-id 1 evpn mh es-sys-mac 00:00:00:00:01:11 ! >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> This info is then sent to BGP and used for the generation of EAD-per-ES routes. 2. Access VLANs associated with an (ES) access port are translated into ES-EVI objects and sent to BGP. This is used by BGP for the generation of EAD-EVI routes. 3. Remote ESs are imported by BGP and sent to zebra. A list of VTEPs is maintained per-remote ES in zebra. This list is used for the creation of the L2-NHG that is used for forwarding traffic. 4. MAC entries with a non-zero ESI destination use the L2-NHG associated with the ESI for forwarding traffic over the VxLAN overlay. Please see zebra_evpn_mh.h for the datastruct organization details. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-12zebra: northbound changes for the rib modelChirag Shah
This commit implements: RIB operational list create/destroy. Walk over RIB tables using keys. The first RIB table will be IPV4/unicast (table-id 254) will be fetched. Create a new api to fetch RIB table based on afi-safi and table id as the keys. remove mandatory true statement from the leaf which is part of the list key. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-03-23zebra: implement zebra route map northboundRafael Zalamena
Add skeleton code for zebra northbound, but implement route map commands. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-01-30zebra: Header file changes and show commands.Santosh P K
Adding header files changes where structure to hold received graceful restart info from client is defined. Also there are changes for show commands where exisiting commands are extended. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Soman K S <somanks@vmware.com> Signed-off-by: Santosh P K <sapk@vmware.com>
2019-11-21zebra: Fixing Comments in MLAG Read scheduling EventsSatheesh Kumar K
Zebra MLAG is using "t_read" for multiple tasks, such as 1. For opening Communication channel with MLAG 2. In case conncetion fails, same event is used for retries 3. after the connection establishment, same event is used to read the data from MLAG since all these taks will never schedule together, this will not cause any issues. Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-19zebra,pim : Fixing Review comments in PIM_MLAGSatheesh Kumar K
Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13Zebra: ADD Protobuf Encoding & Decoding for MLAG MessagesSatheesh Kumar K
1. add the Mlag ProtoBuf Lib to Zebra Compilation 2. Encode the messages with protobuf before writing to MLAG 3. Decode the MLAG Messages using protobuf and write to clients based on their subscrption. Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13Zebra: adding support for Zebra MLAG FunctionalitySatheesh Kumar K
This includes: 1. Processing client Registrations for MLAG 2. storing client Interests for MLAG updates 3. Opening communication channel to MLAG with First client reg 4. Closing Communication channel with last client De-reg 5. Spawning a new thread for handling MLAG updates peocessing 6. adding Test code 7. advertising MLAG Updates to clients based on their interests Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-10-25zebra: Sweep our nexthop objects out on restartStephen Worley
On restart, if we failed to remove any nexthop objects due to a kill -9 or such event, sweep them if we aren't using them. Add a proto field to handle this and remove the is_kernel bool. Add a dupicate flag that indicates this nexthop group is only present in our ID hashtable. It is a dupicate nexthop we received from the kernel, therefore we cannot hash on it. Make the idcounter globally accessible so that kernel updates increment it as soon as we receive them, not when we handle them. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Remove nexthop group workqueueStephen Worley
We are using the rib workqueue to handle nexthop groups from the kernel and no longer need this. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Uninstall nexthops on shutdownStephen Worley
Add functionality to uninstall nexthops we created on shutdown. To account for this, I added in a function for zebra_router cleanup in a shutdown event. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Add beginnings of nexthop group work queueDonald Sharp
Add the basic infrastructure for a nexthop group work queue. This queue will be used to validate and then install the new nexthop group. The result from the kernel when a new nexthop group is installed will cause the route entries that depend on it to be installed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25zebra: Add a second table for indexing by IDStephen Worley
The messages we get from the kernel come with ids only for groups, so lets index with those as well. Also adding a helper function for lookup and get with the two different tables. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Add hash of nexthop groupsDonald Sharp
This commit does nothing more than just create a hash structure that we will use to track nexthop groups. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-14Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"Quentin Young
This reverts commit d563896dada99f3474d428f928786cbfde936fee, reversing changes made to 09ea1a40386f02a13cdb0462cc55af0d03f0c277.
2019-10-14Merge pull request #4885 from satheeshkarra/pim_mlagJafar Al-Gharaibeh
pimd, lib, Zebra: PIM MLAG Support
2019-10-03Zebra: Fixing Review comments in Zebra_MLAGSatheesh Kumar K
Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-09-27zebra: during shutdown processing, drop dplane resultsMark Stapp
Don't process dataplane results in zebra during shutdown (after sigint has been seen). The dplane continues to run in order to clean up, but zebra main just drops results. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-09-24Zebra: adding support for Zebra MLAG FunctionalitySatheesh Kumar K
This includes: 1. Processing client Registrations for MLAG 2. storing client Interests for MLAG updates 3. Opening communication channel to MLAG with First client reg 4. Closing Communication channel with last client De-reg 5. Spawning a new thread for handling MLAG updates peocessing 6. adding Test code 7. advertising MLAG Updates to clients based on their interests Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-06-04zebra: keep rtadv_sock field in zrouter for optimisationPhilippe Guibert
in the case the vrf backend is vrf-lite, there is no need to have separate sockets. use a socket located in zrouter, so that when needing the socket, a common API is used. that API will return the appropriate socket value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-04zebra: move rtadv service from zrouter to zvrfPhilippe Guibert
when network namespace is used as vrf backend, there is need to have separate contexts for rtadv contexts. route advertisements have to look for appropriate interface based on zvrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>