]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
5 years agozebra: Releasing/uninstalling re-work with groups
Stephen Worley [Tue, 14 May 2019 20:56:38 +0000 (13:56 -0700)]
zebra: Releasing/uninstalling re-work with groups

Re-work the code to release/uninstall after the addition
of groups.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Protocol side nhg_hash_entry afi fix
Stephen Worley [Mon, 1 Apr 2019 16:24:16 +0000 (12:24 -0400)]
zebra: Protocol side nhg_hash_entry afi fix

Default the afi of the nexthop to the route entry using it.
If it turns out to be a group, update the afi to AFI_UNSPEC.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Update rib_add_multipath with increment nhe
Stephen Worley [Mon, 1 Apr 2019 16:21:52 +0000 (12:21 -0400)]
zebra: Update rib_add_multipath with increment nhe

Update rib_add_multipath to use the reference count
increment function for nexthop group hash entries.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Recursively decrement refcnt on nhe's
Stephen Worley [Fri, 29 Mar 2019 22:16:27 +0000 (18:16 -0400)]
zebra: Recursively decrement refcnt on nhe's

Recursively decrement the refcnt on nhg_hash_entry's of
groups.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add function to increment nhg refcnt
Stephen Worley [Fri, 29 Mar 2019 22:14:20 +0000 (18:14 -0400)]
zebra: Add function to increment nhg refcnt

Add function to increment the route reference count for nhg_hash_entry's
and to do so recursively if its a group.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add equivalence function for nhg_depends
Stephen Worley [Fri, 29 Mar 2019 14:56:52 +0000 (10:56 -0400)]
zebra: Add equivalence function for nhg_depends

Add a helper function to allow us to check if two
nhg_hash_entry's dependency lists are equal.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add function to lookup ID in depends list
Stephen Worley [Fri, 29 Mar 2019 14:55:10 +0000 (10:55 -0400)]
zebra: Add function to lookup ID in depends list

Add helper function to allow us to lookup an ID inside
of a nhg_hash_entry's dependency list.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Fix hash key type in zebra_nhg
Stephen Worley [Fri, 29 Mar 2019 14:53:14 +0000 (10:53 -0400)]
zebra: Fix hash key type in zebra_nhg

We were declaring the hash key as an int rather then
uint32_t.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add function to find/create single nexthop
Stephen Worley [Fri, 29 Mar 2019 14:51:07 +0000 (10:51 -0400)]
zebra: Add function to find/create single nexthop

Add a function that allows us to take a single
nexthop struct and look that up or create a group and
nexthop hash entry with it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Pass is_kernel_nh to zebra_nhg_find()
Stephen Worley [Fri, 29 Mar 2019 14:46:50 +0000 (10:46 -0400)]
zebra: Pass is_kernel_nh to zebra_nhg_find()

Pass a boolean to zebra_nhg_find(), indicating whether the
nhg is being lookedup from the kernel side or not.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Move id counter into zebra_nhg_find()
Stephen Worley [Thu, 28 Mar 2019 19:20:29 +0000 (15:20 -0400)]
zebra: Move id counter into zebra_nhg_find()

Move the id counter further up into zebra_nhg_find() so that
it is still incremented if we receive a duplicate that never
would get allocated. The kernel will still use the dup, so we
have to account for that in our id counter.

Also, if we don't create a new entry, reset the id back to where
it was when zebra_nhg_find() was called.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make kernel debug nexthop standardized
Stephen Worley [Thu, 28 Mar 2019 19:18:28 +0000 (15:18 -0400)]
zebra: Make kernel debug nexthop standardized

Make the the kernel debug zlog for nexthop messages from the
kernel more aligned with the route message kernel debug zlog.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Always copy nhg and depends on nhe alloc
Stephen Worley [Tue, 26 Mar 2019 23:40:23 +0000 (19:40 -0400)]
zebra: Always copy nhg and depends on nhe alloc

Changed our alloc function to just copy the nhg and
nhg_depends. This makes the zebra_nhg_find code a
little bit cleaner, hopefully preventing bugs.

