Commit Graph

290 Commits

Author SHA1 Message Date
Don Slice
9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
vivek
bf437f900d zebra: Fix warnings
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-08-28 01:39:13 +00:00
vivek
f190902f52 Merge remote-tracking branch 'upstream/master' into evpn-extended-mobility
Conflicts:
	zebra/zebra_vxlan.c
2018-08-27 22:13:30 +00:00
Donald Sharp
f7dae31211 zebra: No prototype and uninited variables
Add a header to cleanup no declaration and properly
wrapper some variables to appropriate #ifdef.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-25 19:13:32 -04:00
Chirag Shah
7d08917b32 zebra: mark router flag for remote neigh update
Handle Remote Neigh entry state change from Router to Host.

Remote MAC-IP update may not continue EVPN NA Extended community,
Zebra need to accomodate if router_flag change for existing neigh
and install with or without Router Flag (R-bit).

Testing:
Have locally run MAC/IP (neigh entry) with R-bit set,
Checke on remote VTEP 'show bgp evpn route ...mac ip' and
'show evpn arp-cache ...' contians router flag.

Change host to remove R-bit, which locally learnt entry removes
Router flag. This results in remote vtep to remove R-bit from
neigh entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-08-22 15:34:53 -07:00
Chirag Shah
29c2ce7cfc zebra: check router_flag change for neigh update
Neigh update can have router_flag change, from unset to set and
viceversa. This is the case where MAC, IP and VLAN are same but
entry's flag moved from R to not R bit and reverse case.

Router flag change needs to trigger bgpd to inform all evpn peers
to remove from the evpn route.

Testing Done:
Send GARP with and without R bit from host and validate neigh entry
and evpn neigh and  mac-ip route entry in zebra and bgpd.

Check Peer VTEP evpn route entry where router flag is (un)set.
With R-bit

