Commit Graph

290 Commits

Author SHA1 Message Date
Anuradha Karuppiah
abfa0a9651 zebra: trigger SG update on l2-vni<=>mcast-grp changes
An SG entry is added (if one doesn't already exist) when a l2-VNI is
associated with a mcast-grp and local-vtep-ip.

And viceversa; when the last l2-vni using a MDT is removed the SG
entry is deleted.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:20 -07:00
Anuradha Karuppiah
015d264c85 zebra: vxlan (S, G) cache management
Based code for adding (S, G) entries. These entries are created when
a mcast-group and local-VTEP-IP is associated with and L2 VNI.

The parent (*, G) entries are created implicitly on the (S, G) addition
and play the role of termination entries.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:20 -07:00
Anuradha Karuppiah
8a93734c48 zebra: maintain mcast tunnel origination and termination SG entries
Each multicast tunnel is associated with a -
1. Tunnel origination mroute that is used for forwarding the
VxLAN encapsulated flow -
S - local VTEP-IP
G - BUM mcast-group
2. And a tunnel termination entry -
S - * (any remote VTEP)
G - BUM mcast-group

Multiple L2 VNIs can share the same BUM mcast group (and local-VTEP-IP).
Zebra maintains an mcast (SG) hash table to pass this info to pimd for
subsequent MDT setup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:20 -07:00
Anuradha Karuppiah
9718c54ef4 zebra: install flood FDB entry only if the remote VTEP asked for HER
Remote VTEPs advertise the flood mode via IMET and the ingress VTEP
needs to perform head-end-replication of BUM packets to it only if the
PMSI tunnel type is set to ingress-replication. If a type-3 route is not
rxed or rxed with a mode other than ingress-replication we can skip
installation of the flood fdb entry for that L2-VNI. In that case the
remote VTEP is either not interested in BUM traffic or is using a
"static-config" based replication mode like PIM.

Sample output with HER -
=======================
root@TORS1:~# vtysh -c "show evpn vni 1000" |grep "Remote\|flood"
 Remote VTEPs for this VNI:
  27.0.0.8 flood: HER
root@TORS1:~#

Sample output with PIM-SM -
=========================
root@TORS2:~# vtysh -c "show evpn vni 1000" |grep "Remote\|flood"
 Remote VTEPs for this VNI:
  27.0.0.7 flood: -
root@TORS2:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:20 -07:00
Anuradha Karuppiah
39c46ff136 zebra: maintain the mcast-grp per-l2vni
This info is propagated to bgpd for appropriate IMET route generation.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:19 -07:00
David Lamparter
7e3a1ec742 lib: ZEBRA_NUM_OF -> array_size
The latter is widely used, e.g. in the Linux kernel.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-18 12:44:29 +02:00
Kishore Aramalla
7a6ca8a6ae zebra: L3VNI's are allowed to unconfigure from any VRF
L3VNI configured in a specific VRF is allowed to unconfigure from any
VRF, including default (global) VRF. This results L3VNI delete notification
to BGP and subsequent type-5 route uninstall from the VRF the L3VNI belong to.
This also resulted in the inconsistent running configuration.

The deleted L3VNI still shows up in its original VRF. The VRF in which the
"no vni <x>" was executed doesn't display its own L3VNI.

Added a VRF check in zebra to prevent this.

Signed-off-by: Kishore Aramalla <karamalla@vmware.com>
2019-04-11 12:04:34 -07:00
Donald Sharp
06566f41f7
Merge pull request #3923 from Tuetuopay/evpn-session-vrf
Add support for EVPN session in the non-default VRF
2019-04-03 08:00:14 -04:00
Sri Mohana Singamsetty
2b4e2584b5
Merge pull request #4018 from chiragshah6/evpn_dev
zebra: evpn dup detect handle ip state change
2019-04-02 20:28:33 -07:00
Tuetuopay
d074383c62
Merge branch 'master' into evpn-session-vrf 2019-03-28 18:41:38 +01:00
Tuetuopay
0fb2ad05d9 zebra: Move the EVPN VRF pointer to zebra_router
It had no logical reason to be in the default VRF. This moves it to the
zebra_router, which is better suited to store global references.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-27 02:16:27 +01:00
Tuetuopay
986512a320 zebra: Change checks for EVPN VRF to a macro
A lot of checks relied on the VRF ID and the EVPN VRF ID to be the same.
This patch changes those checks to the EVPN_ENABLED macro, which checks
if the VRF is the EVPN one.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-27 02:13:16 +01:00
Chirag Shah
c34e362b7e zebra: evpn dup detect handle ip state change
For a MAC-IP pair generally local/netlink msg for
MAC is received followed by Neigh. The MAC can be detected as duplicate
during this event.
When a neigh update is received, the neigh inherits DUP flag from its
MAC and along with that mark the neigh as INACTIVE.
Also, In the case of DUP detected neigh, do not update its state
to ACTIVE before determining to send notification to bgpd.

There is a time when Neigh update received prior to MAC update.
In that case neigh is marked as inactive since its MAC is
still in REMOTE state. Once the MAC update is received and
it is detected as DUPLICATE, the neigh would inherit DUP flag
but remained in inactive state.

By fixing the first case, the neigh remains in inactive once
detected as DUPLICATE in both scenarios.

The unfreeze action would mark all inherited neighs to ACTIVE,
and clears DUP flag then sends notification to bgpd (to send type-2).

Ticket:CM-24339
Reviewed By:CCR-8451
Testing Done:
Validated dup detection on both environment where neigh and mac
notification can come as either one first.
With the fix, the neigh was remained in "inactive" state
once detected as duplicate.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-03-25 15:48:53 -07:00
Chirag Shah
55328d8aca zebra: add mac ip dad timers cleanup
When MAC or IP deleted ensure to cleanup DAD timers.

Signed-off-by: Chirag Shah <chirag@cumulusnetwork.com>
2019-03-22 17:12:16 -07:00
Tuetuopay
f920dd6dc9 bgpd, zebra: Redo checks to advertise_all_vni
This replaces manual checks of the flag with a wrapper macro to convey
the meaning "is evpn enabled on this vrf?"

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-22 13:37:06 +01:00
Tuetuopay
77b998fbf0 zebra: Fixes following srimohans' advice
Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-22 11:18:31 +01:00
Tuetuopay
cff8f33b61 zebra: Lookup dad and replication settings from EVPN VRF
Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-22 11:08:01 +01:00
Tuetuopay
5e53dce31e bgpd, zebra: Rename variables of EVPN instance
Rename {bgp,zvrf}_def{ault} to {bgp,zvrf}_evpn where it makes sense,
i.e. when they contain the EVPN instance.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:25 +01:00
Tuetuopay
a0b0b5c866 zebra/vxlan: Filter zapi messages with EVPN VRF
Since the EVPN VRF may not be the default one, compare received
messages' VRF agains the EVPN VRF and not the Default.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:25 +01:00
Tuetuopay
2118e6a9b4 zebra/vxlan: Associate L3VNIs to EVPN VRF
This uses the EPVN VRF to store L3VNIs hashes, and looks up L2VNIs in
this VRF as they are stored there.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:25 +01:00
Tuetuopay
43779a1127 zebra/vxlan: Send type-2/3 to EVPN BGP instance
This sends local VNIs and local MAC addresses to the BGP instance
responsible for EVPN rather than the default one.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:25 +01:00
Tuetuopay
530db8dc03 bgpd, zebra: Scope EVPN commands to EVPN VRF
If the EVPN VRF is not the default one (i.e. with advertise-all-vni),
this allows showing its information with `show bgp l2evpn evpn ...`
commands. They do not require adding `vrf VRFNAME` since we only
support a single EVPN VRF. The same is true for zebra-specific commands
(e.g. `show evpn ...`).

Configuration commands are not restricted to the default VRF but to
the EVPN one, that is to the one bearing `advertise-all-vni`.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:25 +01:00
Tuetuopay
150971b5ec zebra: Store the EVPN VRF in the default VRF
The EVPN VRF is defined by bgpd, and is the one vrf where
`advertise-all-vni` is present.

Signed-off-by: Tuetuopay <tuetuopay@me.com>
Sponsored-by: Scaleway
2019-03-19 11:56:25 +01:00
Anuradha Karuppiah
d346c2e955 zebra: EVPN DAD trigger was causing zebra to crash
Duplicate address detection and recovery was relying on the l2-vni backptr
in the neighbor entry which was simply not initialized resulting in
a NULL pointer access in a setup with dup-addressed VMs -
VM1:{IP1,M1} and VM2:{IP1,M2}

Call stack:
(gdb) bt 6
    at lib/sigevent.c:249
    nbr=nbr@entry=0x559347f901d0, vtep_ip=..., vtep_ip@entry=..., do_dad=do_dad@entry=true,
    is_dup_detect=is_dup_detect@entry=0x7ffc7f6be59f, is_local=is_local@entry=true)
    at ./lib/ipaddr.h:86
    ip=0x7ffc7f6be6f0, ifp=0x559347f901d0, zvni=0x559347f86800) at zebra/zebra_vxlan.c:3152
