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>
Donald Sharp [Wed, 16 Oct 2019 17:19:09 +0000 (13:19 -0400)]
*: Allow disabling of `getrusage` calls
getrusage, in a heavily stressed system, can account for
signficant running time due to process switching to the kernel.
Allow the end-operator to specify `--disable-cpu-time` to
avoid this call. Additionally we cause `show thread cpu` to
not show up if this is selected.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Mark Stapp [Wed, 16 Oct 2019 12:51:43 +0000 (08:51 -0400)]
nhrpd: be more careful with linked lists
NHRPD has its own linked-list implementation, and one of the
apis is a little free and easy with pointers. Also be safer
with one list iteration operation.
GalaxyGorilla [Tue, 15 Oct 2019 11:15:22 +0000 (11:15 +0000)]
lib: Let libyang log everything possible
Currently libyang logs errors only (LY_LLERR by default), independent of
FRR's log level. This commit lets libyang log everything including all
sorts of debug logs (when libyang is built in 'Debug' mode). FRR's
logging infrastructure filters logs out according to the configured log
level.
There is a very small performance overhead involved, even when libyang
is build in 'Release' mode. This overhead is mainly affecting config
processing and barely measurable being around 0-3% of the processing
time without this change.
Stephen Worley [Tue, 15 Oct 2019 19:39:49 +0000 (15:39 -0400)]
zebra: Don't bother ref'ing ifp in zebra_pbr_rule
If we only really use the ifp for the name, then
don't bother referencing the ifp. If that ifp is
freed, we don't expect zebra to handle the rules that
use it (that's pbrd's job), so it is going to be
pointing to unintialized memory when we decide to remove
that rule later. Thus, just keep the name in the data
and dont mess with pointer refs.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Stephen Worley [Tue, 15 Oct 2019 18:50:10 +0000 (14:50 -0400)]
zebra: Use the rule ifindex as a hash key, not ifp
Use the ifindex value as a primary hash key/identifier, not
the ifp pointer. It is possible for that data to be freed
and then we would not be able to hash and find the rule entry
anymore. Using the ifindex, we can still find the rule even
if the interface is removed.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Stephen Worley [Tue, 15 Oct 2019 17:42:15 +0000 (13:42 -0400)]
zebra: Only free if rule was found/release in table
We were seeing a double free on shutdown if the
hash release fails here due to the interface state
changing. We probably shouldn't free the data if its
still being handled in the table so adding a check there
and a debug message.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>