]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 years agoisisd: fix node for clear commands 7220/head
Igor Ryzhov [Thu, 1 Oct 2020 14:11:35 +0000 (17:11 +0300)]
isisd: fix node for clear commands

These are only clear commands in FRR available from view node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #7203 from idryzhov/fix-vtysh-isisd-fabricd
Donald Sharp [Wed, 30 Sep 2020 10:28:51 +0000 (06:28 -0400)]
Merge pull request #7203 from idryzhov/fix-vtysh-isisd-fabricd

vtysh: fix commands when building only isisd or fabricd

4 years agoMerge pull request #7201 from mjstapp/fix_topo_ubu20
Donald Sharp [Tue, 29 Sep 2020 22:14:30 +0000 (18:14 -0400)]
Merge pull request #7201 from mjstapp/fix_topo_ubu20

tests: pim-basic mcast scripts fixes for python3

4 years agovtysh: fix commands when building only isisd or fabricd 7203/head
Igor Ryzhov [Tue, 29 Sep 2020 22:08:17 +0000 (01:08 +0300)]
vtysh: fix commands when building only isisd or fabricd

 * add files to vtysh_scan when building only fabricd
 * don't add isisd/fabricd commands when daemon build is disabled

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agotests: pim-basic mcast scripts fixes for python3 7201/head
Mark Stapp [Tue, 29 Sep 2020 17:14:39 +0000 (13:14 -0400)]
tests: pim-basic mcast scripts fixes for python3

The pim-basic suite uses some private python scripts to
send and receive mcast traffic: revise them to support
both py2 and py3.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #7192 from deastoe/zebra-fpm-blackhole-abort
Donald Sharp [Tue, 29 Sep 2020 17:47:38 +0000 (13:47 -0400)]
Merge pull request #7192 from deastoe/zebra-fpm-blackhole-abort

zebra: fix FPM abort for unreach/prohibit routes

4 years agoMerge pull request #7039 from opensourcerouting/bgp-norib-runtime
Donald Sharp [Tue, 29 Sep 2020 17:42:02 +0000 (13:42 -0400)]
Merge pull request #7039 from opensourcerouting/bgp-norib-runtime

bgpd: set/unset no-rib option at runtime

4 years agoMerge pull request #7156 from sworleys/PBR-Cleanup-IFp-No-Send
Mark Stapp [Tue, 29 Sep 2020 17:40:42 +0000 (13:40 -0400)]
Merge pull request #7156 from sworleys/PBR-Cleanup-IFp-No-Send

pbrd: cleanup pbr ifp info if not sent to zebra

4 years agoMerge pull request #7198 from idryzhov/vtysh-disable-daemon
Donald Sharp [Tue, 29 Sep 2020 17:25:34 +0000 (13:25 -0400)]
Merge pull request #7198 from idryzhov/vtysh-disable-daemon

vtysh: respect --disable-daemon configure flags

4 years agoMerge pull request #7188 from chiragshah6/evpn_dev
Patrick Ruddy [Tue, 29 Sep 2020 15:33:19 +0000 (16:33 +0100)]
Merge pull request #7188 from chiragshah6/evpn_dev

zebra: EVPN avoid duplicate list-node in l3vni's l2vni-list

4 years agoMerge pull request #7199 from donaldsharp/nhg_reasons
Mark Stapp [Tue, 29 Sep 2020 15:02:53 +0000 (11:02 -0400)]
Merge pull request #7199 from donaldsharp/nhg_reasons

Nhg reasons

4 years agoMerge pull request #7177 from mjstapp/fix_topo_tab_open
Donald Sharp [Tue, 29 Sep 2020 14:06:48 +0000 (10:06 -0400)]
Merge pull request #7177 from mjstapp/fix_topo_tab_open

tests: python3 compat fixes for topotests: tabs and misc api

4 years agoMerge pull request #7197 from idryzhov/fix-tests
Donald Sharp [Tue, 29 Sep 2020 13:59:20 +0000 (09:59 -0400)]
Merge pull request #7197 from idryzhov/fix-tests

tests: skip tests when building without daemon

4 years agozebra: fix FPM abort for unreach/prohibit routes 7192/head
Duncan Eastoe [Mon, 28 Sep 2020 11:51:19 +0000 (12:51 +0100)]
zebra: fix FPM abort for unreach/prohibit routes

b0e9567ed162da708f8d0b3a3caf87cd03b62e96 fixed an issue whereby
zebra would abort while building an update for a blackhole route.