(More stack frames follow...)
(gdb) p nbr->zvni
$8 = (zebra_vni_t *) 0x0 <<<<<<<<<<<<<<<<<<<<
(gdb)

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-03-15 09:29:25 -07:00
Donald Sharp
28bd0652ac zebra: Add some debugs to neighbor entry processing
When we get a neighbor entry in zebra we start processing it.
Let's add some additional debugs to the processing so that when
it bails out and we don't use the data, we know the reason.
This should help in debugging the problems from why bgp does
not appear to have data associated with a neighbor entry
in the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-08 10:46:55 -05:00
David Lamparter
86a1266c9c
Merge pull request #3853 from donaldsharp/partial_revert
zebra: Prevent crash in dad auto recovery
2019-03-06 16:00:40 +01:00
David Lamparter
d3b05897ed
Merge pull request #3869 from qlyoung/cocci-fixes
Assorted Coccinelle fixes
2019-03-06 15:54:44 +01:00
Sri Mohana Singamsetty
29da198289
Merge pull request #3882 from vivek-cumulus/refine_evpn_route_add
Refine install of EVPN-based routes to remove some special handling
2019-03-01 09:15:26 -08:00
vivek
0483af6e4c zebra, bgpd: Exchange L3 interface for VRF's VNI
In the case of EVPN symmetric routing, the tenant VRF is associated with
a VNI that is used for routing and commonly referred to as the L3 VNI or
VRF VNI. Corresponding to this VNI is a VLAN and its associated L3 (IP)
interface (SVI). Overlay next hops (i.e., next hops for routes in the
tenant VRF) are reachable over this interface.