Route [2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
VNI 1001
Imported from
27.0.0.16:5:[2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
   4435 5551
27.0.0.16 from MSP1(uplink-1) (27.0.0.9)
   Origin IGP, valid, external, bestpath-from-AS 4435, best
   Extended Community: RT:5551:1001 ET:8 ND:Router
   Flag
   AddPath ID: RX 0, TX 1261
   Last update: Wed Aug 15 20:52:14 2018

Without R-bit

Route [2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
VNI 1001
Imported from
27.0.0.16:5:[2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
   4435 5551
27.0.0.16 from MSP2(uplink-2) (27.0.0.10)
   Origin IGP, valid, external, bestpath-from-AS 4435, best
   Extended Community: RT:5551:1001 ET:8
   AddPath ID: RX 0, TX 1263
   Last update: Wed Aug 15 20:53:10 2018

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-08-22 15:29:02 -07:00
Chirag Shah
54c174250c zebra: mark router flag for neigh update
The neigh update can come prior to mac add update.
In this case, the mac will be auto created for the vni.
set router flag to local neigh update for mac with auto flag.

The neigh update will be informed to bgpd once local mac is learnt.

Unset router flag if the neigh update comes without the router flag
for an existing neigh entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-08-22 13:18:53 -07:00
vivek
9df2b997b9 bgpd, zebra: Fix warnings
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-08-21 00:08:24 +00:00
vivek
1a8c5c38aa zebra: Enhancements to EVPN operational commands
Enhance the EVPN MAC and Neighbor cache display to show additional
information such as the mobility sequence numbers and the state.
Ensure that the neighbor state is set in a couple of places so
that the display is correct.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-08-20 20:00:50 +00:00
vivek
f07e1c99d6 bgpd, zebra: EVPN extended mobility support
Implement procedures similar to what is specified in
https://tools.ietf.org/html/draft-malhotra-bess-evpn-irb-extended-mobility
in order to support extended mobility scenarios in EVPN. These are scenarios
where a host/VM move results in a different (MAC,IP) binding from earlier.
For example, a host with an address assignment (IP1, MAC1) moves behind a
different PE (VTEP) and has an address assignment of (IP1, MAC2) or a host
with an address assignment (IP5, MAC5) has a different assignment of (IP6,
MAC5) after the move. Note that while these are described as "move" scenarios,
they also cover the situation when a VM is shut down and a new VM is spun up
at a different location that reuses the IP address or MAC address of the
earlier instance, but not both. Yet another scenario is a MAC change for an
attached host/VM i.e., when the MAC of an attached host changes from MAC1 to
MAC2. This is necessary because there may already be a non-zero sequence
number associated with MAC2. Also, even though (IP, MAC1) is withdrawn before
(IP, MAC2) is advertised, they may propagate through the network differently.

The procedures continue to rely on the MAC mobility extended community
specified in RFC 7432 and already supported by the implementation, but
augment it with a inheritance mechanism that understands the relationship
of the host MACIP (ARP/neighbor table entry) to the underlying MAC (MAC
forwarding database entry). In FRR, this relationship is understood by the
zebra component which doubles as the "host mobility manager", so the MAC
mobility sequence numbers are determined through interaction between bgpd
and zebra.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2018-08-20 19:20:06 +00:00
vivek
8b44d564c3 zebra: Update neighbor state correctly upon move
When a host moves and is locally reachable, if the local neighbor event
is received before the local MAC event, flag the neighbor as inactive
just as would happen in the case of a new host. This ensures that the
MACIP route will get originated as soon as the local MAC event is got.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-08-20 18:21:21 +00:00
Russ White
4b0d7894cb
Merge pull request #2846 from donaldsharp/backet_data
Backet data
2018-08-16 11:32:41 -04:00
Donald Sharp
9ea660be3a zebra: Trust backet->data
The backet->data cannot be NULL, no need to check for it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-15 17:53:09 -04:00
Quentin Young
af4c27286d *: rename zlog_fer -> flog_err
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Quentin Young
43e52561b4 zebra, lib: error references for zebra
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
0ce1ca805d *: ALLOC calls cannot fail
There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening.  So we can safely remove all of this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 17:14:58 +02:00
Chirag Shah
63ce2ee70c zebra: display consistant mac count
show evpn mac vni all
show evpn mac vni x
does not display local svi and anycast mac into count.

Ticket:CM-20456
Testing Done:

Before:

TOR1# show evpn mac vni 1008
Number of MACs (local and remote) known for this VNI: 4
MAC               Type   Intf/Remote VTEP      VLAN
44:38:39:00:6b:4c local  vlan1008              1008
00:02:00:00:00:04 local  hostbond5             1008
00:02:00:00:00:02 local  hostbond4             1008
00:00:5e:00:01:01 local  vlan1008-v0           1008
00:02:00:00:00:0c remote 27.0.0.15
00:02:00:00:00:0a remote 27.0.0.15
dell-s6000-07#

After:

TOR1# show evpn mac vni 1008
Number of MACs (local and remote) known for this VNI: 6
MAC               Type   Intf/Remote VTEP      VLAN
44:38:39:00:6b:4c local  vlan1008              1008
00:02:00:00:00:04 local  hostbond5             1008
00:02:00:00:00:02 local  hostbond4             1008
00:00:5e:00:01:01 local  vlan1008-v0           1008
00:02:00:00:00:0c remote 27.0.0.15
00:02:00:00:00:0a remote 27.0.0.15

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-28 11:23:10 -07:00
Russ White
bbc7adf1b4
Merge pull request #2665 from chiragshah6/evpn_dev
bgpd: support evpn nd ext community
2018-07-24 11:55:08 -04:00
Chirag Shah
68e331515e bgpd: support evpn nd ext community
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-17 13:06:41 -07:00
Anuradha Karuppiah
51f4dab426 zebra: install EVPN gateway MAC as static/sticky
SVI interface ip/hw address is advertised by the GW VTEP (say TORC11) with
the default-GW community. And the rxing VTEP (say TORC21) installs the GW
MAC as a dynamic FDB entry. The problem with this is a rogue packet from a
server with the GW MAC as source can cause a station move resulting in
TORC21 hijacking the GW MAC address and blackholing all inter rack traffic.

Fix is to make the GW MAC "sticky" pinning it to the GW VTEP (TORC11). This
commit does it by installing the FDB entry as static if the MACIP route is
received with the default-GW community (mimics handling of
mac-mobility-with-sticky community)

Sample output with from TORC12 with TORC11 setup as gateway -
root@TORC21:~# net show evpn mac vni 1004 mac 00:00:5e:00:01:01
MAC: 00:00:5e:00:01:01
 Remote VTEP: 36.0.0.11 Remote-gateway Mac
 Neighbors:
    45.0.4.1
    fe80::200:5eff:fe00:101
    2001:fee1:0:4::1

root@TORC21:~# bridge fdb show |grep 00:00:5e:00:01:01|grep 1004
00:00:5e:00:01:01 dev vx-1004 vlan 1004 master bridge static
00:00:5e:00:01:01 dev vx-1004 dst 36.0.0.11 self static
root@TORC21:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Ticket: CM-21508
2018-07-09 17:44:44 -07:00
paco
ee496c3b87
zebra: resource leak fix (Coverity 1453454)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-08 19:18:49 +02:00
Russ White
c96dfcb980
Merge pull request #2385 from donaldsharp/SA_SA_SA
Some small clang 6.0 cleanups
2018-06-08 06:57:30 -04:00
Russ White
49eeb60a70
Merge pull request #2123 from qlyoung/zserv-mt
Multithreaded Zserv
2018-06-08 06:47:14 -04:00
Donald Sharp
b1599bb6f4 vtysh, zebra: Fix function parameters
New version of clang are detecting function parameters that we should
not be casting as such.  Fix these issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-07 19:49:17 -04:00
Donald Sharp
10ac25160c zebra: Fix memory leak on host prefix removal
When we have a host prefix, actually free the alloced memory
associated with it when we free it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-04 13:31:34 -04:00
Quentin Young
21ccc0cf24 zebra: refactor zserv names, consolidate events
* Add centralized thread scheduling dispatchers for client threads and
  the main thread

* Rename everything in zserv.c to stop using a combination of:
  - zebra_server_*
  - zebra_*
  - zserv_*

  Everything in zserv.c now begins with zserv_*.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Donald Sharp
85442b0959 zebra: Cleanup some nits from Review Comments
1) Small formating mistake fixed
2) Rename of a variable to give it a slightly better name

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-21 07:18:18 -04:00
Donald Sharp
f2a503f0ce zebra: The neigh host_list is expensive too
The neighbor host_list is expensive as well.  Modify
the code to take advantage of a rb_tree as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-17 08:28:33 -04:00
Donald Sharp
41db76c235 zebra: Rename some functions to allow reuse
We are going to modify more host_list's to host_rb's
so let's rename some functions to take advantage of
what is there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-17 08:10:41 -04:00
Donald Sharp
5e1b0650de zebra: Convert zrmac->host_list list to a RB Tree
The host_list when we attempt to use it at scale, ends
up spending a non-trivial amount of time finding and
sorting entries for the host list.  Convert to a rb tree.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-17 08:01:24 -04:00
Donald Sharp
3518f35264 bgpd, lib, zebra: Cleanup formatting issues found
Cleanup the formating issues found.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Donald Sharp
2017b3ead0 zebra: Use STREAM_GETXXX functions
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Mitesh Kanjariya
cc6d54769b bgpd/zebra: use stream_putl/getl to send VNIs
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Mitesh Kanjariya
cf29971433 zebra: vni [prefix-routes-only] should also be provided for the 'no' cmd
We have a command to enable symmetric routing only for type-5 routes.
This command is provided under vrf <> option in zebra as follows:
vrf <VRF>
  vni <VNI> [prefix-routes-only]
We need the corresponding no version of the command as well as follows:
vrf <VRF>
  no vni <VNI> [prefix-routes-only]

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Mitesh Kanjariya
f50dc5e607 zebra: remote RMAC for EVPN ipv6 hosts should be programmed against the ipv4 nexthop
For ipv6 host, the next hop is conevrted to ipv6 mapped address.
However, the remote rmac should still be programmed with the ipv4 address.
This is how the entries will look in the kernel for ipv6 hosts routing.

vrf routing table:
ipv6 -> ipv6_mapped remote vtep on l3vni SVI

neigh table:
ipv6_mapped remote vtep -> remote RMAC

bridge fdb:
remote rmac -> ipv4 vtep tunnel

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
vivek
22e63104d2 bgpd, zebra: Handle EVPN router MAC per next hop
Ensure that when EVPN routes are installed into zebra, the router MAC
is passed per next hop and appropriately handled. This is required for
proper multipath operation.

Ticket: CM-18999
Reviewed By:
Testing Done: Verified failed scenario, other manual tests
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Donald Sharp
9fc1522cfb zebra: Cleanup lines over 80 columns
Cleanup warnings in lines over 80 columns.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-12 09:20:20 -04:00
Mitesh Kanjariya
e9d2cbdebf zebra: add EVPN learned neighbors as NUD_NOARP
EVPN owns the remote neigh entries which are programed in the kernel.
This entries should not age out and the only way to delete should be
from EVPN. We should program these entries with NUD_NOARP instead of
NUD_REACHABLE to avoid aging of this macs.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-04-12 09:07:43 -04:00
Mitesh Kanjariya
ee69da278d zebra: act on kernel notifications for remote neighbors as well
There can be a race condition between kernel and frr as follows.
Frr sends remote neigh notification.
At the (almost) same time kernel might send a notification saying
neigh is local.
After processing this notifications, the state in frr is local while
state in kernel is remote. This causes kernel and frr to be out of sync.
This problem will be avoided if FRR acts on the kernel notifications for
remote neighbors. When FRR sees a remote neighbor notification for a
neighbor which it thinks is local, FRR will change the neigh state to remote.

Ticket: CM-19923/CM-18830
Review: CCR-7222
Testing: Manual

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-04-12 09:07:43 -04:00
Quentin Young
cef91a1813
zebra: fix style error
Introduced e3bb770

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-11 11:25:32 -04:00
Ilya Shipitsin
e3bb770c4f resolve issue found by cppcheck
[zebra/zebra_vxlan.c:5779] -> [zebra/zebra_vxlan.c:5778]:
(warning) Either the condition 'if(svi_if_zif&&svi_if_link)'
is redundant or there is possible null pointer dereference: svi_if_zif.

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2018-04-11 17:02:34 +05:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Quentin Young
124ead27db
lib, zebra: use existing zapi header struct
Nobody uses it, but it's got the same definition. Move the parser
function into zclient.c and use it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12 14:57:06 -04:00
Quentin Young
1002497af5
zebra: reorganize zserv, batch i/o
Group send and receive functions together, change handlers to take a
message instead of looking at ->ibuf and ->obuf, allow zebra to read
multiple packets off the wire at a time.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12 14:57:05 -04:00
Quentin Young
89f4e5077b
zebra: standardize ZAPI message handler args
A lot of the handler functions that are called directly from the ZAPI
input processing code take different argument sets where they don't need
to. These functions are called from only one place and all have the same
fundamental information available to them to do their work. There is no
need to specialize what information is passed to them; it is cleaner and
easier to understand when they all accept the same base set of
information and extract what they need inline.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12 14:57:05 -04:00
Quentin Young
8068a649a7
zebra: dont return a status code in zapi handlers
All of the ZAPI message handlers return an integer that means different
things to each of them, but nobody ever reads these integers, so this is
technical debt that we can just eliminate outright.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-12 14:57:05 -04:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Mitesh Kanjariya
00cbfad6de
Merge branch 'master' into evpn-bug-fixes 2018-02-27 02:47:36 -08:00
Mitesh Kanjariya
f487dcaf74
Merge branch 'master' into evpn-bug-fixes 2018-02-21 00:36:58 -08:00
Mitesh Kanjariya
c48d9f5f85 zebra, bgp: Support type-5 routes with asymmetric routing
Asymmetric routing is an ideal choice when all VLANs are cfged on all leafs.
It simplifies the routing configuration and
eliminates potential need for advertising subnet routes.
However, we need to reach the Internet or global destinations
or to do subnet-based routing between PODs or DCs.
This requires EVPN type-5 routes but those routes require L3 VNI configuration.

This task is to support EVPN type-5 routes for prefix-based routing in
conjunction with asymmetric routing within the POD/DC.
It is done by providing an option to use the L3 VNI only for prefix routes,
so that type-2 routes (host routes) will only use the L2 VNI.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-10 00:41:28 -08:00
mitesh
1f2129ecd3 zebra: fix build breakage
is_vni_l3 was removed as a part of PR1700. However, it seems to be used in master.
Causing the breakage. Made the changes to not use the API anymore.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-09 16:57:37 -08:00
Renato Westphal
1a6219e1a3
Merge pull request #1700 from mkanjari/evpn-symm-routing-enhancements-2.0
EVPN Symmetric routing enhancements 2.0
2018-02-09 21:20:27 -02:00
Mitesh Kanjariya
12eeac84ff zebra: Handle local-ip change in a correct way for l3-vni
Ticket: CM-19603
Review: CCR-7142
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-08 23:06:43 -08:00
Mitesh Kanjariya
bca63dc8ba zebra: Handle change to VxLAN tunnel (local) IP address for L3 VNI similar to what is done for L2 VNI.
Ticket: CM-19195
Review: CCR-7122
Test: Manual

Signed-of-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-02-08 23:06:30 -08:00
Mitesh Kanjariya
4ac71d4bea zebra: fix 'show evpn vni' output
removed an additional field 'local-tunnel-ip' from l2vnis o/p

Ticket: CM-19670
Review: CCR-7167
Testing: Verified that the output is proper

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-08 23:06:17 -08:00
Mitesh Kanjariya
01a6143bda zebra: do not check if advertise-default-gw is on in no-advertise-default-gw flow
Ticket: CM-19116
Review:  CCR-7042
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-08 23:04:17 -08:00
mitesh
eb474e7313 zebra: fix SA issues
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-05 16:21:00 -08:00
mitesh
2aeb403d37 zebra: fix SA issues
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-05 13:51:45 -08:00
mitesh
643215ce4c zebra: optimize l3vni lookup in certain callflows
Currently, while processing kernel messages related to VNIs
we first check if VNI is L3 - this is a hash lookup
later, we do the lookup again to find the L3-VNI.
This is non-optimal.
Made changed to make sure we only do the lookup once.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-24 15:49:21 -08:00
vivek
22bd3e9497 *: Refine the notion of a configured VRF in FRR
Refine the notion of what FRR considers as "configured" VRF. It is no longer
based on user just typing "vrf FOO" but when something is actually configured
against that VRF. Right now, in zebra, the only configuration against a VRF
are static IP routes and EVPN L3 VNI. Whenever a configuration is removed,
check and clear the "configured" flag if there is no other configuration for
this VRF. When user attempts to configure a static route and the VRF doesn't
exist, a VRF is created; the VRF is only active when also defined in the
kernel.

Updates: 8b73ea7bd479030418ca06eef59d0648d913b620
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>

Ticket: CM-10139, CM-18553
Reviewed By: CCR-7019
Testing Done:
1. Manual testing for L3 VNI and static routes - FRR restart, networking
restart etc.
2. 'vrf' smoke

<DETAILED DESCRIPTION (REPLACE)>
2018-01-23 18:49:40 -08:00
mitesh
317f1fe02f zebra/bgpd: fix compilation issues
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:30:40 -08:00
vivek
d445462649 *: Reintroduce JSON keywords for EVPN
Bring back "numVnis" and "originatorIp" for backwards compatibility.

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

Ticket: CM-19119
Reviewed By: Trivial
Testing Done: Manual, evpn_tests.py
2018-01-23 16:27:25 -08:00
vivek
fa409e1eeb zebra: Fix check when uninstalling remote next hops
Only check on L3-VNI SVI status when uninstalling remote next hops.

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

Ticket: CM-19036
Reviewed By: None
Testing Done:
1. Networking restart
2. VxLAN interface disable/enable
3. VRF delete and readd
2018-01-23 16:24:39 -08:00
vivek
d560078848 Revert "zebra: Do not check for l3vni oper up in nh uninstall"
This reverts commit d8f5884846ead8fc78f36c68db5ed52e758b6e87.
2018-01-23 16:24:39 -08:00
vivek
84915b0a15 *: Handle VRF configuration when VRF gets inactivated and activated
A VRF is active only when the corresponding VRF device is present in the
kernel. However, when the kernel VRF device is removed, the VRF container in
FRR should go away only if there is no user configuration for it. Otherwise,
when the VRF device is created again so that the VRF becomes active, FRR
cannot take the correct actions. Example configuration for the VRF includes
static routes and EVPN L3 VNI.

Note that a VRF is currently considered to be "configured" as soon as the
operator has issued the "vrf <name>" command in FRR. Such a configured VRF
is not deleted upon VRF device removal, it is only made inactive. A VRF that
is "configured" can be deleted only upon operator action and only if the VRF
has been deactivated i.e., the VRF device removed from the kernel. This is
an existing restriction.

To implement this change, the VRF disable and delete actions have been modified.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mkanjariya@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>

Ticket: CM-18553, CM-18918, CM-10139
Reviewed By: CCR-7022
Testing Done:
1. vrf and pim-vrf automation tests
2. Multiple VRF delete and readd (ifdown, ifup-with-depends)
3. FRR stop, start, restart
4. Networking restart
5. Configuration delete and readd

Some of the above tests run in different sequences (manually).
2018-01-23 16:24:35 -08:00
Mitesh Kanjariya
a58e6e0c27 zebra: Do not check for l3vni oper up in nh uninstall
We shouldnt check for l3vni oper up while uninstalling the next-hop.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:23:31 -08:00
Mitesh Kanjariya
a9a7626229 zebra: re-add remote RMAC if needed
Kernel can delete a frr installed remote RMAC on a L3-VNI.
We should re-add if such a siatuation occurs
as we are the owner of the RMAC.
This behavor is same for remote MACs as well and was missing for RMACs.

Ticket: CM-18762
Review: CCR-6992
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:23:31 -08:00
Mitesh Kanjariya
4cce389e0e bgpd/zebra: show command enhancements for EVPN symmetric routing
0. move all global EVPN details to 'show evpn [json]' command
1. change "VRF" to "Tenant VRF" in 'show evpn vni'
2. change 'show vrf vni' command to tabular form
   and add l3-vni related params to the output
3. show evpn rmac should show refcount only in detailed output
4. show evpn next-hop should show refcount only in detailed output
5. move VRF in 'show evpn l3vni' to the end
6. add num rmacs and num nexthops to show evpn l3vni
7. remove "info" from 'show bgp vrf <> l3vni info'
8. show evpn vni <vni> should show l2vni details or l3 vni details
9. show evpn vni should show both L2 and L3 VNIs
10. show bgp l2vpn evpn - shows all global bgp l2vpn evpn details
11. show bgp l2vpn evpn vni - will show both l2 and l3 vnis
12. show bgp l2vpn evpn vni - should show both l2 and l3 vnis
13. follow camel notation for all json keys

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Mitesh Kanjariya
31310b25f2 bgpd: advertise VNI subnet
In EVPN symmetric routing, not all subnets are presents everywhere.
We have multiple scenarios where a host might not get learned locally.
1. GARP miss
2. SVI down/up
3. Silent host

We need a mechanism to resolve such hosts. In order to achieve this,
we will be advertising a subnet route from a box and that box will help
in resolving the ARP to such hosts.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Mitesh Kanjariya
ead40654de bgpd/zebra/lib: Add Default Gateway extended community
1. Added default gw extended community
2. code modification to handle sticky-mac/default-gw-mac as they go together
3. show command support for newly added extended community
4. State in zebra to reflect if a mac/neigh is default gateway
5. show command enhancement to refelect the same in zebra commands

Ticket: CM-17428
Review: CCR-6580
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Donald Sharp
7cf15b2501 zebra: use zclient_create_header
The function zserv_create_header was exactly the same
as zclient_create_header.  Let's just have one in the
system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-22 11:55:22 -05:00
mitesh
523cafc418 bgpd, lib, zebra: fix style problems
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-27 11:47:10 -08:00
Mitesh Kanjariya
6f3a2003d8 zebra: pass instance to zebra_find_client
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-15 02:05:38 -08:00
mitesh
3f02fbab67 zebra: pass ERR_STR_SZ in zebra_vxlan_process_vrf_vni_cmd
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
mitesh
c05a738b31 zebra: NUD_STALE is only valid in GNU linux
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
655b04d1c2 zebra/bgpd: cleanup l3vni on no advertise-all-vni
EVPN is only enabled when user configures advertise-all-vni.
All VNIs (L2 and L3) should be cleared upon removal of this config.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
mitesh
b67a60d2cf bgpd: set vrf originator ip to kernels local-ip
For EVPN type-5 route the NH in the NLRI is set to the local tunnel ip.
This information has to be obtained from kernel notification.
We need to pass this info from zebra to bgp in l3vni call flow.
This patch doesn't handle the tunnel-ip change.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
vivek
3bcbba10a1 zebra: Reinstall remote VTEP next hop when it becomes stale
When a remote VTEP next hop entry (for symmetric routing) becomes
stale, reinstall it. This makes the behavior the same as what is
done for remote host next hops (for asymmetric routing and ARP
suppression).

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
mitesh
bb7a24aba9 zebra: use list_delete_and_null instead of list_delete
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
964ec8866f zebra: remove l3vni/rmac from gw macip APIs
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
8c9b80b965 zebra: re-install remote next-hop neigh entries upon age out
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
5e06422cb1 bgpd: uninstall all nh/rmac when l3vni is deleted
Upon a l3vni delete (no vni under a vrf) is executed,
we should uninstall all the RMACs and NHs associated with the l3vni.
This is because by the time we get a route delete in zebra
l3vni is already deleted and we dont have refernce to RMACs and NHs

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
316f4ca4d9 zebra: json support for show evpn rmac specific mac command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
75223c9e4a zebra: json support for show evpn rmac vni command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
c0b4eaa4c2 zebra: json support for show evpn rmac command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
c0e519d32d zebra: json support for show evpn specific next-hop command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
9187f600a9 zebra: json support for show evpn next-hop l3vni <vni>
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
3279896516 zebra: json support for show evpn next-hop vni all
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
b2ee5a130b zebra: json support for show evpn l3vni vni command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
51d8de8f96 zebra: json support for show evpn l3vni
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
55aabf6f72 zebra: free host_list while deleting rmac/nh entry
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
9aa741eae8 zebra: show commands for specific rmac/nh entries
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
mitesh
6134fd82a0 zebra: proper refcounting for rmac/nh entries
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.comy>
2017-12-14 10:57:06 -08:00
mitesh
2dbad57fc6 bgpd: program nh/rmac entries
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
mitesh
d3135ba31d bgpd: program mac-ip routes in matching vrfs
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
23a06e1170 zebra: don't get rmac in remote macip delete
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
b80320d778 zebra: don't get rmac in remote macip add
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
b7cfce934f zebra, lib: zebra changes for symmetric routing support
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:56:44 -08:00
Donald Sharp
019a82cbbc zebra: Allow zebra_find_client to match on instance as well
zebra_find_client needs to match on instance as well so
protocols like ospfd will work correctly for notification.

Modify the zebra_find_client code to accept the instance
number and to pass it in appropriately.

Signed-off-by: Doanld Sharp <sharpd@cumulusnetworks.com>
2017-11-27 09:25:32 -05:00
Donald Sharp
ec93aa120e lib, zebra: Modify zebra to use STREAM_GET for zapi
This code modifies zebra to use the STREAM_GET functionality.
This will allow zebra to continue functioning in the case of
bad input data from higher level protocols instead of crashing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-13 14:16:13 -05:00
Donald Sharp
e4bd522a31 zebra: No need to pass sock descriptor around.
Standardize the api to read zapi requests from protocols.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:22 -04:00
Renato Westphal
451fda4f9a *: use the FOR_ALL_INTERFACES abstraction from babeld
This improves code readability and also future-proofs our codebase
against new changes in the data structure used to store interfaces.

The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but
for now only babeld is using it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:05:46 -03:00
Renato Westphal
f4e14fdba7 *: use rb-trees to store interfaces instead of sorted linked-lists
This is an important optimization for users running FRR on systems with
a large number of interfaces (e.g. thousands of tunnels). Red-black
trees scale much better than sorted linked-lists and also store the
elements in an ordered way (contrary to hash tables).

This is a big patch but the interesting bits are all in lib/if.[ch].

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:05:02 -03:00
vivek
790f8dc572 zebra: Fix MAC counts for EVPN
MAC entries are internally created for purposes such as when a local
neighbor is learnt but the MAC itself is not yet learnt. Such MACs are
not "real", so ensure they are not counted for UI output.

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

Ticket: CM-17991
Reviewed By: None
Testing Done: Manual, evpn-smoke
2017-10-06 10:00:19 -04:00
vivek
2853fed67a zebra: Handle L3 multi-tenancy correctly for EVPN
Fix following flaws that resulted in EVPN with L3 multi-tenancy (i.e.,
EVPN dealing with VxLAN routing in the presence of tenant VRFs) not
working properly:

1. EVPN enable ("advertise-all-vni") is a global command, ensure it is
accordingly processed. The config is maintained against the default VRF.
2. There was an incorrect attempt to derive the L3 VRF for L2 interfaces
- the VRF only applies for L3 interfaces, though the code may initialize
to the default value in other cases.
3. Functions to map (port, VLAN) to SVI or vice versa were incorrect -
particularly, zvni_map_svi() since it was looking in the L3 VRF for
"matching" L2 interface which it would never find. Fix.

In addition, since the 'zebra_vrf *' parameter is not relevant in most
places, it has been removed.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-17840
Reviewed By: CCR-6685
Testing Done: evpn-smoke, various manual tests
2017-10-06 09:59:43 -04:00
Donald Sharp
affe9e9983 *: Convert list_delete(struct list *) to ** to allow nulling
Convert the list_delete(struct list *) function to use
struct list **.  This is to allow the list pointer to be nulled.

I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.

Let's make the api explicit in it setting the list pointer
to null.

Cynical Prediction:  This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:53:13 -04:00
Renato Westphal
b3c18264e4 Merge pull request #1079 from qlyoung/fix-style-a
*: fix style
2017-08-31 13:22:55 -03:00
Jafar Al-Gharaibeh
959768e8d0 Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
2017-08-31 10:25:55 -05:00
Quentin Young
60466a63f2
*: fix style
Fixes style nits introduced by recent pull requests.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-30 11:27:11 -04:00
Donald Sharp
1e9f448fe1 zebra: Coverity Code Cleanup
1) Various socket close issues
2) Ensure afi passed is usable
3) Fix some reads beyond buffer and reads after free
4) Ensure some failure modes are handled properly
5) Memory Leak(s) fix
6) There is no 6.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-25 11:37:07 -04:00
Renato Westphal
0af35d90a1 *: fix assorted issues detected by Coverity Scan
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-24 21:49:39 -03:00
Mitesh Kanjariya
71349e0358 zebra: lookup link by ifindex
Frr has an assumption that when interface A links to B,
we already know about B. But that might be true always.
It is probably purely depends on the configuration
and how the interfaces are hashed in Kernel.
FRR seems to sometimes get "A is linked to B" before it knows about B,
in that case, the linkage between the data structure for A & B won't be proper.