The same issue, `assert(data_len)` failing in
`zfpm_build_route_updates()`, can be observed when building updates
for unreachable and prohibit routes.

To address this `netlink_route_info_fill()` is updated to not
indicate failure, due to lack of nexthops, for any blackhole routes.

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
4 years agozebra: Make nexthop_active check use the same debug 7199/head
Donald Sharp [Tue, 29 Sep 2020 11:54:35 +0000 (07:54 -0400)]
zebra: Make nexthop_active check use the same debug

When debugging why a route was not successfully installed into the
rib, it would be preferable that the end user only have to turn
on `debug zebra rib detail` as that is what we have been telling
people to do for the last couple of years.  Consolidate *back*
to this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agozebra: Add missing reason we could not make an active_nexthop check
Donald Sharp [Tue, 29 Sep 2020 11:45:19 +0000 (07:45 -0400)]
zebra: Add missing reason we could not make an active_nexthop check

Add a missing reason as to why we are unable to make an active nexthop
check be successful.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agovtysh: respect --disable-daemon configure flags 7198/head
Igor Ryzhov [Tue, 29 Sep 2020 10:12:55 +0000 (13:12 +0300)]
vtysh: respect --disable-daemon configure flags

Don't install nodes for daemons that are disabled by configure flags.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agovtysh: rearrange commands per daemon and node
Igor Ryzhov [Tue, 29 Sep 2020 08:17:04 +0000 (11:17 +0300)]
vtysh: rearrange commands per daemon and node

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #7193 from idryzhov/vtysh-fixes
Donald Sharp [Tue, 29 Sep 2020 11:00:13 +0000 (07:00 -0400)]
Merge pull request #7193 from idryzhov/vtysh-fixes

vtysh fixes

4 years agotests: skip tests when building without daemon 7197/head
Igor Ryzhov [Tue, 29 Sep 2020 10:05:45 +0000 (13:05 +0300)]
tests: skip tests when building without daemon

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agozebra: avoid duplication node in l3vni l2vni-list 7188/head
Chirag Shah [Sun, 27 Sep 2020 21:09:43 +0000 (14:09 -0700)]
zebra: avoid duplication node in l3vni l2vni-list

With l2vni flap leading to duplicate entry creation
in l3vni's l2vni-list.
Use list sorted add with no duplicates.

root@TORC11:mgmt:~# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  State: Up
  ...
  L2 VNIs: 1000 1000 1000 0 0 1002
root@TORC11:mgmt:~# ip link set down vx-1002
root@TORC11:mgmt:~# ip link set up vx-1002
root@TORC11:mgmt:~# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  State: Up
  ...
  L2 VNIs: 1000 1000 1000 0 0 1002 1002

Ticket:CM-31545
Reviewed By:
Testing Done:

With Fix:
Multiple time flaps vni counts remained the same.

root@TORC11:mgmt:~# ip link set down vx-1002
root@TORC11:mgmt:~# ip link set up vx-1002
root@TORC11:mgmt:~# ip link set down vx-1002
root@TORC11:mgmt:~# ip link set up vx-1002
root@TORC11:mgmt:~# net show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  State: Up
  ...
  L2 VNIs: 1000 1002

Signed-off-by: Chirag Shah <chirag@nvidia.com>
4 years agoMerge pull request #6799 from sworleys/Proto-NHG
Mark Stapp [Mon, 28 Sep 2020 20:29:14 +0000 (16:29 -0400)]
Merge pull request #6799 from sworleys/Proto-NHG

EVPN Multihoming part-2 - NHG ZAPI Infrastructure and Sharpd Implementation

4 years agozebra: set NHG/backup NHG pointers on success zapi read 6799/head
Stephen Worley [Mon, 28 Sep 2020 16:39:22 +0000 (12:39 -0400)]
zebra: set NHG/backup NHG pointers on success zapi read

Only set the NHG/backup NHG pointers of the caller if the read
of the nexthops was successfull. Otherwise, we might free when not
neccessary or double free.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agosharpd: make id log more specific
Stephen Worley [Mon, 28 Sep 2020 15:37:56 +0000 (11:37 -0400)]
sharpd: make id log more specific

Make ID log more specific as to the ID being assigned here.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra,sharpd: add code for backup proto-NHs but disabled
Stephen Worley [Fri, 25 Sep 2020 17:48:21 +0000 (13:48 -0400)]
lib,zebra,sharpd: add code for backup proto-NHs but disabled