The only issue with this is that it makes us have to loop
over the nexthops in a group an extra time for the copies.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make wording for depend functions clearer
Stephen Worley [Tue, 26 Mar 2019 23:38:20 +0000 (19:38 -0400)]
zebra: Make wording for depend functions clearer

Fix a couple functions that were using depends (plural)
rather than depend(singular) in their wording.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add functionality to send groups to kernel
Stephen Worley [Tue, 26 Mar 2019 23:35:08 +0000 (19:35 -0400)]
zebra: Add functionality to send groups to kernel

Add functionality to allow us to send nexthop groups
to the kernel. It creates a nexthop_grp array based on
the dependency list in the nhg_hash_entry and then shoves
that into the netlink message.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make nexthop ctx use nhg_depend_dup_list
Stephen Worley [Tue, 26 Mar 2019 23:32:15 +0000 (19:32 -0400)]
zebra: Make nexthop ctx use nhg_depend_dup_list

Update the dataplane nexthop ctx to use the nhg_depend_dup_list()
function for copying over the dependencies into its context.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add function to duplicate nhg dependencies
Stephen Worley [Tue, 26 Mar 2019 23:28:23 +0000 (19:28 -0400)]
zebra: Add function to duplicate nhg dependencies

Add a function to duplicate a nhg dependency linked
list. We will use this for duplicating the dependency
list rather than the linked list dup function in lib/linkedlist.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make nexthop group vrf VRF_DEFAULT
Stephen Worley [Fri, 22 Mar 2019 18:00:25 +0000 (14:00 -0400)]
zebra: Make nexthop group vrf VRF_DEFAULT

Nexthop groups can have nexthops in different vrf's. So,
let's make the group vrf_id just be VRF_DEFAULT for hash
lookup purposes.

Set vrf_id to be VRF_DEFAULT for every message. If its a new
nextop, set the vrf to be the appropriate thing, otherwise
its a group and can just be left as default.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Refactor nexthop group creation code to use allocated memory
Stephen Worley [Fri, 22 Mar 2019 17:11:07 +0000 (13:11 -0400)]
zebra: Refactor nexthop group creation code to use allocated memory

Simplify the code for nexthop hash entry creation. I made nexthop
hash entry creation expect the nexthop group and depends to always
be allocated before lookup. Before, it was only allocated if it had
dependencies. I think it makes the code a bit more readable to go
ahead an allocate even for single nexthops as well.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add helper functions for freeing the members of nexthop group hash entries
Stephen Worley [Fri, 22 Mar 2019 17:07:22 +0000 (13:07 -0400)]
zebra: Add helper functions for freeing the members of nexthop group hash entries

Add some functions that can be called to free everything that should
have been allocated in a nexthop group hash entry.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make show nexthop-group <null> list all nexthop hash entries
Stephen Worley [Thu, 21 Mar 2019 14:52:11 +0000 (10:52 -0400)]
zebra: Make show nexthop-group <null> list all nexthop hash entries

Add an option to not specify the afi in the show nexthop-group
command so that it shows all nexthops, including groups. This is
how iproute2 does it. If the afi is given, it will only show single
nexthops since groups are AF_UNSPEC.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Read in nexthop dependencies from the kernel
Stephen Worley [Thu, 21 Mar 2019 14:47:19 +0000 (10:47 -0400)]
zebra: Read in nexthop dependencies from the kernel

Add functionality to read in a group from the kernel,
create a hash entry for it, and add its nexthops to
its dependency list.

Further, we create its nhg struct separtely from this,
copying over any nexthops it should reference directly
into it.

Thus, we have two types for representation of the nexthop group:
nhe->nhg_depends->[nhe, nhe, nhe]

nhe->nhg->nexthop->nexthop->nexthop

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add dependency information for nexthop group hash entries
Stephen Worley [Thu, 21 Mar 2019 14:43:16 +0000 (10:43 -0400)]
zebra: Add dependency information for nexthop group hash entries

We treat "groups" from the kernel here as a dependency list.
Each hash entry, if its a group from the kernel, has
a list of any other nexthop hash entries that are in its
group. A non-group nexthop from the kernel will have its
dependency list set to NULL.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoinclude: Add nexthop.h to the include automake file
Stephen Worley [Thu, 21 Mar 2019 14:33:42 +0000 (10:33 -0400)]
include: Add nexthop.h to the include automake file

