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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
Stephen Worley [Thu, 17 Oct 2019 19:44:08 +0000 (15:44 -0400)]
zebra: On if down/addr-del, process kernel routes
Since we don't have a daemon who's job is to handle kernel
routes and we don't get an explicit route delete anymore if
nexthops become unreachable from the kernel, zebra must
re-process kernel routes itself to make sure they are still valid.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Stephen Worley [Thu, 17 Oct 2019 19:41:25 +0000 (15:41 -0400)]
zebra: Check active on OLD system/kernel routes
We can assume that system/kernel routes are valid indeed
if this is our first time procesing them. But since we don't
get explicit deletion events for kernel routes anymore, we
have to be prepared to process them if the nexthop becomes
unreachable for instance. Therefore, if the route is not NEW,
then don't assume its valid.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Stephen Worley [Thu, 17 Oct 2019 19:38:54 +0000 (15:38 -0400)]
zebra: Handle rib updates as a thread event
If we need to batch process the rib (all tables or specific
vrf), do so as a scheduled thread event rather than immediately
handling it. Further, add context to the events so that you
narrow down to certain route types you want to reprocess.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>