Add the zapi code for encoding/decoding of backup nexthops for when
we are ready for it, but disable it for now so that we revert
to the old way with them.

When zebra gets a proto-NHG with a backup in it, we early fail and
tell the upper level proto. In this case sharpd. Sharpd then reverts
to the old way of installation with the route.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,sharpd: align zapi NHG apis a bit
Stephen Worley [Tue, 22 Sep 2020 19:27:35 +0000 (15:27 -0400)]
lib,sharpd: align zapi NHG apis a bit

Align the zapi NHG apis to be more consistent with the zapi_route
apis. Add a struct zapi_nhg to use for encodings as well.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: add type to nhg_prot_del API for sanity check
Stephen Worley [Tue, 15 Sep 2020 17:42:49 +0000 (13:42 -0400)]
zebra: add type to nhg_prot_del API for sanity check

Add type to the nhg_proto_del API params for sanity checking
that the types of the route sent by the proto matches the type
found with the ID.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agosharp: add check for num_nh > multipath
Stephen Worley [Fri, 11 Sep 2020 21:59:30 +0000 (17:59 -0400)]
sharp: add check for num_nh > multipath

Add a check for installing nexthop_group greater than multipath
number. Truncate if we hit it and log a warning to the user.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: free ctx if we skip replace for NHG PROTO routes
Stephen Worley [Thu, 3 Sep 2020 17:44:14 +0000 (13:44 -0400)]
zebra: free ctx if we skip replace for NHG PROTO routes

Free the ctx if we decide we dont need to do anything with
this route update.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: limit no re-install to NHG PROTO using routes
Stephen Worley [Thu, 3 Sep 2020 17:04:10 +0000 (13:04 -0400)]
zebra: limit no re-install to NHG PROTO using routes

Limit the not re-installation of routes with the same NHG ID
to routes that are using the new NHG PROTO API. This would
only include sharpd and EVPN-MH for now.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: add doc to clear-up hash_iterate multi deletion
Stephen Worley [Tue, 1 Sep 2020 20:02:12 +0000 (16:02 -0400)]
lib: add doc to clear-up hash_iterate multi deletion

Add some header documentation to make it clear that you
cannot delete more than one item during each iteration.
Doing so could cause memory corruption for next pointer
if its also deleted from the table.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: use list to mark for removal when scoring
Stephen Worley [Tue, 1 Sep 2020 18:53:09 +0000 (14:53 -0400)]
zebra: use list to mark for removal when scoring

In scoring our NHEs during shutdown there is a chance we could release mutliple
NHEs at the same time during one iteration. This can cause memory corruption
if the two being released are directly next to each other in the hash table.

hash_iterate accounts for releasing one during the iteration but not
two by setting hbnext before release but if hbnext is also freed,
we obviously can have a problem.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: add proto NHG Notif header to log command types
Stephen Worley [Fri, 14 Aug 2020 17:32:38 +0000 (13:32 -0400)]
lib: add proto NHG Notif header to log command types

Add the proto Nexthop Group Notify Owner header to
the log command types for string conversion.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agotests: add topotest for NHG Proto APIs
Stephen Worley [Mon, 3 Aug 2020 18:43:01 +0000 (14:43 -0400)]
tests: add topotest for NHG Proto APIs

Add a topotest for basic NHG Proto Add/Del/Replace.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: reject proto NHGs of blackhole/interface
Stephen Worley [Mon, 3 Aug 2020 18:34:52 +0000 (14:34 -0400)]
zebra: reject proto NHGs of blackhole/interface

Reject proto NHGs of type blackhole/interface for now.
We need to think a bit more about how to resolve these
given the linux kernel needs to know the Address Family
of the routes that will use them and install it with them.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra,sharpd: checkpatch fixes
Stephen Worley [Wed, 29 Jul 2020 17:11:37 +0000 (13:11 -0400)]
zebra,sharpd: checkpatch fixes

Check patches fixes for NHG API pathes.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra,sharpd: clang format
Stephen Worley [Tue, 28 Jul 2020 21:36:51 +0000 (17:36 -0400)]
lib,zebra,sharpd: clang format

Clang format for NHG API and sharpd patches.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: clean up the NHG proto zapi code a bit
Stephen Worley [Wed, 22 Jul 2020 18:04:07 +0000 (14:04 -0400)]
zebra: clean up the NHG proto zapi code a bit

Clean up the function names and remove some TODOs that are no
longer needed/hacks we used for testing.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: multipath number checks with NHG proto
Stephen Worley [Wed, 22 Jul 2020 18:02:11 +0000 (14:02 -0400)]
zebra: multipath number checks with NHG proto

