summaryrefslogtreecommitdiff
path: root/zebra/rt.h
AgeCommit message (Collapse)Author
2023-07-05zebra: Use zebra dplane for RTM link and addrDonald Sharp
a) Move the reads of link and address information into the dplane b) Move the startup read of data into the dplane as well. c) Break up startup reading of the linux kernel data into multiple phases. As that we have implied ordering of data that must be read first and if the dplane has taken over some data reading then we must delay initial read-in of other data. Fixes: #13288 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-13zebra: handle STP state change for SVD per vlan IDStephen Worley
Read in STP state changes for a Single Vxlan Device via bridge vlan netlink messages. Map the vlanid to a VNI in the SVD table and treat it similar to how we handle proto down of the Vxlan device traditionally in a non-SVD device scenario. Forwarding == Interface UP Blocking == Interface DOWN Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13zebra: Bug fixes in fdb read for flooded traffic and remote fdb cleanup upon ↵Sharath Ramamurthy
vni removal This patch addresses following issues, - When the VLAN-VNI mapping is configured via a map and not using individual VXLAN interfaces, upon removal of a VNI ensure that the remote FDB entries are uninstalled correctly. - When VNI configuration is performed using VLAN-VNI mapping (i.e., without individual VXLAN interfaces) and flooded traffic is handled via multicast, the multicast group corresponding to the VNI needs to be explicitly read from the bridge FDB. This is relevant in the case of netlink interface to the kernel and for the scenario where a new VNI is provisioned or comes up. Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
2023-02-13zebra: multiple vlan aware bridge datastructure changes and vxlan device ↵Sharath Ramamurthy
iftype derivation from netlink This change set introduces data structure changes required for multiple vlan aware bridge functionality. A new structure zebra_l2_bridge_if encapsulates the vlan to access_bd association of the bridge. A vlan_table hash_table is used to record each instance of the vlan to access_bd of the bridge via zebra_l2_bridge_vlan structure. vxlan iftype derivation: netlink attribute IFLA_VXLAN_COLLECT_METADATA is used to derive the iftype of the vxlan device. If the attribute is present, then the vxlan interface is treated as single vxlan device, otherwise it would default to traditional vxlan device. zebra_vxlan_check_readd_vtep, zebra_vxlan_dp_network_mac_add/del is modified to be vni aware. mac_fdb_read_for_bridge - is modified to be (vlan, bridge) aware Signed-off-by: Sharath Ramamurthy <sramamurthy@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>
2023-01-23zebra: use typesafe lib lists in zebra dplaneMark Stapp
Replace some of the old queue/DLIST macros with typesafe dlists. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-01-05zebra: Set metric appropriately on route offload to asicDonald Sharp
When FRR receives a route from the kernel about the route offload success/failure. The metric being reported is not going to be correct since we may not know it appropriately at this point in time. If we can set the metric to something appropriate. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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>