Add linux header nexthop.h to the automake file under
include/.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Check if a nexthop was added to the nhg
Stephen Worley [Wed, 20 Mar 2019 17:09:15 +0000 (13:09 -0400)]
zebra: Check if a nexthop was added to the nhg

Before doing anything with our tables, less make sure
we even added anything to the group.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add afi value for all nexthops sent/received
Stephen Worley [Wed, 20 Mar 2019 17:03:22 +0000 (13:03 -0400)]
zebra: Add afi value for all nexthops sent/received

Since nexthops are always going to need to be address family
specific unless they are only a group, we have to address
this when we receive and send them.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoRevert "zebra: Remove afi field in nexthop hash entry"
Stephen Worley [Tue, 19 Mar 2019 21:06:01 +0000 (17:06 -0400)]
Revert "zebra: Remove afi field in nexthop hash entry"

This reverts commit be73fe9393aac58c7f4bdb5c8a98c24c6cda6d5d.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make bad address family log message more clear
Stephen Worley [Tue, 19 Mar 2019 20:43:27 +0000 (16:43 -0400)]
zebra: Make bad address family log message more clear

The message for an invalid address family on a nexthop gateway did
not specify that is what for the gateway specifically.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Give Nexthop Group Hash entries a defined memory type
Stephen Worley [Fri, 15 Mar 2019 16:23:51 +0000 (12:23 -0400)]
zebra: Give Nexthop Group Hash entries a defined memory type

The nexthop group hash entries were using the "TMP" memory
type. Declared one for them and updated to use it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Change wording in duplicate error message
Stephen Worley [Wed, 13 Mar 2019 14:26:30 +0000 (10:26 -0400)]
zebra: Change wording in duplicate error message

Changed to the wording in the duplicate error message
since its techincally possible we get could try to
create a dupe from somewhere else besides the kernel
in the future.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Fix where the flags are set for new nexthop entries
Stephen Worley [Wed, 13 Mar 2019 14:21:41 +0000 (10:21 -0400)]
zebra: Fix where the flags are set for new nexthop entries

We were setting the flags in a couple different places for
nexthop entries.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add ifp to zebra-side rib_add
Stephen Worley [Tue, 14 May 2019 20:46:05 +0000 (13:46 -0700)]
zebra: Add ifp to zebra-side rib_add

Add an interface pointer for an nexthop group hash entry
when we are getting a rib_add for a new route.

Also, add the interface index to the `show nexthop-group` command.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make show nexthop-group command more readable
Stephen Worley [Mon, 11 Mar 2019 21:42:24 +0000 (17:42 -0400)]
zebra: Make show nexthop-group command more readable

Put some whitespace into the command output so that
we can read it a little bit easier.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add new nexthops to the interface nexthop hash entry list
Stephen Worley [Mon, 11 Mar 2019 20:31:44 +0000 (16:31 -0400)]
zebra: Add new nexthops to the interface nexthop hash entry list

When we get a new nexthop and find the interface associated
with it, add this nexthop to the interface's zebra interface
info nexthop hash entry list.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add nexthop hash entry list to zebra interface info
Stephen Worley [Mon, 11 Mar 2019 20:29:57 +0000 (16:29 -0400)]
zebra: Add nexthop hash entry list to zebra interface info

Add a nexthop hash entry list to the local zebra
interface info for each interface. This will allow
us to modify nexthops on link events.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Make route entry nexthop groups point to our hash entry
Stephen Worley [Mon, 11 Mar 2019 14:58:05 +0000 (10:58 -0400)]
zebra: Make route entry nexthop groups point to our hash entry

Make our route entry struct's re->ng nexthop group pointer
just point to the nhe->nhg nexthop hash entry nexthop group.
This will allow updates to the nexthop itself to propogate
to our routes immediately.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Update rib_add to take a nexthop ID
Stephen Worley [Mon, 11 Mar 2019 14:55:53 +0000 (10:55 -0400)]
zebra: Update rib_add to take a nexthop ID