https://tools.ietf.org/html/draft-ietf-bess-evpn-prefix-advertisement
section 4.4 provides additional description of the above constructs.

The implementation currently derives this L3 interface for EVPN tenant
routes using special code that looks at route flags. This patch
exchanges the L3 interface between zebra and bgpd as part of the L3-VNI
exchange in order to eliminate some this special code.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-27 11:52:34 +00:00
Quentin Young
2bcb1a7fcb zebra: fix style for 7d9ee1
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-26 19:24:47 +00:00
Russ White
24ee026b1a
Merge pull request #3865 from qlyoung/fix-zebra-vxlan-smelly-strings
zebra: replace strncpy with strlcpy
2019-02-26 11:08:18 -05:00
Quentin Young
0a22ddfbb1 *: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Quentin Young
138a496596 zebra: remove all instances of strncpy
We have strlcpy.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 17:52:37 +00:00
Tim Bray
e3b78da875 *: Rename backet to bucket
Presume typo from original author

Signed-off-by: Tim Bray <tim@kooky.org>
2019-02-25 16:22:36 +00:00
Donald Sharp
8a3bc58ed8 zebra: Prevent crash in dad auto recovery
Commit: 6005fe55bc
Introduced a crash with zebra looking up either the
nbr structure or the mac structure.  This is because
the zvni used is NULL and we eventually call a hash_lookup
call that would cause a NULL dereference.  Partially
revert this commit to original behavior.

