summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn.c
AgeCommit message (Collapse)Author
2024-11-14zebra: Missed debug guard in zebra_evpn.cDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-11-13zebra: fix unguarded debug in evpn codeMark Stapp
Guard a debug in the evpn code. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-10-28zebra: use new per-NS iteration in zebra_evpnMark Stapp
Use the new per-NS interface iteration apis in the evpn module. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-09-20zebra: unlock if_table route_nodesMark Stapp
Must unlock if we break during iteration over any lib/table tree. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-09zebra: Use more appropriately sized stream packets for evpnDonald Sharp
When sending EVPN data, let's use more appropriately sized packets for the sending of data. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-02-26zebra: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-02-20zebra: Remove deprecated itemsDonald Sharp
Both zebra_evpn.c and zebra_vxlan.c have items that were deprecated a year ago. Let's remove them. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-22*: convert `struct interface->connected` to DLISTDavid Lamparter
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-13zebra: fix for unexpected fdb entry showing up during ifdown/ifup eventssharathr
Ticket: 2674793 Testing Done: precommit, evpn-min and evpn-smoke The problem in this case is whenever we are triggering ifdown followed by ifup of bridge, we see that remote mac entries are programmed with vlan-1 in the fdb from zebra and never cleaned up. bridge has vlan_default_pvid 1 which means any port that gets added will initially have vlan 1 which then gets deleted by ifupdown2 and the proper vlan gets added. The problem lies in zebra where we are not cleaning up the remote macs during vlan change. Fix is to uninstall the remote macs and then install them during vlan change. 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: Handle vni determination for non-vlan-aware bridgesSharath Ramamurthy
This patch addresses following - Remove unused VLAN Id parameter when trying to determine the VNI associated with a non-VLAN aware bridge. Also, add a check to ensure that in this case, we have a per-VNI VXLAN interface. Due to sequence of events, it is possible that we may have VLAN-VNI mappings, in which case the code should return gracefully. - With support for a container VXLAN interface that has VLAN-VNI mappings, the VXLAN interface itself may be up but a particular VNI might have been removed. Ensure that VNI mapping exists before proceeding with further processing. Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
2023-02-13zebra: Refactoring changes for zebra_evpn_map_vlan zebra_evpn_from_svi and ↵Sharath Ramamurthy
zl3vni_from_svi Today to find the vni for a given (vlan, bridge) we walk over all interfaces and filter the vxlan device associated with the bridge. With multiple vlan aware bridge changes, we can derive the vni directly by looking up the hash table i.e. the vlan_table of the associated (vlan, bridge) which would give the vni. During vrf_terminate() call zebra_l2_bridge_if_cleanup if the interface that we are removing is of type bridge. In this case, we walk over all the vlan<->access_bd association and clean them up. zebra_evpn_t is modified to record (vlan, bridge) details and the corresponding vty is modified to print the same. zevpn_bridge_if_set and zl3vni_bridge_if_set is used to set/unset the association. Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
2023-02-13zebra: vxlan interface refactoring changesSharath Ramamurthy
This change refactors the zebra_vxlan_if related functionality to a new zebra_vxlan_if.c file. zebra_vxlan_if_up/down, zebra_vxlan_if_add/update/del is moved zebra_vxlan_if.c 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-13zebra: data structure changes for single vxlan deviceSharath Ramamurthy
This changeset introduces the data structure changes needed for single vxlan device functionality. A new struct zebra_vxlan_vni_info encodes the iftype and vni information for vxlan device. The change addresses related access changes of the new data structure fields from different files zebra_vty is modified to take care of the vni dump information according to the new vni data structure for vxlan devices. 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-27zebra: fix JSON fields for show evpn vni detailPooja Jagadeesh Doijode
Few of the JSON field in show evpn vni detail command is confusing and a few fields were missing. Following is the updated output. primary# show evpn vni detail json [ { "vni":200, "type":"L2", "vrf":"default", "tenantVrf":"default", "vxlanInterface":"vni200", "ifindex":19, "vxlanIfindex":19, "sviInterface":"br200", "sviIfindex":18, "vtepIp":"2.2.2.1", "mcastGroup":"0.0.0.0", "advertiseGatewayMacip":"No", "advertiseSviMacip":"No", "numMacs":0, "numArpNd":0, "numRemoteVteps":1, "remoteVteps":[ { "ip":"2.2.2.2", "flood":"HER" } ] }, { "vni":100, "type":"L3", "vrf":"default", "tenantVrf":"default", "localVtepIp":"2.2.2.1", "vxlanIntf":"vni100", "sviIntf":"br100", "state":"Up", "sysMac":"aa:bb:cc:dd:ee:f1", "routerMac":"aa:bb:cc:dd:ee:f1", "vniFilter":"none", "l2Vnis":[ 20, 30, 200 ] } ] Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2022-10-11zebra: add some neigh del not found debugsStephen Worley
Add some neigh deletion debugs for when the neigh isn't found or there is a MAC mismatch on what was sent and found. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11bgpd,zebra,lib: bgp evpn vni macip into two tablesStephen Worley
Re-work the bgp vni table to use separately keyed tables for type2 routes. So, with type2 routes, we have the main table keyed off of the IP and a new MAC table keyed off of MACs. By separating out the two, we are able to run path selection separately for the neigh and mac. Keeping the two separate is also more in-line with what happens in zebra (they are managed comptletely seperate). With this change type2 routes go into each table like so: ``` Remote MAC-IP -> IP Table & MAC Table Remote MAC -> MAC Table Local MAC-IP -> IP Table Local MAC -> MAC Table ``` The difference for local is necessary because we should not ever allow multiple paths for a local MAC. Also cleaned up the commands for querying the vni tables: ``` show bgp vni all type ... show bgp vni VNI type ... ``` Old commands will be deprecated in a separate commit. Signed-off-by: Stephen Worley <sworley@nvidia.com>
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