Add a parameter to the rib_add function so that it takes
a nexthop ID from the kernel if one is passed along
with the route.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Put unicast nexthop parsing into its own function
Stephen Worley [Mon, 11 Mar 2019 14:52:33 +0000 (10:52 -0400)]
zebra: Put unicast nexthop parsing into its own function

Move the nexthop unicast parsing into its own function
to improve code readability. It was getting a bit too
indented.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Parse in nexthop ID information from new routes
Stephen Worley [Mon, 11 Mar 2019 14:46:25 +0000 (10:46 -0400)]
zebra: Parse in nexthop ID information from new routes

Add parsing code for nexthop object ID's when we get a
route. When we get a new route with the new kernel, it
will come with a nexthop ID and the nexthop full info.
We should just reference by ID if it exists and point
to the nexthop hash entry that matches it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Uninstall nexthops on shutdown
Stephen Worley [Fri, 8 Mar 2019 15:35:38 +0000 (10:35 -0500)]
zebra: Uninstall nexthops on shutdown

Add functionality to uninstall nexthops we created on shutdown.
To account for this, I added in a function for zebra_router
cleanup in a shutdown event.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Uninstall nexthop when ref count hits zero
Stephen Worley [Fri, 8 Mar 2019 15:29:43 +0000 (10:29 -0500)]
zebra: Uninstall nexthop when ref count hits zero

When nexthop entry reference counts hit zero and
we created them, uninstall them from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add calls to the nexthop context process result function
Stephen Worley [Fri, 8 Mar 2019 15:26:33 +0000 (10:26 -0500)]
zebra: Add calls to the nexthop context process result function

Added in case statements to handle finished dataplane contexts
and then handle them with the nexthop process result function.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Set the INSTALLED flags on nexthop entries we receive
Stephen Worley [Fri, 8 Mar 2019 15:23:34 +0000 (10:23 -0500)]
zebra: Set the INSTALLED flags on nexthop entries we receive

Add SETs to the flags on nexthop entries to mark
 installed/uninstalled from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Route entries use nexthop entry ID's instead of pointers
Stephen Worley [Fri, 8 Mar 2019 15:16:52 +0000 (10:16 -0500)]
zebra: Route entries use nexthop entry ID's instead of pointers

Switched the route entries to use ID's instead of pointers.
Perform lookups with the ID and then check if its null.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add dataplane process result function for nexthops
Stephen Worley [Thu, 7 Mar 2019 23:15:30 +0000 (18:15 -0500)]
zebra: Add dataplane process result function for nexthops

Add a function that can handle the results of a dataplane
ctx status, dpending on the operation performed.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add functions for installing/uninstalling nexthops
Stephen Worley [Thu, 7 Mar 2019 23:11:57 +0000 (18:11 -0500)]
zebra: Add functions for installing/uninstalling nexthops

Add functions for sending a nexthop to be queued on the dataplane
for install/uninstall into the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Force re-install nexthop if still referenced
Stephen Worley [Wed, 6 Mar 2019 20:04:23 +0000 (15:04 -0500)]
zebra: Force re-install nexthop if still referenced

Added functionality so that when we receive a RTM_DELNEXTHOP
for a nhg_hash_entry that is still being referenced by
a route, we immediately push it back to the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add function to install a nhe into the kernel
Stephen Worley [Wed, 6 Mar 2019 19:58:57 +0000 (14:58 -0500)]
zebra: Add function to install a nhe into the kernel

Add a function for installing Nexthop Group hash entires into
the kernel. It sends the entry to the dataplane and does any
post-processing immediately after that.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add a queued flag to nhg_hash_entry
Stephen Worley [Wed, 6 Mar 2019 19:56:04 +0000 (14:56 -0500)]
zebra: Add a queued flag to nhg_hash_entry

Added a NEXTHOP_GROUP_QUEUED flag to the nexthop
group hash entry struct. This indicates when we have
sent it to be installed to the kernel and are waiting
for the dataplane provider to process it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Return proper status result
Stephen Worley [Wed, 6 Mar 2019 19:10:08 +0000 (14:10 -0500)]
zebra: Return proper status result