Ticket: CM-17679
Review: ccr-6628
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-20 06:10:38 -07:00
Mitesh Kanjariya
f51d8a274b zebra: Delete AUTO macs when neigh list is empty
Ticket: CM-17660
Review: CCR-6624
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-20 05:53:15 -07:00
Mitesh Kanjariya
57f7feb64f Fix coding style.
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-18 17:33:56 -07:00
Mitesh Kanjariya
859b32c030 zebra: Revert the fix for zebra: Refresh remote neighbors when they go stale
NUD_STALE flag is causing a build breakage,
we might have to define it somewhere in frr.
Reverting the fix for now untill we decide how to handle it correctly.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 17:40:17 -07:00
vivek
b682f6de5a zebra: Fix MAC change handling for a neighbor
When the MAC changes for a local neighbor, ensure that the neighbor data
structure as well as the link between the neighbor and MAC data structures
is updated correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-17565
Reviewed By: CCR-6605
Testing Done: Manual, evpn-smoke
2017-08-17 03:54:38 -07:00
vivek
c65f709ec6 zebra: Refresh remote neighbors when they go stale
If we get an ageout notification from the kernel for EVPN-installed
neighbors, ensure that they are readded. Otherwise, while entries in
STALE state are usable, based on other kernel parameters they can
get deleted and adding them back only at delete can have other
undesirable performance consequences.