Problems found via clang Static Analyzer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-22 19:23:27 -05:00
Chirag Shah
278e26de8e zebra: advertise svi ip as macip route changes
In Asymmetric and symetric routing scenario in EVPN
where each VTEP pair having different set of addresses
for the SVIs.
This knob allows reachability (ping connectivity) of
SVI IPs and resolve ARP resoultion VTEPs across racks.

This knob should not be used when same SVI IPs configured
on VTEPs across racks or when advertise default gateway
is configured.

Ticket:CM-23782
Testing Done:
Bring up EVPN symmetric routing topology with different
SVI IPs on different VTEPs. Enable advertise svi ip
at each VTEP, remote VTEPs installs arp entry for
SVI IPs via EVPN type-2 route exchange.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-02-06 19:57:53 -08:00
Russ White
37a5432422
Merge pull request #3688 from chiragshah6/evpn_dev
zebra: EVPN probe local inactive neigh/arp entry upon mac mobility
2019-02-05 10:48:33 -05:00
Russ White
0848547352
Merge pull request #3679 from chiragshah6/evpn_dev2
zebra: reinstate bgp evpn remote route on local evpn route delete
2019-02-05 10:47:35 -05:00
Donald Sharp
3801e7646c zebra: Move the master thread handler to the zrouter structure
The master thread handler is really part of the zrouter structure.
So let's move it over to that.  Eventually zserv.h will only be
used for zapi messages.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31 09:20:46 -05:00
Chirag Shah
44bc8ae550 zebra: probe local inactive neigh
In extended-mobility case ({IP1, MAC} binding),
when a MAC moves from local to remote, binding
changes to {IP2, MAC}, local neigh (IP1) marked
as inactive in frr.
The evpn draft recommends to probe the entry once
local binding changes from local to remote.
Once the probe is set for the local neigh entry,
kernel will attempt refresh the entry via sending
unicast address resolution message, if host does not
reply, it will mark FAILED state.
For FAILED entry, kernel triggers delete neigh
request, which result in frr to remove inactive entry.

In absence of probing and aging out entry,
if MAC moves back to local with {IP3, MAC},
frr will mark both IP1 and IP3 as active and sends
type-2 update for both.
The IP1 may not be active host and still frr advertises
the route.

Ticket:CM-22864
Testing Done:

Validate the MAC mobilty in extended mobility scenario,
where local inactive entry gets removed once MAC moves
to remote state.
Once probe is set to the local entry, kernel triggers
reachability of the neigh/arp entry, since MAC moved remote,
ARP request goes to remote VTEP where host is not residing,
thus local neigh entry goes to failed state.
Frr receives neighbor delete faster and removes the entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-29 10:23:19 -08:00
Russ White
1553085aa7
Merge pull request #3678 from chiragshah6/evpn_dev1
zebra: EVPN fix duplicate address detection remote macip add case
2019-01-29 10:05:50 -05:00
Chirag Shah
280c70eab2 zebra: reinstate bgp route on local delete
Neigh detected duplicate detected during local update,
upon receiving kernel neigh delete, set neigh inactive
flag so BGPd can install remote route entry if present.

Only if freeze action enabled, local duplicate detected
entry will not be present in BGPd thus marking neigh
inactive is safe. BGPd will simply attempt install
remote entry if present.

Ticket:CM-23438
Testing Done:
Validated MAC-IP pair, trigger mobility of between two
VTEPs, upon local freeze perform neigh delete which
triggers BGP to install remote type-2 route into kernel.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-25 16:06:18 -08:00
Chirag Shah
753ad4fef8 zebra: fix dup addr detect remote macip add case
A MACIP is detected as duplicate and after that
the host continue to move behind different VTEPs results
in local VTEP receiving remote mobility events.
In remote_macip_add, ensure to trigger dad if
MAC is marked as duplicate. In case of freeze
action enabled, is_dup_detect will be set to
avoids installing frozen MAC into kernel.