We were ignoring the status result interger from
the netlink request and message parsing and just
returning 0. Fixed this to return the result of the last one.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add kernel condition check to see if it supports nexthops
Stephen Worley [Wed, 6 Mar 2019 19:08:13 +0000 (14:08 -0500)]
zebra: Add kernel condition check to see if it supports nexthops

Added a check on startup for determining if the kernel supports
nexthop objects. It sets an appropriate bool on the zebra namespace
struct.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Use the dest prefix for determining nexthop family
Stephen Worley [Wed, 6 Mar 2019 18:43:40 +0000 (13:43 -0500)]
zebra: Use the dest prefix for determining nexthop family

Device only nexthops still need an address family associated
with them. Decided to get this from the destination prefix on it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add debug statement for nexthop netlink messages
Stephen Worley [Wed, 6 Mar 2019 18:42:05 +0000 (13:42 -0500)]
zebra: Add debug statement for nexthop netlink messages

Add the zebra kernel debug statement for nexthop messages
so we can see them via vtysh.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add namespace info to the nexthop dataplane ctx
Stephen Worley [Wed, 6 Mar 2019 18:35:31 +0000 (13:35 -0500)]
zebra: Add namespace info to the nexthop dataplane ctx

The nexthop dataplane context was not getting populated with
namespace info for its netlink messages. Fixed this to do
lookups the same way we do it with route contexts.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add kernel debugging function for netlink nexthop messages
Stephen Worley [Wed, 6 Mar 2019 16:13:43 +0000 (11:13 -0500)]
zebra: Add kernel debugging function for netlink nexthop messages

We needed a kernel debugging function for netlink nexthop
messages when people are debugging kernel zebra messages.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add base functionality for nexthop processing via the dataplane
Stephen Worley [Fri, 1 Mar 2019 22:17:00 +0000 (17:17 -0500)]
zebra: Add base functionality for nexthop processing via the dataplane

Add all the neccessary code to allow nexthops to be processed
in separate dataplane contexts with the netlink dataplane kernel
provider.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add an error code for NHG update failures
Stephen Worley [Mon, 4 Mar 2019 16:25:42 +0000 (11:25 -0500)]
zebra: Add an error code for NHG update failures

We needed an error code that can be used when we
fail to install a nexthop group into the kernel/fib.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add flags to nexthops received from the kernel
Stephen Worley [Mon, 4 Mar 2019 16:54:44 +0000 (11:54 -0500)]
zebra: Add flags to nexthops received from the kernel

Added the appropriate flags that need to be set when
we receive a nexthop from the kernel. They should be
marked as ACTIVE and that they are in the FIB.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add functionality to parse RTM_NEWNEXTHOP and RTM_DELNEXTHOP messages
Stephen Worley [Mon, 25 Feb 2019 23:18:07 +0000 (18:18 -0500)]
zebra: Add functionality to parse RTM_NEWNEXTHOP and RTM_DELNEXTHOP messages

Add the functionality to parse new nexthop group messages
from the kernel and insert them into the appropriate hash
tables. Parsing is done at startup between interface and
interface address lookup. Add functionality to parse
changes to nexthops we already have. Add functionality
to parse delete nexthop messages from the kernel and
remove them from our table.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Remove afi field in nexthop hash entry
Stephen Worley [Mon, 25 Feb 2019 22:59:28 +0000 (17:59 -0500)]
zebra: Remove afi field in nexthop hash entry

I do not believe we should be hashing based on AFI
in for our upper level nexthop group entries. These
should be ambiguous with regards to  address families since
an ipv4 or ipv6 address can have the same interface
nexthop. This can be seen in NEXTHOP_TYPE_IFINDEX.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add error code for duplicate nexthops
Stephen Worley [Mon, 25 Feb 2019 18:58:32 +0000 (13:58 -0500)]
zebra: Add error code for duplicate nexthops

