vivek [Mon, 11 Dec 2017 22:38:15 +0000 (14:38 -0800)]
zebra: Refine cleanup when a VRF with configuration gets deleted
When a VRF gets deleted - e.g., networking restart or ifdown of the VRF - but
has associated FRR configuration, additional cleanup of all dynamic data pertaining
to this VRF is necessary. This includes the routing tables, next hop tables,
temporary queues for this VRF etc. Only the FRR configuration for this VRF must
be retained.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-19148
Reviewed By: CCR-7030
Testing Done:
1. Manual testing - This scenario and EVPN configuration
2. Various smoke tests - vrf, bgp, pim, l3-smoke
vivek [Sat, 9 Dec 2017 00:36:27 +0000 (16:36 -0800)]
bgpd: Fix attribute handling for type-5 routes
When a EVPN type-5 route is formed by using the source IP route's AS-path,
the AS-path is not locally generated and should not be "uninterned" (i.e.,
have its reference count incorrectly updated). An incorrect update of the
reference count can lead to asserts or crashes at a later stage.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-19121
Reviewed By: CCR-7028
Testing Done:
1. Manual testing by Vivek and Anitha
2. No automation run since this area has no coverage yet
vivek [Mon, 4 Dec 2017 17:52:54 +0000 (09:52 -0800)]
bgpd: Use source route's path attributes for type-5 routes
When an IPv4 or IPv6 unicast route is injected into EVPN as a type-5 route
(upon user configuration), ensure that the source route (best path)'s path
attributes are used to build the EVPN type-5 route. This will result in
correct AS_PATH and ORIGIN attributes for the type-5 route so that it doesn't
appear that all type-5 routes are locally sourced. This is necessary to
ensure that external paths (IPv4 or IPv6 from EBGP peer) are preferred over
internal EVPN paths, if both exist.
vivek [Sat, 2 Dec 2017 01:36:37 +0000 (17:36 -0800)]
*: 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.
Mitesh Kanjariya [Wed, 29 Nov 2017 10:25:35 +0000 (02:25 -0800)]
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.
Mitesh Kanjariya [Wed, 15 Nov 2017 09:01:00 +0000 (01:01 -0800)]
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
Mitesh Kanjariya [Mon, 20 Nov 2017 05:47:04 +0000 (21:47 -0800)]
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.
Mitesh Kanjariya [Tue, 21 Nov 2017 10:42:05 +0000 (02:42 -0800)]
bgpd: carry two MPLS labels in EVPN NLRIs
When doing symmetric routing,
EVPN type-2 (MACIP) routes need to be advertised with two labels (VNIs)
the first being the L2 VNI (identifying the VLAN) and
the second being the L3 VNI (identifying the VRF).
The receive processing needs to handle one or two labels too.
Ticket: CM-18489
Review: CCR-6949
Testing: manual and bgp/evpn/mpls smoke
Mitesh Kanjariya [Mon, 13 Nov 2017 11:19:52 +0000 (03:19 -0800)]
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
When a nexthop is resolved via a label based nexthop, copy
the labels into the newly created recursive nexthop.
Please note that this does not fix the case where we
have a label based nexthop that is recursively resolved
through *another* nexthop that is also label based.
In this case we need to create a new label stack
for those routes.
Philippe Guibert [Wed, 10 Jan 2018 13:13:50 +0000 (14:13 +0100)]
lib: ns_id_t changed to 32 bit
Because the VRF_ID is mapped into 32 bit, and because when NETNS will be
the backend of VRF, then the NS identifier must also be encoded as 32
bit.
Also, the NS_UNKNOWN value is changed accordingly to UINT32_MAX.
Also, the NS_UNKNOWN and NS_DEFAULT values are removed from zebra_ns.h
and kept on ns.h header file.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
The number of vrf bitmap groups is increased so as to avoid consuming
too much memory. This fix is related to a fork memory that occured when
running pimd as daemon.
A check on memory consumed shows that the memory consumed goes from
33480ko to 46888ko with that change. This is less compared to if the
value of the bitmap groups is increased to 16 ( 852776ko).
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 14 Dec 2017 15:01:36 +0000 (16:01 +0100)]
lib: increase vrf_id from 16 bit to 32 bit identifier
This is a preparatory work for configuring vrf/frr over netns
vrf structure is being changed to 32 bit, and the VRF will have the
possibility to have a backend made up of NETNS.
Let's put some history.
Initially the 32 bit was because one wanted to map on vrf_id both the
VRFLITE and the NSID.
Initially, one would have liked to make zebra configure at the same time
both vrf lite and vrf from netns in a flat way. From the show
running perspective, one would have had both kind of vrfs, thatone
would configure on the same way.
however, it leads to inconsistencies in concepts, because it mixes vrf
vrf with vrf, and vrf is not always mapped with netns.
For instance, logical-router could also be used with netns. In that
case, it would not be possible to map vrf with netns.
There was an other reason why 32 bit is proposed. this is because
some systems handle NSID to 32 bits. As vrf lite exists only on
Linux, there are other systems that would like to use an other vrf
backend than vrf lite. The netns backend for vrf will be used for that
too. for instance, for windows or freebsd, some similar
netns concept exists; so it will be easier to reuse netns
backend for vrf, than reusing vrflite backend for vrf.
This commit is here to extend vrf_id to 32 bits. Following commits in a
second step will help in enable a VRF backend.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
vivek [Sat, 20 Jan 2018 21:21:05 +0000 (13:21 -0800)]
zebra: Install connected routes during VRF change only if interface is up
During VRF change handling, the connected route for the interface should be
installed only if the interface is up. Otherwise, we end up with duplicate
connected routes which can lead to other problems.
Donald Sharp [Thu, 18 Jan 2018 14:17:57 +0000 (09:17 -0500)]
zebra: Add some more debug information on read issues in FPM
When we receive a read failure in handling a FPM read
let's add a bit more information to what we think has
gone wrong, in a hope that debugging will be a bit easier.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Tue, 16 Jan 2018 20:44:14 +0000 (15:44 -0500)]
frr: update README
* Clarify that FRR implements as well as manages protocols
* Move IS-IS out of "early support"
* Add Babel - friends don't leave friends out of READMEs!
* Add mention of further information
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Chirag Shah [Sat, 30 Dec 2017 05:01:07 +0000 (21:01 -0800)]
ospfd: show ip ospf interface json output format
Current json output does not differentiate start of
interface objects. Adding "interfaces" keyword at the
beginning of the interface list. This is useful
when displaying vrf level output along with interface list.
Ticket:CM-19115
Testing Done:
show ip ospf vrf all interface json
show ip ospf vrf all interface <specific intf> json
show ip ospf interface json
show ip ospf interface <specific intf> json
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Quentin Young [Fri, 1 Dec 2017 19:44:32 +0000 (14:44 -0500)]
lib: avoid crash when cancelling invalid rw job
There are some observed instances where we end up trying to cancel a rw
job based on a file descriptor that we don't have a reference on. The
specific cancel function for rw jobs assumes it's called with a file
descriptor that is valid within pollfds and will cause a segmentation
fault by buffer overrun if this is not the case.
Instead log it and move on. Since the fd does not exist this should
patch over the buggy behavior and provide additional information to help
in finding the root cause.
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Fri, 12 Jan 2018 19:57:57 +0000 (14:57 -0500)]
bgpd: disallow invalid config at cli layer
Remove the ability to attempt to configure a couple of options on
directly connected neighbors that don't make sense for them, as well as
the soft error handling code.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Fri, 12 Jan 2018 17:35:19 +0000 (12:35 -0500)]
vtysh: add ability to output to file
Add ability to set file destination for all vtysh output, with the
exception of tab-complete and similar meta output. This is useful for
inline recording of some information without exiting the shell.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Thu, 11 Jan 2018 16:47:04 +0000 (11:47 -0500)]
zebra: Encode the ifindex over netlink
In order for routes to be leaked the ifindex must be sent
down into the kernel over the netlink protocol. So
send it( we always figure it out ) when we add the
route.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Tue, 9 Jan 2018 19:47:11 +0000 (14:47 -0500)]
zebra: Move NS/VRF initialization earlier
Move the NS/VRF initialization code for zebra to an earlier
point in startup. In the future we will have code that
will want to install_element into a VRF_NODE from zebra_vty.c
Signed-off-by: Donald Sharp <sahrpd@cumulusnetworks.com>
Donald Sharp [Fri, 12 Jan 2018 14:20:30 +0000 (09:20 -0500)]
zebra: Add nh_vrf_id to 'struct route_entry`
With VRF route-leaking we need to know what vrf
the nexthops are in compared to this vrf. This
code adds the nh_vrf_id to the route entry and
sets it up correctly for the non-route-leaking
case.
The assumption here is that future commits
will make the nh_vrf_id *different* than
the vrf_id.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 5 Jan 2018 14:21:55 +0000 (09:21 -0500)]
lib: Allow interface lookup by VRF_UNKNOWN
Modify if_lookup_by_index to accept a VRF_UNKNOWN
as a vrf_id. This will cause it to look in all
vrf's for the interface pointer.
Subsequently all if_XXXX functions that call this function
will also get this behavior.
VRF_UNKNOWN *should* not be used for interface creation
as that this will break some core assumptions.
This work is part of allowing vrf route leaking. Currently
it is possible to create a route in the linux kernel that has
a nexthop across vrf boundaries.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 8 Jan 2018 13:57:44 +0000 (08:57 -0500)]
lib: Add notice of when we can remove some deprecated code.
The zapi_ipv4_route, zapi_ipv6_route and zapi_ipv4_route_ipv6_nexthop
functions are deprecated. Add notice of when we can remove the
deprecated code from the system.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>