summaryrefslogtreecommitdiff
path: root/zebra/interface.c
AgeCommit message (Collapse)Author
2021-04-30zebra: at startup, fix links on all namespacesPhilippe Guibert
when zebra has vrf backend mapped to namespaces, the polling of interfaces leads to fix all linkages of interfaces. This was not done on non default namespace. do it for other namespaces. 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-03-22zebra: kill zebra_memory.h, use MTYPE_STATICDavid Lamparter
This one also needed a bit of shuffling around, but MTYPE_RE is the only one left used across file boundaries now. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-24zebra: link local MACs to destination port for efficient lacp-bypass processingAnuradha Karuppiah
When an ES-bond comes out of bypass FRR needs to flush the local MACs learnt while the bond was in bypass. To do that efficiently local MACs are linked to the dest-access port. This only happens if the access-port is in LACP-bypass or if it is non-ES. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2021-02-24zebra: support for lacp bypass with EVPN MHAnuradha Karuppiah
Feature overview: ================= A 802.3ad bond can be setup to allow lacp-bypass. This is done to enable servers to pxe boot without a LACP license i.e. allows the bond to go oper up (with a single link) without LACP converging. If an ES-bond is oper-up in an "LACP-bypass" state MH treats it as a non-ES bond. This involves the following special handling - 1. If the bond is in a bypass-state the associated ES is placed in a bypass state. 2. If an ES is in a bypass state - a. DF election is disabled (i.e. assumed DF) b. SPH filter is not installed. 3. MACs learnt via the host bond are advertised with a zero ESI. When the ES moves out of "bypass" the MACs are moved from a zero-ESI to the correct non-zero id. This is treated as a local station move. Implementation: =============== When (a) an ES is detached from a hostbond or (b) an ES-bond goes into LACP bypass zebra deletes all the local macs (with that ES as destination) in the kernel and its local db. BGP re-sends any imported MAC-IP routes that may exist with this ES destination as remote routes i.e. zebra can end up programming a MAC that was perviously local as remote pointing to a VTEP-ECMP group. When an ES is attached to a hostbond or an ES-bond goes LACP-up (out of bypss) zebra again deletes all the local macs in the kernel and its local db. At this point BGP resends any imported MAC-IP routes that may exist with this ES destination as sync routes i.e. zebra can end up programming a MAC that was perviously remote as local pointing to an access port. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2021-02-19zebra: changes to advertise SVI mac by default if evpn-mh is enabledAnuradha Karuppiah
Added support for advertising SVI MAC if EVPN-MH is enabled. In the case of EVPN MH arp replies from an attached server can be sent to the ES-peer. To prevent flooding of the reply the SVI MAC needs to be advertised by default. Note: advertise-svi-ip could have been used as an alternate way to advertise SVI MAC. However that config cannot be turned on if SVI IPs are re-used (which is done to avoid wasting IP addresses in a subnet). Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2021-02-14*: remove tabs & newlines from log messagesDavid Lamparter
Neither tabs nor newlines are acceptable in syslog messages. They also break line-based parsing of file logs. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-12-14zebra: update protodown displayAnuradha Karuppiah
protodown state is a combination of the dplane and zebra states. protodown reason is maintained exclusively by zebra. Display this information on two separate lines to make that ownership clearer. Also display n/a for bonds as the dplane doesn't support protodowning the bond device. Sample output - ============== root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"|grep -i protodown protodown: off (n/a) protodown reasons: (uplinks-down) root@torm-11:mgmt:~# vtysh -c "show interface swp5"|grep -i protodown protodown: on protodown reasons: (uplinks-down) root@torm-11:mgmt:~# PS: Cosmetic changes only, no functional change. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-10-29zebra: clean up zebra_protodown_rc_str()Mark Stapp
Clean up api SA warning, use 'const', and replace snprintf+ pointer math with strlcat. Signed-off-by: Mark Stapp <mjs@voltanet.io>
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-10-22zebra: replace inet_ntoaMark Stapp
Stop using inet_ntoa - use %pI4 or inet_ntop instead Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22:* Convert prefix2str to %pFXDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-09-21*: Remove solaris from FRRDonald Sharp
The Solaris code has gone through a deprecation cycle. No-one has said anything to us and worse of all we don't have any test systems running Solaris to know if we are making changes that are breaking on Solaris. Remove it from the system so we can clean up a bit. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-08-18zebra: display interface slave typePhilippe Guibert
interface slave type is displayed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.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-08-05evpn-netns: Revert PR5077, has been re-worked post-refactorPat Ruddy
Revert "zebra: support for macvlan interfaces" This reverts commit bf69e212fd053af3298fc3cba38458b396467849. Revert "doc: add some documentation about bgp evpn netns support" This reverts commit 89b97c33d7a6d9dc427d56fea52fa27334dde81d. Revert "zebra: dynamically detect vxlan link interfaces in other netns" This reverts commit de0ebb25404fe984f084a0d57b7f873618423876. Revert "bgpd: sanity check when updating nexthop from bgp to zebra" This reverts commit ee9633ed87f0ff5da1373a42d6c044f0a682c8d3. Revert "lib, zebra: reuse and adapt ns_list walk functionality" This reverts commit c4d466c830083e8ba58881d7ad03a90f6baf0754. Revert "zebra: local mac entries populated in correct netnamespace" This reverts commit 40424548910887f3bbbf544ce964d3b736048ae5. Revert "zebra: when parsing local entry against dad, retrieve config" This reverts commit 3acc394bc5e5c225e9258fd0d57a6cebea0c0ccd. Revert "bgpd: evpn nexthop can be changed by default" This reverts commit a2342a241253c41b798845cae155b4caab4bcda5. Revert "zebra: zvni_map_to_vlan() adaptation for all namespaces" This reverts commit db81d18647bbd81a2c335620c9a03e32e4a5b2be. Revert "zebra: add ns_id attribute to mac structure" This reverts commit 388d5b438e22cddc6740e362763c0922edbb242a. Revert "zebra: bridge layer2 information records ns_id where bridge is" This reverts commit b5b453a2d6af58692bee0e256fe1dffe99824801. Revert "zebra, lib: new API to get absolute netns val from relative netns val" This reverts commit b6ebab34f664ba1cc9479fc1287f127c12077509. Revert "zebra, lib: store relative default ns id in each namespace" This reverts commit 9d3555e06ccc68fe37e0a00100029ac4bad8dee2. Revert "zebra, lib: add an internal API to get relative default nsid in other ns" This reverts commit 97c9e7533bd22029ac19838c043cfca82d2f6eb3. Revert "zebra: map vxlan interface to bridge interface with correct ns id" This reverts commit 7c990878f20efff335c1211deda3ec50071ae2b5. Revert "zebra: fdb and neighbor table are read for all zns" This reverts commit f8ed2c5420106314a940cb67264494e0110fc4c0. Revert "zebra: zvni_map_to_svi() adaptation for other network namespaces" This reverts commit 2a9dccb6475bfc11af2b855c4c8ff9e500ba21f4. Revert "zebra: display interface slave type" This reverts commit fc3141393ad95651d31fccd144b5c029d00e5f3a. Revert "zebra: zvni_from_svi() adaptation for other network namespaces" This reverts commit 6fe516bd4b85569b3b8b4bcc2910afc5569aa026. Revert "zebra: importation of bgp evpn rt5 from vni with other netns" This reverts commit 28254125d06f65cc4344b6156eec76a37ec6aede. Revert "lib, zebra: update interface name at netlink creation" This reverts commit 1f7a68a2ff0ba1424131f30112e0cc1572f0bee3. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-07-14*: un-split strings across linesDavid Lamparter
Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-06-22zebra: show interfaces from all VRFs in "show interface ..." commandsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-05-18zebra: display interface slave typePhilippe Guibert
interface slave type is displayed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18zebra: across network namespace, vxlan remembers the link informationPhilippe Guibert
the link information of vxlan interface is populated in layer 2 information, as well as in layer 2 vxlan information. This information will be used later to collect vnis that are in other network namespaces, but where bgp evpn is enabled on main network namespaces, and those vnis have the link information in that namespace. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-04-18Merge pull request #6231 from dslicenc/v6-ra-hoplimitDonatas Abraitis
zebra: add ability to set hoplimit for IPv6 RAs
2020-04-16Merge pull request #6247 from FRRouting/nb_conversionsDonald Sharp
Merge nb_converions branch to master
2020-04-16zebra: add northbound support for zebra interfaceChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-15zebra: add ability to set hoplimit for IPv6 RAsDon Slice
Reported by testing agency that rfc 4861 section 6.2.1 states that all implementations must have a configuration knob to change the setting of the advertised hop limit. This fix adds that capability. Ticket: CM-29200 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-14zebra: Add vrf name to debug outputDonald Sharp
The vrf id is insufficient of a discriminator in people's head Give them what they need. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-13*: Remove break after returnDonatas Abraitis
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-03zebra: send RA lifetime of 0 before ceasing to advertise RAsDon Slice
Problem reported by testing agency that RFC4861 section 6.2.5 states that a router should send an RA with a lifetime of 0 before ceasing to send RAs on the interface, or when the interace is shutdown, or the router is shutdown. This fix adds that capability. Ticket: CM-27061 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-11-26Merge pull request #4977 from chiragshah6/evpn_dev1Philippe Guibert
* evpn primary address advertisement
2019-11-22zebra: knob to make ra retransmit interval rfc compliantDon Slice
Problem reported by testing facility that our sending of Router Advertisements more frequently than once very three seconds is not compliant with rfc4861. Added a knob to turn off fast retransmits in order to meet the requirement of the RFC. Ticket: CM-27063 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-11-22zebra: evpn pip mac vlan up-down eventChirag Shah
macvlan interface up/down event triggers bgp to send updates for evpn routes with changed RMAC and nexthop IP values. Ticket:CM-26190 Reviewed By: Testing Done: Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-02lib, ospfd, zebra: Convert interface_delete to take double pointerDonald Sharp
When free'ing the interface pointer, set it to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-02*: Convert connected_free to a double pointerDonald Sharp
Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25zebra: Re-work zebra_nhg_*_valid APIsStephen Worley
Re-work the validity setting and checking APIs for nhg_hash_entry's to make them clearer. Further, they were originally only beings set on ifdown and install. Extended their use into releasing entries and to account for setting the validity of a recursive dependent. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Zebra nexthop group re-work checkpatch fixesStephen Worley
Checkpatch fixes for the zebra nexthop group re-work. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Switch nhg_connected to use new RB treeStephen Worley
Switch the nhg_connected tree structures to use the new RB tree API in `lib/typerb.h`. We were using the openbsd-tree implementation before. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Add cli show NHE by ID and interface groupsStephen Worley
Add cli to show nhg_hash_entry's by ID. Add cli to show nhg_hash_entry info for interfaces and remove just listing ID's in `show interface *` Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Use a nhe context dataplane and rib metaqStephen Worley
We will use a nhe context for dataplane interaction with nextho group hash entries. New nhe's from the kernel will be put into a group array if they are a group and queued on the rib metaq to be processed later. New nhe's sent to the kernel will be set on the dataplane context with approprate ID's in the group array if needed. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Add interface down marking to NHE'sStephen Worley
Add functionality to allow an interface down event to mark any dependent NHE's as invalid. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Re-organize/expose nhg_connectedStephen Worley
Re-organize and expose the nhg_connected functions so that it can be used outside zebra_nhg.c. And then abstract those into zebra_nhg_depends_* and zebra_nhg_depenents_* functons. Switch the ifp struct to use an RB tree for its dependents, making use of the nhg_connected functions. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Add ifp to zebra-side rib_addStephen Worley
Add an interface pointer for an nexthop group hash entry when we are getting a rib_add for a new route. Also, add the interface index to the `show nexthop-group` command. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25zebra: Add nexthop hash entry list to zebra interface infoStephen Worley
Add a nexthop hash entry list to the local zebra interface info for each interface. This will allow us to modify nexthops on link events. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-09-30Merge pull request #5009 from donaldsharp/interface_deletionRuss White
lib, zebra: Allow for interface deletion when kernel event happens