Note: This is the current Linux kernel behavior (to ageout EVPN
installed neighbors).

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mitesh@cumulusnetworks.com>

Ticket: CM-15623, CM-17490
Reviewed By: CCR-6586
Testing Done: Manual, evpn-min
2017-08-17 02:53:29 -07:00
vivek
af026ae40e zebra: Fix VxLAN interface add-del to bridge
Ensure that removal and addition of VxLAN interface from/to bridge is
handled correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-08-17 02:48:41 -07:00
vivek
b5ebdc9ba5 zebra: Handle MACIP requests when in transient conditions
When multiple events are happening, it is possible that remote
MACIP or other requests may be received when an interface is down
or removed from a bridge. Handle this correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-08-17 02:31:45 -07:00
Mitesh Kanjariya
0a97666de7 zebra: Use neigh_list instead of neigh_refcnt for zebra_mac and zebra_neigh binding
Ticket: CM-17500
Review: CCR-6584
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-16 18:56:15 -07:00
Mitesh Kanjariya
23341a0584 Zebra: replace mac entry in kernel when it moves from local to remote
Until now, we had to delete the local mac entries when a mac moved from local to remote,
with the new kernel patch that is no longer necessary.

Ticket:CM-16094
Reviewed By:CCR-6470
Testing Done: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-16 17:30:46 -07:00
Mitesh Kanjariya
297a21b66b zebra: zebra should not try and advertise gateway macip if EVPN is disabled
Ticket: CM-17050
Review: CCR-6447
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:54 -04:00
Mitesh Kanjariya
ddd16ed5f2 bgpd/zebra: honor tunnel ip change in bgp regardless of vni readiness
Ticket: CM-17014
Review: CCR-6432
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:54 -04:00
Mitesh Kanjariya
b6938a74e5 zebra: Provide neigh-mac tie-in in zebra
Currently, FRR does not do any linking between local MACs and neighbors.
We found this necessary when dealing with centralized GW. A neigh is considered local only when the mac is learnt locally as well.