Add an error code that indicates we received a nexthop
from the kernel that is identical to one it/we already
have other than its ID.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add beginnings of nexthop group work queue
Donald Sharp [Tue, 26 Feb 2019 13:43:49 +0000 (08:43 -0500)]
zebra: Add beginnings of nexthop group work queue

Add the basic infrastructure for a nexthop group work queue.

This queue will be used to validate and then install the
new nexthop group.

The result from the kernel when a new nexthop group is installed
will cause the route entries that depend on it to be installed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add a nhe pointer to the route entry
Donald Sharp [Tue, 26 Feb 2019 13:16:11 +0000 (08:16 -0500)]
zebra: Add a nhe pointer to the route entry

Add a nexthop hash entry to the route_entry so that we can
track the nhe with the route entry.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add error codes for nhg table insert failures
Stephen Worley [Fri, 22 Feb 2019 19:12:46 +0000 (14:12 -0500)]
zebra: Add error codes for nhg table insert failures

Since we are using two different tables to hash the next groups with,
lets add an error message in case there is a failure to insert into
one of them. This will help to notify if the tables are not synced.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add a second table for indexing by ID
Stephen Worley [Fri, 15 Feb 2019 18:18:48 +0000 (13:18 -0500)]
zebra: Add a second table for indexing by ID

The messages we get from the kernel come with ids only
for groups, so lets index with those as well. Also adding
a helper function for lookup and get with the two different
tables.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Separate interface address lookup
Stephen Worley [Fri, 15 Feb 2019 17:28:56 +0000 (12:28 -0500)]
zebra: Separate interface address lookup

Separate interface lookup into its own function.
We need to know interfaces for reading in nexthop
information, but we need to know nexthops for reading
in the interface addresses. We will read in nexthops
between the two.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add error code for bad nhg messages from the kernel
Stephen Worley [Thu, 14 Feb 2019 22:42:25 +0000 (17:42 -0500)]
zebra: Add error code for bad nhg messages from the kernel

Needed an error code for nhg messages from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Remove nexthop_active_num from route entry
Donald Sharp [Fri, 15 Feb 2019 16:39:12 +0000 (11:39 -0500)]
zebra: Remove nexthop_active_num from route entry

The nexthop_active_num data structure is a property of the
nexthop group.  Move the keeping of this data to that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove re->nexthop_num from re
Donald Sharp [Fri, 15 Feb 2019 16:16:22 +0000 (11:16 -0500)]
zebra: Remove re->nexthop_num from re

The nexthop_num is not a function of the re.  It is owned
by the nexthop group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Replace nexthop_group with pointer in route entry
Donald Sharp [Wed, 13 Feb 2019 21:06:48 +0000 (16:06 -0500)]
zebra: Replace nexthop_group with pointer in route entry

In the route_entry we are keeping a non pointer based
nexthop group, switch the code to use a pointer for all
operations here and ensure we create and delete the memory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add base functionality for nexthop messages in kernel_netlink
Stephen Worley [Wed, 13 Feb 2019 20:32:59 +0000 (15:32 -0500)]
zebra: Add base functionality for nexthop messages in kernel_netlink

Add some base functionality so we can verify we are getting messages
about nexthops from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add RTNLGRP_NEXTHOP group to the kernel socket
Stephen Worley [Thu, 7 Mar 2019 22:55:31 +0000 (17:55 -0500)]
zebra: Add RTNLGRP_NEXTHOP group to the kernel socket

Initialize the netlink socket with the RTNLGRP_NEXTHOP
group as well to listen for.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agolinux: Update our netlink headers for nexthop group support
Stephen Worley [Tue, 12 Feb 2019 19:32:07 +0000 (14:32 -0500)]
linux: Update our netlink headers for nexthop group support

The linux kernel is adding support for nexthop groups. Update our
includes to reflect new types and structs we should be listening
for from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add code to create/remove nexthop groups
Donald Sharp [Sat, 26 Jan 2019 01:11:21 +0000 (20:11 -0500)]
zebra: Add code to create/remove nexthop groups

Add some code to create/remove nexthop groups.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add ability to find(create) and release a nhg from a re
Donald Sharp [Thu, 24 Jan 2019 15:49:28 +0000 (10:49 -0500)]
zebra: Add ability to find(create) and release a nhg from a re