Ticket:CM-23649
Testing Done:
Configured detection action freeze with detection count
as 7 at DUT and >7 at remote VTEP,
trigger MAC-IP mobility between VTEPs.
once tdetection count reached, MAC detected as duplicate,
post detection move the host to remote. The local VTEP
receives remote macip add and entry is not installed into
kernel with fix.

root@VTEP1:~# net show evpn mac vni 1002 mac aa:aa:aa:aa:aa:aa
MAC: aa:aa:aa:aa:aa:aa
Remote VTEP: 27.0.0.16
Local Seq: 7 Remote Seq: 8
Duplicate, detected at Fri Jan 25 05:03:29 2019
Neighbors:
11.11.11.11 Inactive

Kernel entry still points to LOCAL
root@VTEP1:~# bridge fdb show | grep aa:aa:aa
aa:aa:aa:aa:aa:aa dev hostbond3 vlan 1002 master VxLanA-1

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-25 12:42:52 -08:00
Anuradha Karuppiah
2c476b72a0 zebra: propagate inactive neigh deletes to bgpd
When a local neigh is added with a MAC that is remote or absent the
neigh is kept in zebra as local/in-active. But not propagated to bgpd.
Similarly when an inactive neigh is deleted the del-msg is not propagated
to bgpd.

Without this change bgp and zebra would fall out of sync as that
bgp would not know to rerun bestpath and for it to reinstall a
known remote path for the mac-ip in question.  To fix this we
now propagate inactive neigh deletes to bgpd.

Ticket: CM-23018
Testing Done:
1. evpn-min
2. manually triggered the out-of-sync state and verified the fix

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-01-25 14:19:26 -05:00
Ruben Kerkhof
4d762f2607 Treewide: use ANSI function definitions
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-01-24 11:21:59 +01:00
Russ White
262d4dda2a
Merge pull request #3508 from chiragshah6/evpn_dev2
zebra: EVPN remote entry delete check local entry presence
2019-01-23 13:44:46 -05:00
Renato Westphal
c5991ff3e4
Merge pull request #3564 from chiragshah6/evpn_dev1
zebra: use default vrf_id for zvrf reference
2019-01-14 10:50:20 -02:00
Chirag Shah
d419965766 zebra: dup addr detect fix clear mac command
For neigh check duplicate flag as it can be inherited from
duplicate detected MAC (count could be 0).

Ticket:CM-23316

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-07 10:37:20 +01:00
Chirag Shah
a4445ecefe zebra: evpn dup addr detect fix unfreeze action
Below are cases where EVPN duplicate detection
Freeze and Unfreeze required fixes:

Auto recovery needs to check neighbor's duplicate flag
to take action, as neigh could be marked duplicate
via inherited from MAC where IP detection count could be 0.

MAC duplicate detection needs to set flag to true
if freeze action is configured.

Local MAC add update should not send update to bgp
if MAC is in frozen state.

Remote MAC-IP update should not process neigh update if MAC
is detected as duplicate during remote update.

Ticket:CM-23344
Testing Done:
Trigger duplicate detection via both local and remote update trigger,
Validate clear command and other changes expected behavior.

Auto-recovery takes appropriate action on inherited IPs.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-07 10:37:20 +01:00
Chirag Shah
6005fe55bc zebra: use default vrf_id for zvrf reference
Duplicate address detection should operate
at default vrf instance.
For mac and neigh show command, auto recovery and few places
where tanent vrf_id used for zvrf instead use default
vrf instance. Use vxlan_if's or VRF_DEFAULT vrf_id to
fetch zebra's default vrf instance.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-01-03 11:11:47 -08:00
Chirag Shah
67fb9374dc zebra: evpn remote delete fetch local entry
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-12-31 14:40:31 -08:00
Philippe Guibert
08ab35fe0e zebra: the default vrf name in vxlan is correctly set
the default vrf name was hardset to "Default", whereas the default vrf
name could have been configured in an other manner. Fix this
inconsistency.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-12-17 18:58:05 +01:00
Philippe Guibert
6548050a85 zebra: avoid initialising more than one the l3vni hash structure
the l3vni structure is allocated only once, since that structure is only
used for default netns. For that, move the initialisation part is moved
to a proper place, where there is no risk of attempting to initialise it
more than once, even when vrf backend is netns.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-12-17 12:09:52 +01:00
Sri Mohana Singamsetty
ad31e8d398
Merge pull request #3372 from nitinsoniism/show_evpn_mac_vni_all_detail
zebra: Add "show evpn mac vni all detail" command
2018-12-04 10:19:18 -08:00
David Lamparter
21e2819dbf
Merge pull request #3340 from nitinsoniism/show_evpn_vni_detail
zebra: Add "show evpn vni detail" command
2018-12-04 17:29:50 +01:00
Chirag Shah
1883de666f zebra: dup addr detect clear cmd non-zero return
Clear dup address vni needs to return non-zero value
in case of command is not successful.

