summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn.c
AgeCommit message (Collapse)Author
2022-06-21Zebra EVPN Debug: Fixing log flooding when disabling MLAG leaf configurationrvaratharaj
When disabling MLAG leaf configuration with EVPN, logs are getting flooded for each VNI, This is the result of each Type-2 packets. Ideally, this should be under log debugging, not a warning. Testing: UT Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2022-05-13zebra: remove unnecessary check for "zevpn_vrf"anlan_cs
The global vrf in zebra is always non-NULL. In general, it is bound to default vrf by `zebra_vrf_init()`, at other times bound to some specific vrf. Anyway, non-NULL. So remove all redundant checkings for the returned value of `zebra_vrf_get_evpn()`. Additionally, remove the unnecessary check for `zvrf` in `zebra_vxlan_cleanup_tables()`. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-03*: remove the checking returned value for hash_get()anlan_cs
Firstly, *keep no change* for `hash_get()` with NULL `alloc_func`. Only focus on cases with non-NULL `alloc_func` of `hash_get()`. Since `hash_get()` with non-NULL `alloc_func` parameter shall not fail, just ignore the returned value of it. The returned value must not be NULL. So in this case, remove the unnecessary checking NULL or not for the returned value and add `void` in front of it. Importantly, also *keep no change* for the two cases with non-NULL `alloc_func` - 1) Use `assert(<returned_data> == <searching_data>)` to ensure it is a created node, not a found node. Refer to `isis_vertex_queue_insert()` of isisd, there are many examples of this case in isid. 2) Use `<returned_data> != <searching_data>` to judge it is a found node, then free <searching_data>. Refer to `aspath_intern()` of bgpd, there are many examples of this case in bgpd. Here, <returned_data> is the returned value from `hash_get()`, and <searching_data> is the data, which is to be put into hash table. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-30zebra: use "assert" instead of unnecessary checkanlan_cs
Like `zvni_map_to_svi_ns()` for `ns_walk_func()`, just use "assert" instead of unnecessary check. Since these parameters for `ns_walk_func()`, e.g. `in_param` and others, must not be NULL. So use `assert` to ensure the these parameters, and remove those unnecessary checks. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-18zebra: minor changes on "zebra_evpn_mac_gw_macip_add" functionanlan_cs
Two minor changes: 1) Change `zebra_evpn_mac_gw_macip_add()` 's return type to `void`. 2) Since `zebra_evpn_mac_gw_macip_add()` has already `assert` the returned `mac`, the check of its return value makes no sense. And keep setting `mac->flags` inside `zebra_evpn_mac_gw_macip_add()` is more reasonable. So just move the setting `mac->flags` inside `zebra_evpn_mac_gw_macip_add()`. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-05zebra: Delay the usage of one variable until needanlan_cs
In the loop, local variable `ip` is always set even if the check condition is not satisfied. Avoid the redundant set, move this set exactly after the check condition is satisfied. Set `ip` only if the check condition is met, otherwise needn't. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-18zebra: Replace inet_ntop to %pI4/6 for JSON outputsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-15zebra: ignore sync updates from bgp if the dest ES is not readyAnuradha Karuppiah
In the window immediately after an ES deletion bgpd can send MAC-IP updates using that ES. Zebra needs to ignore these updates to prevent creation of stale entries. Ticket: #2668488 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_neigh` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_mac` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_vtep` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02zebra: Convert to `struct zebra_evpn` as per our internal standardDonald Sharp
We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp <sharpd@nvidia.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-07-19zebra: give some evpn apis better namesMark Stapp
Use more useful names for a few evpn apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-06-07bgpd, zebra: Add svi_interface to zebra VNI and bgp EVPN structuresAmeya Dharkar
SVI ifindex for L2VNI is required in BGP to perform EVPN type-5 to type-2 recusrsive resolution using gateway IP overlay index. Program this svi_ifindex in struct zebra_vni_t as well as in struct bgpevpn Changes include: 1. Add svi_if field to struct zebra_evpn_t 2. Add svi_ifindex field to struct bgpevpn 3. When SVI (bridge or VLAN) is bound to a VxLAN interface, store it in the zebra_evpn_t structure. 4. Add this SVI ifindex to ZEBRA_VNI_ADD 5. Store svi_ifindex in struct bgpevpn Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2021-05-09zebra: fix style warnings in previous commitsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-05zebra: Add some ability to know what hash is for what vniDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.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-14zebra: use printfrr exts in EVPN/VXLAN codeDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-19zebra: fix problem with SVI MAC not being sent to BGPAnuradha Karuppiah
For MH the SVI MAC is advertised to prevent flooding of ARP replies. But because of a bug the SVI MAC was being added to the zebra database but not sent to bgpd for advertising. Ticket: CM-33329 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.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-19zebra: fix problem with SVI IP being advertised even if disabledAnuradha Karuppiah
SVI IP is being advertised unconditionally i.e. even if disabled (and that is the default config). This can be problematic when the SVI address is re-used across racks. Added the user config condition in all the relevant places where the SVI advertisement is triggered. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-12-21zebra: accept bgp remote mac-ip update if the higher-seq-local mac is not ↵Anuradha Karuppiah
bgp-ready If a local-MAC or local-neigh is not active locally it is not sent to BGP. At this point if BGP rxes a remote route it accepts it and installs in zebra. Zebra was rejecting BGP's update if it had a higher seq local (inactive) entry. This would result in bgp and zebra falling out of sync. In some cases zebra would delete the local-inactive entries in sometime (as a part of the dplane/kernel garbage collection). This would leave zebra with missing remote entries (which were still present in bgpd). This change allows lower-seq BGP updates to overwrite zebra's local entry if that entry happens to be local-inactive. Note: This logic was already in use for sync-mac-ip updates. Extended the same logic to remote-mac-ip updates. Ticket: CM-31626 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-12-21zebra: clean zevpn references in the access bd database when the VNI is deletedAnuradha Karuppiah
When an VNI was deleted as a part of FRR/zebra shutdown the zevpn entry was being freed without removing its reference in the access vlan entry (i.e. without clearing the VLAN->VNI mapping) used by MH. Ticket: CM-31197 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-11-30zebra: Reduce warn -> debugDonald Sharp
During times of network trauma and when we are at large network scale the process_remote_macip_add function can issue a zlog_warn for a common occurrence. Modify the code to be a debug statement. This behavior is the same now as the process_remote_macip_del function Signed-off-by: Donald Sharp <sharpd@nvidia.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-18Merge pull request #7089 from pguibert6WIND/netns-refactorRuss White
Netns refactor
2020-09-15zebra: re-name some mh functions to make the code more readableAnuradha Karuppiah
As a part of the re-factoring some of the evpn_vni_es apis got re-named as evpn_evpn_es. Changed them to evpn_es_evi to make it common to vxlan and mpls. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-09-11zebra: support for macvlan interfacesPhilippe Guibert
mac vlan interfaces are supported in different network namespaces. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11lib, zebra: reuse and adapt ns_list walk functionalityPhilippe Guibert
the walk routine is used by vxlan service to identify some contexts in each specific network namespace, when vrf netns backend is used. that walk mechanism is extended with some additional paramters to the walk routine. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11zebra: local mac entries populated in correct netnamespacePhilippe Guibert
MAC address neighbours are read on the same netnamespace where the vxlan interface is. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11zebra: when parsing local entry against dad, retrieve configPhilippe Guibert
when duplicate address detection is observed, some incrementation, some timing mechanisms need to be done. For that the main evpn configuration is retrieved. Until now, the VRF that was storing the dad config parameters was the same VRF that hosted the VXLAN interface. With netns backend, this is not true, as the VXLAN interface is in the same VRF as the bridge interface. The modification takes same definition as in BGP, that is to say that there is a single bgp evpn instance, and this is that instance that will give the correct config settings. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11zebra: zvni_map_to_vlan() adaptation for all namespacesPhilippe Guibert
this change is needed when a MAC/IP entry is learned by zebra, and the entry happens to be in a different namespace. So that the entry be active, the correct vni match has to be found. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-18zebra: zvni_map_to_svi() adaptation for other network namespacesPhilippe Guibert
the function is called with all the network namespaces. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-18zebra: zvni_from_svi() adaptation for other network namespacesPhilippe Guibert
other network namespaces are parsed because bridge interface can be bridged with vxlan interfaces with a link in the default vrf that hosts l2vpn. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-12zebra: extract core EVPN functions from zebra_vxlan.cPat Ruddy
extract the core EVPN functions from zebra_vxlan.c and put them in a new file zebra_evpn.c. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-12zebra: clone zebra_vxlan.c to zebra_evpn.cPat Ruddy
clone zebra_vxlan.c to create a file zebra_evpn.c for core EVPN functions whilst retaining the history of zebra_vxlan.c Signed-off-by: Pat Ruddy <pat@voltanet.io>