Get the multipath number checks working with proto-based NHG
message decoding in zapi_msg.c

Modify the function that checks this for routes to work without
being passed a prefix as is the case with NHG creates.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: add flag track released state of proto NHGS
Stephen Worley [Wed, 22 Jul 2020 17:45:47 +0000 (13:45 -0400)]
zebra: add flag track released state of proto NHGS

Add a flag to track the released state of a proto-based NHG.

This flag is used to know whether the upper level proto has called
the *_del API. Typically, the NHG would just get removed and uninstalled
at this point but there is a chance we are being sent it while routes
are still being owned or we were sent it multiple times. This flag
and associated code handles that.

Ticket: CM-30369

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agosharpd: implement NHG notification handling
Stephen Worley [Thu, 11 Jun 2020 17:49:25 +0000 (13:49 -0400)]
sharpd: implement NHG notification handling

Implement handling of NHG notifications in sharpd so that
the routes don't attempt to use an NHG ID that did not
successfully get created. If it does not get installed, we
fall back to traditional zapi messaging.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: reply fail on NHG add if not ifindex/onlink
Stephen Worley [Thu, 11 Jun 2020 17:46:48 +0000 (13:46 -0400)]
zebra: reply fail on NHG add if not ifindex/onlink

We currently don't support ADD/DEL/REPLACE with proto-based
NHGs that are not already fully resolved and ifindex/onlink
based. If we are handed one that doesn't have ifindex set
i.e. recursive, gracefully fail and with a notification.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra: fixup NHG notify zapi messaging
Stephen Worley [Thu, 11 Jun 2020 17:45:03 +0000 (13:45 -0400)]
lib,zebra: fixup NHG notify zapi messaging

Make the message parameters align better with other zapi
notifications and change the ID to correctly be a uint32.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Properly set NEXTHOP_FLAG_FIB when skipping install
Donald Sharp [Thu, 11 Jun 2020 11:34:18 +0000 (07:34 -0400)]
zebra: Properly set NEXTHOP_FLAG_FIB when skipping install

When the dataplane detects that we have no need to
reinstall the same route, setup the NEXTHOP_FLAG_FIB
appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Only install a minimal amount of times
Donald Sharp [Thu, 11 Jun 2020 11:34:18 +0000 (07:34 -0400)]
zebra: Only install a minimal amount of times

The code was installing the nexthop group again using
the NLM_F_REPLACE function causing extremely large
route installation times.  This reduces the time from
installing 1 million routes from sharpd with a nhg
from > 200 seconds ( where I gave up ) to ~15
seconds on my machine for 32 x ecmp.  As a side note 1 million
routes using master sharpd takes ~50 seconds to do
the same thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoRevert "lib,sharpd,pbrd: `set installable` nhg command"
Stephen Worley [Fri, 24 Jul 2020 21:50:20 +0000 (17:50 -0400)]
Revert "lib,sharpd,pbrd: `set installable` nhg command"

This reverts commit 1844f45e30913b27cfd875036f865a0edadcf244.

4 years agozebra: add logging for NHG ignoring in netlink
Stephen Worley [Thu, 28 May 2020 17:22:18 +0000 (13:22 -0400)]
zebra: add logging for NHG ignoring in netlink

Add some logging for when we choose to ignore a NHG install
for one reason or another. Also, cleanup some of the code
using the same accessor functions for the context object.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: add logging for ZEBRA_NHG_ADD[DEL]
Stephen Worley [Thu, 28 May 2020 16:08:29 +0000 (12:08 -0400)]
lib: add logging for ZEBRA_NHG_ADD[DEL]

Add logging info for the new zapi ZEBRA_NHG_ADD[DEL]
message types. With this patch, they are logged properly
when debugs are turned on.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,sharpd,pbrd: `set installable` nhg command
Stephen Worley [Wed, 27 May 2020 21:39:41 +0000 (17:39 -0400)]
lib,sharpd,pbrd: `set installable` nhg command

Add a command `set installable` that allows configured nexthop
groups to be treated as separate/installable objects in the RIB.

A callback needs to be implemented per daemon to handle installing
the NHG into the rib via zapi when this command is set. This
patch includes the implementation for sharpd.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: return the proto nhe on del even with refs
Stephen Worley [Sun, 24 May 2020 20:08:36 +0000 (16:08 -0400)]
zebra: return the proto nhe on del even with refs