Ticket:CM-23122
Testing Done:
run clear command and check upon failure return code is non-zero.

root@TORS1:~# vtysh -c "clear evpn dup-addr vni 1000 ip 45.0.1.26"
% Requested IP's associated MAC 00:01:02:03:04:05 is still in duplicate
% state
root@TORS1:~# echo $?
1

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-12-03 16:56:00 -08:00
Nitin Soni
e3fac9195d zebra: Add "show evpn arp-cache vni all detail" command
Change helps display detailed output for all possible VNI neighbors
without specifying VNI and ip. It helps in troubleshooting as a single
command can be fired to capture detailed info on all VNIs.

Ticket: CM-22832
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8034
2018-11-27 05:56:56 -08:00
Nitin Soni
cffe7580fd zebra: Add "show evpn mac vni all detail" command
Change helps display detailed output for all possible VNI MACs without
specifying VNI or mac. It helps in troubleshooting - a single
command can be fired to capture detailed info on all VNIs.
Also fixed and existing json related bug where json object is created by
a parent function and freed in child function.

Ticket: CM-22832
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8028
2018-11-27 05:44:48 -08:00
Nitin Soni
09af6961d4 zebra: Add "show evpn vni detail" command
Change helps display detailed output for all possible VNIs without
specifying VNI. It helps in troubleshooting - a single command can
be fired to capture detailed info on all VNIs.

Ticket: CM-22831
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8013
2018-11-21 08:13:01 -08:00
Chirag Shah
bdca1974e1 zebra: dup addr detect mac consolidation
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 22:30:17 -08:00
Chirag Shah
7510e45925 zebra: dup addr detect neigh consolidation
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 22:14:11 -08:00
Chirag Shah
979777b2d7 bgp, zebra: address review comments
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
61d46edaa6 zebra: dup addr detect add fields to show evpn cmd
TOR# show evpn
L2 VNIs: 5
L3 VNIs: 0
Advertise gateway mac-ip: No
Duplicate address detection: Enable
  Detection max-moves 5, time 180

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
37a040400d zebra: dup addr detect fix warnings
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
09de9258a9 zebra: dup addr detect clear command
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
1374d4dbc2 zebra: dup addr detect operation commands
Display duplicate detected list of MACs and VNIs.
- Per VNI
- Across all VNIs

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
87454e6bd1 lib, zebra: dup addr detect display detection fields
Display following Per MAC and Neigh's output:
If duplicate address detection is under process,
display detection start time and detection count.
If duplicate address detection detected an address
as duplicate, display detection time and duplicate
status.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
c80a972c9a zebra: dup addr detect freeze action
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
e22a946a89 zebra: dup addr detect warn-only
Duplicate address detection warning only action
upon an address detected as duplicate.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
3950b52c54 zebra: dup addr detect zapi changes
EVPN Duplicate Address Detection (DAD)
zapi information

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:16 -08:00
Russ White
2379dbecbd
Merge pull request #3202 from donaldsharp/evpn_dump
Evpn dump
2018-11-08 18:13:27 -05:00
Russ White
7c32c1dc10
Merge pull request #3255 from dslicenc/show_evpn_mac_json
zebra: add json support to show evpn mac vni <num> mac <mac>
2018-10-31 21:47:18 -04:00
Anuradha Karuppiah
f3a930da15 zebra: set remoteseq to 0 when remote mac is deleted by bgpd
When the remote mac is deleted by bgpd we can end up with an auto mac
entry in zebra if there are neighs referring to the mac. The remote sequence
number in the auto mac entry needs to be reset to 0 as the mac entry may
have been removed on all VTEPs (including the originating one).