Ticket: CM-16544
Review: CCR-6388
Unit-test: Manual/Evpn-Smoke

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:51 -04:00
Chirag Shah
cd23307906 zebra: Enable JSON for EVPN show cmds
Ticket: CM-16959
Reviewed By: CCR-6401
Testing Done:
Execute 'show evpn .... json' form of outputs with local/remote vteps

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-08-08 10:28:50 -04:00
Donald Sharp
9b67b51474 zebra: Fix some memory leaks on shutdown
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 10:28:50 -04:00
Mitesh Kanjariya
1a98c08704 bgpd/zebra/lib: EVPN support for asymmetric VxLan routing
1. Advertise gateway mac-ip in EVPN
2. Advertise VRR mac-ip in EVPN
3. Ignore gateway mac-ip advertisements in case of distributed gateway
4. Config knob to enable/disable gateway mac-ip advertisements

Ticket: CM-16456, CM-16543, CM-16555, CM-16778
Review: CCR-6283
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:46 -04:00
Mitesh Kanjariya
8f4b98eedb zebra: fix mac mobility code path
Ticket: CM-16928
Review: CCR-6210
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:09:37 -04:00
Mitesh Kanjariya
b8ce75a5d3 zebra: update sticky mac attribute to BGP if necessary
Ticket: CM-16732
Review: CCR-6368
Unit-test: Manual (logs attached to ticket)

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:09:37 -04:00
Mitesh Kanjariya
421bb26a51 bgpd/zebra: fix bgpd crash happening in mac mobility code path
Ticket: CM-16216
Review: CCR-6210
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:09:37 -04:00
Donald Sharp
ff8b7eb870 zebra: Switch to using ETH_ALEN
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-04 09:06:14 -04:00
Donald Sharp
25331def55 zebra: Fix crash when OOM happens.
The hash key function choosen for mac vni's would tend
to clump the key value to the same number.  Use a better
hash key generator to spread the hash values out.