Add some code to allow us to do lookups and releases of
nexthop groups from zebra.  At this point we do not do anything
with it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add some basic flags to the zebra nexthop group
Donald Sharp [Thu, 24 Jan 2019 02:32:49 +0000 (21:32 -0500)]
zebra: Add some basic flags to the zebra nexthop group

We need to track if a nexthop group is valid and installed,
so create some basic flags to track this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add show command to dump nexthop-group information for Zebra
Donald Sharp [Thu, 24 Jan 2019 02:16:41 +0000 (21:16 -0500)]
zebra: Add show command to dump nexthop-group information for Zebra

Just a simple addition of a command to dump the nexthop group information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add hash of nexthop groups
Donald Sharp [Thu, 24 Jan 2019 13:06:34 +0000 (08:06 -0500)]
zebra: Add hash of nexthop groups

This commit does nothing more than just create a hash structure
that we will use to track nexthop groups.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5213 from mjstapp/fix_sysctl_h
Donatas Abraitis [Fri, 25 Oct 2019 05:40:28 +0000 (08:40 +0300)]
Merge pull request #5213 from mjstapp/fix_sysctl_h

lib: Remove include of deprecated sysctl.h

5 years agoMerge pull request #5200 from ton31337/feature/doc_access-list_sequence_numbers
Donald Sharp [Fri, 25 Oct 2019 01:24:56 +0000 (21:24 -0400)]
Merge pull request #5200 from ton31337/feature/doc_access-list_sequence_numbers

doc: Update documentation for access-list with sequence numbers

5 years agoMerge pull request #5220 from dslicenc/remove-afi-safi-msg
Donatas Abraitis [Thu, 24 Oct 2019 15:19:13 +0000 (18:19 +0300)]
Merge pull request #5220 from dslicenc/remove-afi-safi-msg

bgpd: remove error message for unkown afi/safi combination

5 years agoMerge pull request #5219 from pguibert6WIND/interface_same_name
Donatas Abraitis [Thu, 24 Oct 2019 14:01:56 +0000 (17:01 +0300)]
Merge pull request #5219 from pguibert6WIND/interface_same_name

staticd: check tuple (vrf, name) when interface events received

5 years agobgpd: remove error message for unkown afi/safi combination
Don Slice [Wed, 23 Oct 2019 16:30:28 +0000 (16:30 +0000)]
bgpd: remove error message for unkown afi/safi combination

Problem reported with error messages appearing in the log
complaining about invalid afi/safi combinations.  Determined
that the error messages were recently added in the function
that turns afi and safi values to strings.  Unfortunately,
the function is called from places using FOREACH_AFI_SAFI,
which spins thru every afi and safi number including some
that are not legal together (ipv4 evpn and l2vpn multicast
for example.)   This fix removes these error messages since
it is not necessarily an error to call it with invalid
combinations.

Ticket: CM-26883
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #5203 from qlyoung/fix-vrrp-error-alternations
Renato Westphal [Thu, 24 Oct 2019 00:16:04 +0000 (21:16 -0300)]
Merge pull request #5203 from qlyoung/fix-vrrp-error-alternations

vrrpd: fix startup error message reporting

5 years agoMerge pull request #5217 from mjstapp/fix_bgp_evpn_pi
Renato Westphal [Thu, 24 Oct 2019 00:02:00 +0000 (21:02 -0300)]
Merge pull request #5217 from mjstapp/fix_bgp_evpn_pi

bgpd: clarify evpn datastruct use for SA

5 years agoMerge pull request #5214 from donaldsharp/vrrp_doc
Renato Westphal [Thu, 24 Oct 2019 00:00:25 +0000 (21:00 -0300)]
Merge pull request #5214 from donaldsharp/vrrp_doc

doc: Update supported platforms matrix w/ vrrpd

5 years agoMerge pull request #5202 from Orange-OpenSource/isis-TE
Renato Westphal [Wed, 23 Oct 2019 23:59:29 +0000 (20:59 -0300)]
Merge pull request #5202 from Orange-OpenSource/isis-TE