Return the proto nhe on del even if their are still possible
route references.

We may get a del before the routes are removed. So we still need
to return this to the caller so they can decrement the ref.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: fix releasing proto-owned singletons
Stephen Worley [Sun, 24 May 2020 20:03:01 +0000 (16:03 -0400)]
zebra: fix releasing proto-owned singletons

Fix the releasing of proto-owned singletons from the attribute
hashed table. Proto-owned singleton nexthops are hashed so they
can still be shared therefore they are present in this table
and need to be released when the time comes.

This check was only matching on zebra proto before. Changed
to match IDs in zebra allocated range.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: increment the nhg proto score iterator
Stephen Worley [Wed, 20 May 2020 22:04:53 +0000 (18:04 -0400)]
zebra: increment the nhg proto score iterator

Increment the nhg proto score iterator we used to count
leftover NHGs after client disconnect and log.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: fix refcnt/rib issues in NHG replace/delete
Stephen Worley [Wed, 20 May 2020 19:47:12 +0000 (15:47 -0400)]
zebra: fix refcnt/rib issues in NHG replace/delete

Fix some reference counting issues seen when replacing
a NHG and deleting one.

For replacement, we should end with the same refcnt on the new
one.

For delete, its the caller's job to decrement its ref after
its done with it.

Further, update routes in the rib with the new pointer after replace.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: warn if zapi NHG add has no nexthops
Stephen Worley [Wed, 20 May 2020 19:43:23 +0000 (15:43 -0400)]
zebra: warn if zapi NHG add has no nexthops

Log a warning and return if we receive a NHG add via zapi
that has no nexthops.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: handle proto NHG uninstall client disconnect
Stephen Worley [Wed, 20 May 2020 19:41:18 +0000 (15:41 -0400)]
zebra: handle proto NHG uninstall client disconnect

Add code to handle proto-based NHG uninstalling after
the owning client disconnects.

This is handled the same way as rib_score_proto() but for now
we are ignoring instance.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: inc/dec refcount on add/del NHG proto
Stephen Worley [Wed, 20 May 2020 15:26:44 +0000 (11:26 -0400)]
zebra: inc/dec refcount on add/del NHG proto

When we add a proto NHG, increment the refcount, when
we del a proto NHG, decrement the refcount rather than
deleting it explicitly. If the upper level proto is handling
it properly, it should get decremented to zero when we
receive a NHG del.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: remove unneeded nhg repalce boilerplate
Stephen Worley [Wed, 20 May 2020 15:23:36 +0000 (11:23 -0400)]
zebra: remove unneeded nhg repalce boilerplate

Remove some leftover boilerplate from the old replace
code path. That code ended up in the add API so its no
longer needed.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Prevent duplicate re-install
Donald Sharp [Sun, 17 May 2020 00:12:30 +0000 (20:12 -0400)]
zebra: Prevent duplicate re-install

If we have received a route that the already existing
route is exactly the same, just note that it happened
and move on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib,doc: add `onlink` flag to nexthop group config
Stephen Worley [Mon, 18 May 2020 18:38:19 +0000 (14:38 -0400)]
lib,doc: add `onlink` flag to nexthop group config

Add an `onlink` flag to nexthop group configuration.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: add onlink flag to zapi_nh conversion helper
Stephen Worley [Mon, 18 May 2020 18:22:06 +0000 (14:22 -0400)]
lib: add onlink flag to zapi_nh conversion helper

Add setting the onlink flag to the zapi_nh conversion
helper function so that we can set the onlink flag with
it when passing down NHGs from upper level protos.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: fix route validity check with NHG ID
Stephen Worley [Thu, 14 May 2020 21:24:46 +0000 (17:24 -0400)]
zebra: fix route validity check with NHG ID

Fix check in zread where we determine validity of a route
based on reading in nexthops/checking ID is present.

We had a bad conditional that was determining a route
is bad if its not NHG ID based.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: use the passed proto from zapi
Stephen Worley [Wed, 13 May 2020 21:55:14 +0000 (17:55 -0400)]
zebra: use the passed proto from zapi

We were hard coding proto bgp for use with the NHG creation.

Use the actual passed one from zapi now that it exists.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: make NHG ID allocation smarter
Stephen Worley [Wed, 13 May 2020 21:42:55 +0000 (17:42 -0400)]
zebra: make NHG ID allocation smarter

Make NHG ID allocation smarter so it wraps once it hits
the lower bound for protos and performs a lookup to make
sure we don't already have that ID in use.

