summaryrefslogtreecommitdiff
path: root/zebra/rt.h
AgeCommit message (Collapse)Author
2022-08-11zebra: add tc netlink and dplane opsSiger Yang
This commit implements necessary netlink encoders for traffic control including QDISC, TCLASS and TFILTER, and adds basic dplane operations. Co-authored-by: Stephen Worley <sworley@nvidia.com> Signed-off-by: Siger Yang <siger.yang@outlook.com>
2022-08-08zebra: Add a `mpls enable` interface node commandDonald Sharp
Allow individual interfaces to turn on/off the mpls subsystem for it in linux. sharpd@eva:~/frr9$ sudo sysctl -a | grep enp39s0 | grep mpls net.mpls.conf.enp39s0.input = 0 sharpd@eva:~/frr9$ vtysh -c "conf" -c "int enp39s0" -c "mpls enable" sharpd@eva:~/frr9$ sudo sysctl -a | grep enp39s0 | grep mpls net.mpls.conf.enp39s0.input = 1 sharpd@eva:~/frr9$ vtysh -c "conf" -c "int enp39s0" -c "no mpls enable" sharpd@eva:~/frr9$ sudo sysctl -a | grep enp39s0 | grep mpls net.mpls.conf.enp39s0.input = 0 sharpd@eva:~/frr9$ Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-09zebra: add boilerplate protodown updates for *bsdStephen Worley
Add boilerplate for someone to come and add protdown updates for bsd platforms if it ever exists. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-02-11zebra: make netlink object hash threadsafeMark Stapp
The recently-added hashtable of nlsock objects needs to be thread-safe: it's accessed from the main and dplane pthreads. Add a mutex for it, use wrapper apis when accessing it. Add a per-OS init/terminate api so we can do init that's not per-vrf or per-namespace. Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-09-14zebra: use the dataplane to read netlink intf addr changesMark Stapp
Read incoming interface address change notifications in the dplane pthread; enqueue the events to the main pthread for processing. This is netlink-only for now - the bsd kernel socket path remains unchanged. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
2021-07-19zebra: use more constMark Stapp
Use const in many more evpn apis, especially for macaddr, ipaddr arguments. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-30zebra: new dplane action to set gre link interfacePhilippe Guibert
This action is initiated by nhrp and has been stubbed when moving to zebra. Now, a netlink request is forged to set the link interface of a gre interface if that gre interface does not have already a link interface. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09zebra: move neighbor table configuration to dplane contextsPhilippe Guibert
Instead of directly configuring the neighbor table after read from zapi interface, a zebra dplane context is prepared to host the interface and the family where the neighbor table is updated. Also, some other fields are hosted: app_probes, ucast_probes, and mcast_probes. More information on those fields can be found on ip-ntable configuration. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09zebra: handler for configuring neighbor tablePhilippe Guibert
neighbor table api in zebra is added. a netlink api is created for that. the handler is called from the api defined in the previous commit. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09nhrp, lib, zebra: add/del neighbor entry possible from nhrpPhilippe Guibert
a zebra api is extended to offer ability to add or remove neighbor entry from daemon. Also this extension makes possible to add neigh entry, not only between IPs and macs, but also between IPs and NBMA IPs. This API supports configuring ipv6/ipv4 entries with ipv4/ipv6 lladdr. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09zebra: link layer config and notification, implementation in zebraPhilippe Guibert
zebra implements zebra api for configuring link layer information. that can be an arp entry (for ipv4) or ipv6 neighbor discovery entry. This can also be an ipv4/ipv6 entry associated to an underlay ipv4 address, as it is used in gre point to multipoint interfaces. this api will also be used as monitoring. an hash list is instantiated into zebra (this is the vrf bitmap). each client interested in those entries in a specific vrf, will listen for following messages: entries added, removed, or who-has messages. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-10zebra: remove old kernel one-update-at-a-time apiJakub Urbańczyk
The old one is replaced by the api that is suitable for the batching. Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-08-10zebra: prepare dplane for batchingJakub Urbańczyk
Extend kernel interface to allow the data plane to send many kernel updates at once. Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-08-05zebra: support for adding L2NHG and mac-ecmp in the linux kernelAnuradha Karuppiah
Multihoming support requires a new dataplane feature, MAC-ECMP, to bridge traffic to remote ESs that are attached to more than one active VTEP. As a part of this support indirection has also been added via L2-NHGs. Using a nexthop group allows for fast failover of MAC entries when an access port attached to a remote-ES goes down i.e. instead of updating many MAC entries this becomes a single NHG update to the dataplane. Note: Some of the code here needs to be reworked to the new dataplane model. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-10-25zebra: Add base functionality for nexthop processing via the dataplaneStephen Worley
Add all the neccessary code to allow nexthops to be processed in separate dataplane contexts with the netlink dataplane kernel provider. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-09-17zebra: inform upper layer error when reading correct speed interfaceJulien Floret
speed interface is done 15 seconds after interface creation. during that time, the vrf or the interface may have disappeared. to protect this, return an error in case it is not possible to create a vrf socket or it is not possible to get speed of an interface because of a missing device. Signed-off-by: Julien Floret <julien.floret@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-09-04zebra: move EVPN VTEP programming to dataplaneMark Stapp
Move VTEP install/uninstall to the zebra dataplane. Remove synch kernel-facing apis and helper functions. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-08-23zebra: Use dataplane for evpn neighbor changesMark Stapp
Move neighbor programming to the dataplane; remove old apis; remove some ifdef'd use of direct netlink code points, using neutral values outside of the netlink- specific files. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-08-02zebra: use dataplane for vxlan remote mac programmingMark Stapp
Move vxlan remote MAC install and uninstall to the async dataplane. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-05-13zebra: Share route type checking macrosStephen Worley
Make the RIB_*_ROUTE() macro which is passed a route in rib.h just use the R*_ROUTE() macros that directly check the type in rt.h. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-04-22zebra: removing old intf address codeMark Stapp
Remove old ioctl and netlink interface-address code after conversion to async dataplane Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-22zebra: Use dplane for interface addresses (netlink)Mark Stapp
Start using the dataplane for interface-address programming, on netlink platforms. Other platforms just stubbed at this point. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-03-27zebra: Modify code so that dplane is responsible for indicating success/fail ↵Donald Sharp
of install We have several route types KERNEL and CONNECT that are handled via special case in the code. This was causing a lot of work keeping the two different classes of route types as special(SYSTEM OR NOT). Put the dplane in charge of the code that sets the bits for signalling route install/failure. This greatly simplifies the code calling path and makes all route types be handled exactly the same. Additionaly code that we want to run post data plane install can just work as per normal then, instead of having to know we need to run it when we have a special type of route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
2019-03-25add cplusplus guards to all zebra headersEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-02-05Merge pull request #3684 from mjstapp/dplane_pwDonald Sharp
zebra: async dataplane for pseudowires
2019-01-29zebra: add kernel neigh update apiChirag Shah
The kernel neigh update api helps update neighbor entry, using changing state and flags parameters. Ticket:CM-22864 Reviewed By: Testing Done: Signed-off-by:Chirag Shah <chirag@cumulusnetworks.com>
2019-01-25zebra: convert PW updates to async dataplaneMark Stapp
Add accessors for pw attributes; init pw attributes; replace 'hook' calls for pw install/uninstall with dplane apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-23Merge pull request #3508 from chiragshah6/evpn_dev2Russ White
zebra: EVPN remote entry delete check local entry presence
2019-01-22zebra: openbsd LSP update codeMark Stapp
Finish the LSP update code for the async dataplane for the openbsd platform. Remove synch apis now that we've converted to the async code path. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-22zebra: infra for LSP updates using dplaneMark Stapp
Adding infra to zebra dplane to support LSP updates. Add kernel api for LSP updates that uses a dataplane context; add stub apis for netlink, bsd, and 'null' kernel paths. Add version of netlink mpls update code that takes a dplane context struct instead of a zebra lsp struct. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-12-31zebra: evpn remote delete fetch local entryChirag Shah
An EVPN type-2 entry is in freeze state during remote update, remote VTEP can send typ-2 withdraw update, upon receiving an entry delete (withdraw), first check kernel has in local reachable state. Upon unfreeze use the local entry to advertise to peers. Fetch is for both MAC and IP, delete can come for only MAC or MAC-IP combined route. The specific entry fetch only required request flag to be set, dump flag is not required. Testing Done: Simulate two VTEPs to do M1, IP1 mobility sequence, freeze MAC during remote MAC update, subsequently send withdraw type-2 route from origintating VTEP. This results in read apis to invoke for local reachable entry. Zebra updates its cache and upon unfreeze originates type-2. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-21zebra: separate netlink socket for dataplaneMark Stapp
Use a separate netlink socket for the dataplane's updates, to avoid races between the dataplane pthread and the zebra main pthread. Revise zebra shutdown so that the dataplane netlink socket is cleaned-up later, after all shutdown-time dataplane work has been done. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25zebra: revise struct names to resolve review commentsMark Stapp
Use standard type naming and remove use of typedef to resolve some review comments. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25zebra: remove old apis after new dplane workMark Stapp
Replaced or out-grew a few zebra internal apis during async dataplane work; removing them. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25zebra: start dataplane layer workMark Stapp
Reduce or eliminate use of global zebra_ns structs in a couple of netlink/kernel code paths, so that those paths can potentially be made asynch eventually. Slide netlink_talk_info into place to remove dependency on core zebra structs; add accessors for dplane context block Start init of route context from zebra core re and rn structs; start queueing and event handling for incoming route updates. Expose netlink apis that don't rely on zebra core structs; add parallel route-update code path using the dplane ctx; simplest possible event loop to process queued route' updates. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-09-24Merge pull request #3052 from donaldsharp/dplane_2Russ White
Dplane 2
2018-09-19zebra: Create zebra_dplane.c and .hMark Stapp
Add first sketchy 'dplane' files. Signed-off-by: Mark Stapp <mjs@voltanet.io> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-18zebra: Use boolean for certain VxLAN-EVPN flagsvivek
Use boolean variables instead of unsigned int for certain VxLAN-EVPN flags which are really used as boolean. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com> Ticket: CM-22288 Reviewed By: CCR-7832 Testing Done: Along with a subsequent, related commit
2018-09-18zebra: Remove unused parameter in MAC deletevivek
When a MAC moves from local to remote, a replace is allowed, EVPN no longer has to delete the local MAC before installing the remote MAC. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-17bgpd: support evpn nd ext communityChirag Shah
EVPN ND ext community support NA flag R-bit, to have proxy ND. Set R-bit in EVPN NA if a given router is default gateway or there is a local router attached, which can be determine based on local neighbor entry. Implement BGP ext community attribute to generate and parse R-bit and pass along zebra to program neigh entry in kernel. Upon receiving MAC/IP update with community type 0x06 and sub_type 0x08, pass the R-bit to zebra to program neigh entry. Set NTF_ROUTER in neigh entry and inform kernel to do proxy NA for EVPN. Ref: https://tools.ietf.org/html/draft-ietf-bess-evpn-na-flags-01 Ticket:CM-21712, CM-21711 Reviewed By: Testing Done: Configure Local vni enabled L3 Gateway, which would act as router, checked show evpn arp-cache vni x ip <ip of svi> on originated and remote VTEPs. "Router" flag is set. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-11zebra, libs: use const prefix ptrs in apisMark Stapp
Add 'const' to prefix args to several zebra route update, redistribution, and route owner notification apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-05-30zebra: Add `enum dp_req_result` to lsp install/deletesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30zebra: Add a result from dataplane requestDonald Sharp
Add a bit of code to allow return of data plane request messages. Add the ability to pass the result back to callers of kernel_route_rib. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30zebra: Rename SOUTHBOUND_XXX to DP_XXXDonald Sharp
The SOUTHBOUND_XXX enum was named a bit poorly. Let's use a bit better name for what we are trying to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-02-27zebra: ipv6 operations stick to namespacePhilippe Guibert
All ipv6 operations stick to namespace. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-24zebra: Modify southbound interface to pass `struct route_node`Donald Sharp
The route_node that we are working on is going to be interesting to the kernel_route_rib_pass_fail. So I am setting up the code to allow me to pass it. This will be done in a subsuquent commit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-11zebra: Add one-shot thread to recheck speedDonald Sharp
There are certain interfaces that when brought up and we receive the netlink notification about it, the speed of the interface is not set correctly. This creates a one-shot thread that will wait 15 seconds and then requery the speed and if it is different it will renotify the running daemons. The kernel should notify us on speed changes, unfortunately this is not done currently via a netlink message as you would think. As I understand it there is some in-fighting about the proper way to approach this issue and due to the way the kernel release cycle works we are a ways off from getting this fixed. This is a `hack` to make us work correctly while we wait for the true answer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14Merge pull request #1546 from pguibert6WIND/issue__1537Donald Sharp
Issue 1537