Now if the MAC comes back on a remote VTEP it may be added with MM=0 which
 will NOT be accepted if the remote seq was not reset in the previous step.

Ticket: CM-22707

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-10-31 06:23:32 -04:00
Anuradha Karuppiah
4fd5ea4b3e zebra: make neigh active when it is modified from local to remote
This is a fixup to commit -
f32ea5c07 - zebra: act on kernel notifications for remote neighbors

The original commit handled a race condition between kernel and zebra
that would result in an inconsistent state i.e.
kernel has an offload/remote neigh
zebra has a local neigh

The original commit missed setting the neigh to active when zebra
tried to resolve the inconsistency by modifying the local neigh to
remote neigh on hearing back its own kernel update. Fixed here.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>

Ticket: CM-22700
2018-10-31 06:23:32 -04:00
Anuradha Karuppiah
e98e4b8899 zebra: send a local-mac del to bgpd on mac mod to remote
When events cross paths between bgp and zebra bgpd could end up with a
dangling local MAC entry. Consider the following sequence of events on
rack-1 -
1. MAC1 has MM sequence number 1 and points to rack-3
2. Now a packet is rxed locally on rack-1 and rack-2 (simultaneously) with
source-mac=MAC1.
3. This would cause rack-1 and rack-2 to set the MM seq to 2 and
simultaneously report the MAC as local.
4. Now let's say on rack-1 zebra's MACIP_ADD is in bgpd's queue. bgpd
accepts rack-3's update and sends a remote MACIP add to zebra with MM=2.
5. zebra updates the MAC entry from local=>remote.
6. bgpd now processes zebra's "stale local" making it the best path.
However zebra no longer has a local MAC entry.

At this point bgpd and zebra are effectively out of sync i.e. bgpd has a
local-MAC which is not present in the kernel or in zebra.

To handle this window zebra should send a local MAC delete to bgpd on
modifying its cache to remote.

Ticket: CM-22687
Reviewed By: CCR-7935

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2018-10-31 06:23:32 -04:00
Don Slice
2961101952 zebra: remove space from json string for show evpn mac vni <num> mac <mac>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-10-29 17:16:14 +00:00
Don Slice
24cdbd0d8b zebra: add json support to show evpn mac vni <num> mac <mac>
Added the json output capability in order to improve troubleshooting
capabilities.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-10-29 13:09:31 +00:00
David Lamparter
00b7a9ddfe
Merge pull request #2926 from donaldsharp/router
zebra_ns split up
2018-10-26 22:24:15 +02:00
David Lamparter
0437e10517 *: spelchek
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25 20:10:57 +02:00
Donald Sharp
89272910f7 zebra: Start breakup of zns into zrouter and zns
The `struct zebra_ns` data structure is being used
for both router information as well as support for
the vrf backend( as appropriate ).  This is a confusing
state.  Start the movement of `struct zebra_ns` into
2 things `struct zebra_router` and `struct zebra_ns`.

In this new regime `struct zebra_router` is purely
for handling data about the router.  It has no knowledge
of the underlying representation of the Data Plane.

`struct zebra_ns` becomes a linux specific bit of code
that allows us to handle the vrf backend and is allowed
to have knowledge about underlying data plane constructs.