Its pretty unlikely we would wrap since the ID space is somewhere
around 24million for Zebra at this point in time.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agosharpd: print the correct ID the NHG is using
Stephen Worley [Wed, 13 May 2020 18:35:25 +0000 (14:35 -0400)]
sharpd: print the correct ID the NHG is using

We were incrementing in the output the ID value when we
shouldnt be. The value the NHG is assigned is before its
incremented.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: NHG ID bounds macros
Stephen Worley [Wed, 13 May 2020 18:32:13 +0000 (14:32 -0400)]
zebra: NHG ID bounds macros

Determine the NHG ID spacing and lower bound with ZEBRA_ROUTE_MAX
in macros.

Directly set the upperbound to be the lower 28bits of the uint32_t ID
space (the top 4 are reserved for l2-NHGs). Round that number down
a bit to make it more even.

Convert all former lower_bound calls to just use the macro.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: dont update counter if outside of zebra ID range
Stephen Worley [Sun, 10 May 2020 21:34:35 +0000 (17:34 -0400)]
zebra: dont update counter if outside of zebra ID range

When we receive a NHG from the kernel, we set the ID counter
to that to avoid using IDs owned from the kernel.

If we get one outside of zebra's range, lets not update it
since its probably one we created and never deleted anyway.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: special handling for proto-NHG-based routes
Stephen Worley [Sun, 10 May 2020 21:34:27 +0000 (17:34 -0400)]
zebra: special handling for proto-NHG-based routes

For now let's assume proto-NHG-based routes are good to go
(we assume they are onlink/interface based anyway) and bypass
route resolution altogether.

Once we determine how to handle recursive nexthop-resolution for
proto-NHGs we will revisit this.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: handle zapi routes with NHG ID set
Stephen Worley [Sun, 10 May 2020 21:32:24 +0000 (17:32 -0400)]
zebra: handle zapi routes with NHG ID set

Add code to properly handle routes sent with NHG ID rather
than a nexthop_group.

For now, we separate this from backup nexthop handling since that
should probably be added to the nhg_proto_add calls.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: implement NHG proto replace
Stephen Worley [Sun, 10 May 2020 20:36:49 +0000 (16:36 -0400)]
zebra: implement NHG proto replace

Implement the ability to replace an NHG sent down
from an upper level proto. With proto-owned NHGs, we make the
assumption they are ecmp and always treat them as a group
to make the replace from 1 -> 2 and 2 -> 1 quite a bit
easier.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: hash proto-created but zebra ID spaced NHGS
Stephen Worley [Sun, 10 May 2020 20:34:36 +0000 (16:34 -0400)]
zebra: hash proto-created but zebra ID spaced NHGS

To prevent duplication of singleton NHGs, lets hash
any zebra-ID spaced NHGs sent from an upper level proto.

These would be singleton NHGs anyway and should prevent duplication
of dataplane installs.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra,lib: command to only install proto-based nexthops
Stephen Worley [Wed, 13 May 2020 19:50:14 +0000 (12:50 -0700)]
zebra,lib: command to only install proto-based nexthops

Add a command/functionality to only install proto-based nexthops.
That is nexthops owned/created by upper level protocols, not ones
implicitly created by zebra.

There are some scenarios where you would not want zebra to be
arbitrarily installing nexthop groups and but you still want
to use ones you have control over via lib/nexthop_group config
and an upper level protocol.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: implement protocol NHG Add/Del
Stephen Worley [Tue, 5 May 2020 19:57:35 +0000 (15:57 -0400)]
zebra: implement protocol NHG Add/Del

Implement the underlying zebra functionality to Add/Del an
internal zebra and kernel NHG.

These NHGs are managed by the upperlevel protocols that send them
down via zapi messaging.

They are not put into the overall zebra NHG hash table and only
put into to the ID table. Therefore, different protos cannot
and will not share NHGs.

The proto is also set appropriately when sent to the kernel.

Expand the separation of Zebra hashed/shared/created NHGs and
proto created and mangaged NHGs.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: remove NHG unhashable flag and its code
Stephen Worley [Thu, 30 Apr 2020 22:35:13 +0000 (18:35 -0400)]
zebra: remove NHG unhashable flag and its code

Remove the code for setting a NHG as unhashable. Originally
this was to prevent us from attempting to put duplicates from
the kernel in our hashtable.