A bad hash key might lead to O(2^n) memory consumption
because the hash size is doubled, each time a backet
exceeds a predefined threshold.  This quickly leads
to OOM.  Fixing this issue by fixing the hash
key generation to actually spread the keys out.

Ticket: CM-17412
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-04 09:05:13 -04:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
Donald Sharp
2850f0ea58 bgpd, zebra: Cleanup warnings from new code
1) Clean up VTY_NEWLINE -> \n
2) Remove usages of VTY_GET_INTEGER

Signed-off-by: Donald Sharp
2017-07-14 08:52:45 -04:00
vivek
c85c03c7f9 bgpd, zebra: Support for sticky MACs
Implement support for sticky (static) MACs. This includes the following:

- Recognize MAC is static (using NUD_NOARP flag) and inform BGP
- Construct MAC mobility extended community for sticky MACs as per
RFC 7432 section 15.2
- Inform to zebra that remote MAC is sticky, where appropriate
- Install sticky MACs into the kernel with the right flag
- Appropriate handling in route selection

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 14:37:14 -04:00
vivek
cec2e17d27 zebra: EVPN/VxLAN UI definitions and handling
Implement various UI (vty) commands for EVPN/VxLAN.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 12:29:27 -04:00
vivek
2232a77c2b zebra: MAC and Neighbor (ARP/ND) handling
Implement handling of MACs and Neighbors (ARP/ND entries) in zebra:
- MAC and Neighbor database handlers
- Read MACs and Neighbors from the kernel, when needed and create
entries in zebra's MAC and Neighbor databases.
- Handle add/update/delete notifications from the kernel for MACs and
Neighbors and update zebra's database appropriately
- Inform locally learnt MACs and Neighbors to client
- Handle MACIP add/delete from client and install appriporiate entries
into the kernel
- Since Neighbor entries will be installed on an SVI, implement the
needed mappings

NOTE: kernel interface is only implemented for Linux/netlink

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 12:29:25 -04:00
vivek
13d60d351c zebra: VNI and VTEP handling
Implement fundamental handling for VNIs and VTEPs:
- Handle EVPN enable/disable by client (advertise-all-vni)
- Create/update/delete VNIs based on VxLAN interface events and inform
client
- Handle VTEP add/delete from client and install into kernel
- New debug command for VxLAN/EVPN
- kernel interface (Linux/netlink only)

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-12 12:26:02 -04:00