When someone implements a *bsd backend the zebra_vrf data
structure will need to be abstracted to take advantage of this
instead of relying on zebra_ns.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-24 06:52:07 -04:00
Donald Sharp
74df8d6d9d *: Replace hash_cmp function return value to a bool
The ->hash_cmp and linked list ->cmp functions were sometimes
being used interchangeably and this really is not a good
thing.  So let's modify the hash_cmp function pointer to return
a boolean and convert everything to use the new syntax.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-19 13:14:45 -04:00
Donald Sharp
27fa33984b *: Fixup to use proper list_cmp functions
We had a variety of issues with sorted list compare functions.
This commit identifies and fixes these issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-19 13:14:43 -04:00
Donald Sharp
fbac9605a7 lib, zebra: Allow the specification of BUM flooding
Allow the modification of whether or not we will allow
BUM flooding on the vxlan bridge.  To do this allow
the upper level protocol to specify via the ZEBRA_VXLAN_FLOOD_CONTROL
zapi message.

If flooding is disabled then BUM traffic will not be forwarded
to other VTEP's.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-11 20:22:19 -04:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
F. Aragon
4848ef7430
bfdd zebra: dead code (Coverity 1472624 1473199)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-26 17:50:33 +02:00
Donald Sharp
98efddf1d7 zebra: Cleanup comments to appropriately match style
The block comments from a couple commits were not following
proper style.  Fix.

Fix SA warning that had snuck in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-18 10:44:59 -04:00
vivek
66e3798747 zebra: Fix neighbor update to BGP
Ensure that when the is_router condition changes for a locally learnt
neighbor, it is informed to BGP only if it is active i.e., the MAC is
also locally learnt.

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:
1. Failed test
2. vxlan_routing_test.py
2018-09-18 10:41:53 -04:00
vivek
a37f4598d7 zebra: Use boolean for certain VxLAN-EVPN flags
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-18 10:41:53 -04:00
vivek
fe697c6be5 zebra: Uninstall remote MACs from kernel appropriately
When a remote MAC goes away, but there are neighbors referring to it,
ensure that when the last remote neighbor goes away, the MAC is
uninstalled from the kernel and no longer considered as remote.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by:   Chirag Shah <chirag@cumulusnetworks.com>

Ticket: CM-22130
Reviewed By: CCR-7777
Testing Done:
1. Replicated failed scenario and verified with fix.
2. evpn-min
2018-09-18 10:41:53 -04:00
vivek
d63c1b18b4 zebra: Remove unused parameter in MAC delete
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-09-18 10:41:53 -04:00
Lou Berger
b4657ea44c
Merge pull request #3031 from pacovn/static_analysis__Wcomma
bgpd isisd zebra: misuse of comma operator
2018-09-17 06:03:49 -04:00
F. Aragon
1445b43c41
bgpd isisd zebra: misuse of comma operator
Detected using ./configure CFLAGS=-Wcomma CC=clang

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-14 15:55:56 +02:00
Quentin Young
1c50c1c0d6 *: style for EC replacements
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:38:57 +00:00
Quentin Young
e914ccbe9c zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRA
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:23:29 +00:00
David Lamparter
e991eff5b5 Merge remote-tracking branch 'frr/master' into warnings
Conflicts:
	zebra/if_ioctl_solaris.c
	zebra/rtread_getmsg.c

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-12 21:58:39 +02:00
David Lamparter
18b43e554e
Merge pull request #2981 from donaldsharp/v6_vxlan_bug
zebra: Fix RB-Tree storage comparison function for v6
2018-09-08 17:35:20 +02:00
Quentin Young
9df414feeb zebra: flog_warn conversion
Convert Zebra to user error subsystem.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06 20:56:38 +00:00
Russ White
7f0f6e7b75
Merge pull request #2873 from vivek-cumulus/evpn-extended-mobility
EVPN extended mobility support
2018-09-05 18:09:31 -04:00
Donald Sharp
2acc231024 zebra: Fix RB-Tree storage comparison function for v6
The RB-Tree used to store rmac information was not properly
handling the v6 address family.  Modify the code to allow
this handling.

Cleans up this error message:

zebra[2231]: host_rb_entry_compare: Unexpected family type: 10

That is being seen, This fixes some connectivity issues being seen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-05 17:04:35 -04:00
Don Slice
088f109866 bgpd, ospfd, pimd, zebra: Convert more use_json locations to bool
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-09-04 17:39:04 +00:00