isisd: Correct missing advertisement of TE parameters

5 years agostaticd: check tuple (vrf, name) when interface events received
Philippe Guibert [Wed, 23 Oct 2019 14:53:09 +0000 (16:53 +0200)]
staticd: check tuple (vrf, name) when interface events received

with network namespace vrf backend, there is possibilities that the same
interface name can be used across two different vrfs. Then, enforce the
check when static daemon receives interface events. Adding to the
interface name, check for the vrf id, too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: clarify evpn datastruct use for SA
Mark Stapp [Wed, 23 Oct 2019 15:56:35 +0000 (11:56 -0400)]
bgpd: clarify evpn datastruct use for SA

Clear up an SA report by clarifying a function call in the evpn
code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agodoc: Update supported platforms matrix w/ vrrpd
Donald Sharp [Wed, 23 Oct 2019 13:11:45 +0000 (09:11 -0400)]
doc: Update supported platforms matrix w/ vrrpd

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Remove include of deprecated sysctl.h
Mark Stapp [Wed, 23 Oct 2019 13:08:21 +0000 (09:08 -0400)]
lib: Remove include of deprecated sysctl.h

Stop including deprecated header file; appears to be unused and
it has been deprecated in recent linux.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #5204 from ghasemnaddaf/vrrp_updates
Quentin Young [Tue, 22 Oct 2019 15:27:29 +0000 (11:27 -0400)]
Merge pull request #5204 from ghasemnaddaf/vrrp_updates

doc: vrrp vip must not be on parent interface

5 years agoMerge pull request #5193 from qlyoung/doc-release-fixes
Donatas Abraitis [Tue, 22 Oct 2019 06:57:12 +0000 (09:57 +0300)]
Merge pull request #5193 from qlyoung/doc-release-fixes

Document release procedure

5 years agodoc: vrrp vip must not be on parent interface
Ghasem Naddaf [Mon, 21 Oct 2019 21:58:16 +0000 (14:58 -0700)]
doc: vrrp vip must not be on parent interface

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
5 years agovrrpd: fix startup error message reporting
Quentin Young [Mon, 21 Oct 2019 18:21:16 +0000 (18:21 +0000)]
vrrpd: fix startup error message reporting

Due to some extremely shoddy programming on my part, the error messages
for certain errors was pretty much always wrong. We would start with the
correct error message, then on the next check, regardless of whether it
passed or failed, we would null out the error message, then on the next
one set it again (to the wrong message), then null it, and just keep
alternating. So errors were sometimes not being reported, sometimes
being reported correctly (if the condition parity happened to match the
appropriate condition), and sometimes being reported correctly.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoisisd: Correct missing advertisement of TE param.
Olivier Dugeon [Mon, 21 Oct 2019 16:39:15 +0000 (18:39 +0200)]
isisd: Correct missing advertisement of TE param.

Traffic Engineering parameters are correctly advertised in LSP when
'mpls-te on' CLI command is present in the startup config file.

However, if IS-IS is started without TE enable at startup and
'mpls-te on' command is issued after, TE link parameters are never
announced. The patch correct this issue.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
5 years agodoc: strip ws, shell -> console
Quentin Young [Mon, 21 Oct 2019 16:11:09 +0000 (16:11 +0000)]
doc: strip ws, shell -> console

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agodoc: Update documentation for access-list with sequence numbers
Donatas Abraitis [Mon, 21 Oct 2019 15:04:39 +0000 (18:04 +0300)]
doc: Update documentation for access-list with sequence numbers

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5108 from donaldsharp/sendbuffer_size_bgp
Donatas Abraitis [Sun, 20 Oct 2019 09:09:42 +0000 (12:09 +0300)]
Merge pull request #5108 from donaldsharp/sendbuffer_size_bgp

Sendbuffer size bgp

5 years agoMerge pull request #5184 from sworleys/Kernel-Route-Update
Mark Stapp [Sat, 19 Oct 2019 16:01:47 +0000 (12:01 -0400)]
Merge pull request #5184 from sworleys/Kernel-Route-Update

zebra: Rib Update Event Scheduler For Un-managed Routes, etc.