Now I think its better to not use them in the hashtable at all
and only track them in the ID table. Routes will still be able
to use them if they specify the ID explicitly when sending Zebra
the route, but 'normal' routes we hash the nexthop group on
will not.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agosharpd: add abilty to send a nhg to zebra
Donald Sharp [Wed, 29 Apr 2020 16:32:53 +0000 (12:32 -0400)]
sharpd: add abilty to send a nhg to zebra

Modify the sharpd program to have the ability to pass down
a NHG and then operate on it for route installation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib, zebra: Add ability to send down a nhgid over route install
Donald Sharp [Fri, 1 May 2020 21:56:23 +0000 (17:56 -0400)]
lib, zebra: Add ability to send down a nhgid over route install

Modify the send down of a route to use the nexthop group id
if we have one associated with the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib, zebra: Add ZAPI_NHG_ADD|DELETE
Donald Sharp [Wed, 29 Apr 2020 14:49:21 +0000 (10:49 -0400)]
lib, zebra: Add ZAPI_NHG_ADD|DELETE

Add the ability to send a NHG from an upper level protocol down to
zebra.  ZAPI_NHG_ADD encompasses both the addition and replace
semantics ( If the id passed down does not exist yet, it's Add,
else it's a replace ).

Effectively zebra will take this nhg passed down save the nhg
in the id hash for nhg's and then create the appropriate nhg's
and finally install them into the linux kernel.  Notification
will be the ZAPI_NHG_NOTIFY_OWNER zapi message for normal
success/failure messaging to the installing protocol.

This work is being done to allow us to work with EVPN MH
which needs the ability to modify NHG's that BGP will own
and operate on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Refactor nexthop reading from zapi messages
Donald Sharp [Wed, 29 Apr 2020 14:11:34 +0000 (10:11 -0400)]
zebra: Refactor nexthop reading from zapi messages

Take the zebra code that reads nexthops and combine it
into one function so that when we add zapi messages
to send/receive nexthops we can take advantage of this function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Add the ability to grab a nhg starting id
Donald Sharp [Wed, 22 Apr 2020 13:41:01 +0000 (09:41 -0400)]
lib: Add the ability to grab a nhg starting id

Add new function zclient_get_nhg_start that will allow an
upper level protocol to get a starting point for it's own
nhg space.  Give each protocol a space of 50 million.
zebra will own the space from 0 - 199999999 because
of SYSTEM, KERNEL and CONNECT route types.

This is the start of some work that will allow upper
level protocols to install and maintain their own NHG's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Convert zserv_nexthop_num_warn to return bool
Donald Sharp [Thu, 9 Jan 2020 14:01:10 +0000 (09:01 -0500)]
zebra: Convert zserv_nexthop_num_warn to return bool

Allow us to key of the warning if we have one.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agovtysh: fix exit from keychain node 7193/head
Igor Ryzhov [Mon, 28 Sep 2020 14:17:05 +0000 (17:17 +0300)]
vtysh: fix exit from keychain node

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agovtysh: fix exit from babeld node
Igor Ryzhov [Mon, 28 Sep 2020 14:13:40 +0000 (17:13 +0300)]
vtysh: fix exit from babeld node

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #7178 from taspelund/bgp_timers
Donatas Abraitis [Mon, 28 Sep 2020 06:44:21 +0000 (09:44 +0300)]
Merge pull request #7178 from taspelund/bgp_timers

bgpd: Use bgp instance's default keepalive interval if < (holdtime/3)

4 years agoMerge pull request #7187 from idryzhov/fix-configure
Rafael Zalamena [Mon, 28 Sep 2020 01:07:42 +0000 (22:07 -0300)]
Merge pull request #7187 from idryzhov/fix-configure

build: remove redundant commas

4 years agobuild: remove redundant commas 7187/head
Igor Ryzhov [Sun, 27 Sep 2020 16:22:02 +0000 (19:22 +0300)]
build: remove redundant commas

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agotests: avoid python2 regex syntax 7177/head
Mark Stapp [Sat, 26 Sep 2020 17:11:39 +0000 (13:11 -0400)]
tests: avoid python2 regex syntax

Update a few regexs to avoid python2-specific syntax

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agotests: report uname info once per test
Mark Stapp [Sat, 26 Sep 2020 17:10:47 +0000 (13:10 -0400)]
tests: report uname info once per test

Report 'uname' info once per test, not once per
configured router in each test.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agotests: improve unicode handling
Mark Stapp [Fri, 25 Sep 2020 14:29:54 +0000 (10:29 -0400)]
tests: improve unicode handling

Support more of the string/unicode interactions in various
topotests.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agotests: python3 compat fixes for topotests: tabs and misc
Mark Stapp [Wed, 23 Sep 2020 21:08:36 +0000 (17:08 -0400)]
tests: python3 compat fixes for topotests: tabs and misc

Use only spaces in python files; no tabs; also a couple of small
api fixes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #7063 from idryzhov/yang-leafref
Renato Westphal [Sat, 26 Sep 2020 18:12:13 +0000 (15:12 -0300)]
Merge pull request #7063 from idryzhov/yang-leafref

yang: use leafref instead of string

4 years agoMerge pull request #7181 from volta-networks/fix_isis_timer_oflow
Renato Westphal [Sat, 26 Sep 2020 18:03:53 +0000 (15:03 -0300)]
Merge pull request #7181 from volta-networks/fix_isis_timer_oflow

isisd: minor fixes and improvements

4 years agoMerge pull request #7182 from donaldsharp/bgp_static_32s
Donatas Abraitis [Sat, 26 Sep 2020 17:07:49 +0000 (20:07 +0300)]
Merge pull request #7182 from donaldsharp/bgp_static_32s

bgpd: Allow bgp static routes to use /32's

4 years agoMerge pull request #7171 from dslicenc/bgp-rid-update
Donatas Abraitis [Sat, 26 Sep 2020 16:58:00 +0000 (19:58 +0300)]
Merge pull request #7171 from dslicenc/bgp-rid-update

bgpd: allow derived router-id update if previously 0x0

4 years agoMerge pull request #7183 from oerdnj/master
Ondřej Surý [Sat, 26 Sep 2020 12:59:10 +0000 (14:59 +0200)]
Merge pull request #7183 from oerdnj/master

Update the Debian packaging (sync with debian/master branch)

4 years agoLower the debhelper depends for Debian Jessie and Ubuntu Xenial 7183/head
Ondřej Surý [Sat, 26 Sep 2020 09:25:45 +0000 (11:25 +0200)]
Lower the debhelper depends for Debian Jessie and Ubuntu Xenial

Signed-off-by: Ondřej Surý <ondrej@sury.org>
4 years agoBump standards version
Ondřej Surý [Sat, 26 Sep 2020 07:29:43 +0000 (09:29 +0200)]
Bump standards version

Signed-off-by: Ondřej Surý <ondrej@sury.org>
4 years agoSync frr-doc.doc-base, d/frr.conf and d/frr.install with debian/master branch
Ondřej Surý [Sat, 26 Sep 2020 07:17:04 +0000 (09:17 +0200)]
Sync frr-doc.doc-base, d/frr.conf and d/frr.install with debian/master branch

4 years agoSync debian/watchfrr.rc with debian/master branch
Ondřej Surý [Sat, 26 Sep 2020 07:15:17 +0000 (09:15 +0200)]
Sync debian/watchfrr.rc with debian/master branch

4 years agoDepend on debhelper >= 10 and drop dh-systemd dependency (Closes: #958626)
Ondřej Surý [Mon, 10 Aug 2020 09:48:52 +0000 (11:48 +0200)]
Depend on debhelper >= 10 and drop dh-systemd dependency (Closes: #958626)

dh-systemd was merged into debhelper in version 9.20160709 [1] and since
stretch, dh-systemd is an empty transitional package.

For bullseye there's an intend to drop this empty transitional package.

This commit drops the "| dh-systemd" alternative Build-Depends as it is no
longer required (not even for backports) and is only confusing.

For Debian Jessie, it's easier to add backported debhelper >= 10 to the
repository.

4 years agoWork around the sphinx-build error that doesn't copy images to texinfo
Ondřej Surý [Thu, 6 Aug 2020 08:00:28 +0000 (10:00 +0200)]
Work around the sphinx-build error that doesn't copy images to texinfo

The sphinx-build (since version 2.0.0) doesn't install the images into the
texinfo build directory.  Workaround the issue, by copying the required
images from the source directory.

4 years agoUse wrap-and-sort -a to unify debian/ wrapping and sorting
Ondřej Surý [Thu, 6 Aug 2020 07:28:29 +0000 (09:28 +0200)]
Use wrap-and-sort -a to unify debian/ wrapping and sorting

While it's ok to use individual wrapping/sorting in the debian/ source files,
it's often simpler to just go with the formatting supported by tools.  One such
tool is wrap-and-sort, so this commit re-wraps and re-sorts the debian/ files to
be unified and (-a) always wrapped.