Commit Graph

26761 Commits

Author SHA1 Message Date
Sri Mohana Singamsetty
ffab914521
Merge pull request #9378 from AnuradhaKaruppiah/evpn-mh-cleanup
evpn-mh: fixes for sync-MAC-IP handling on ES bond del/add
2021-10-22 09:26:06 -07:00
Donald Sharp
9482d96e3f tests: all_protocol_startup needs some tweaks to allow for processing
The nexthop group code is installing routes and nexthop groups
and immediately expecting zebra to have processed the results
as a result there is a situation when the CI system is under
intense load that the nexthop group might not have been processed.

Add a bit of code to allow the test to give FRR some time
to finish work before declaring it not working.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-22 11:28:31 -04:00
Mark Stapp
6418ebdc31
Merge pull request #9860 from pguibert6WIND/nhrp_align_privs
nhrpd: align nhrp privs with definition from others
2021-10-22 10:19:34 -04:00
Mark Stapp
036b746570
Merge pull request #9765 from idryzhov/lib-bool-thread-add
lib: change thread_add_* API
2021-10-22 09:59:54 -04:00
Donald Sharp
6d2edff594
Merge pull request #9866 from ewlumpkin/comment_spelling_fixes
lib: finish fixing spelling in lib files
2021-10-22 09:38:44 -04:00
David Lamparter
f68ce97627 zebra: set SELECTED before going into dplane code
There is a bit of an impedance mismatch in the sequence of events here.
Depending on the dplane behavior, the `ROUTE_ENTRY_SELECTED` bit will be
inconsistent for rib_process_result().

With an asynchronous dataplane:
0. rib_process() is called
1. rib_install_kernel() is called, dplane action is queued
2. rib_install_kernel() returns
3. rib_process() sets the SELECTED bit appropriately, returns
4. dplane is done, triggers rib_process_result()
5. SELECTED bit is seen in "after" state
(5a. NHT code looks at the SELECTED bit, works correctly.)

With a synchronous dataplane:
0. rib_process() is called
1. rib_install_kernel() is called, dplane action is executed
2. dplane (should) trigger rib_process_result()
3. SELECTED bit is seen in "before" state
(3a. NHT code looks at the SELECTED bit, fails.)
4. rib_install_kernel() returns
5. rib_process() sets the SELECTED bit appropriately, too late.

Essentially, poking the dataplane is a sequencing point where control is
handed over to the dplane.  Control may or may not return immediately.
Doing /anything/ after triggering the dataplane is a recipe for odd race
conditions.

(FWIW, I'm not sure rib_process_result() is called correctly in the
synchronous case, but that's a separate problem.)

Unfortunately, this change might have some unforeseen side effects.  I
haven't dug through the code to see if anything breaks.  There
/shouldn't/ be anything looking at the SELECTED bit here, but who knows.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-22 12:13:46 +02:00
ewlumpkin
03bad95aa4 lib: finish fixing spelling in lib files
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2021-10-22 03:06:16 +00:00
Philippe Guibert
db52be551b nhrpd: align nhrp privs with definition from others
nhrp_privs global context is aligned with other daemon contexts

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-10-21 13:49:38 +02:00
Donald Sharp
3c8161eaa8
Merge pull request #9843 from opensourcerouting/vtysh-startup-cost
vtysh: improve startup time by ca. ×6
2021-10-20 18:52:00 -04:00
Russ White
61a7ec774c
Merge pull request #9783 from mjstapp/fix_bgp_lu_lsp
bgpd, tests: BGP-labeled-unicast advertise implicit-null in more cases
2021-10-20 18:22:01 -04:00
Igor Ryzhov
e57c66d5e9 tests: relax requirements for test_static_timing
When the CI system is heavily loaded, we might see the following failures:

```
test failed at "test_config_timing/test_static_timing": assert 20.083204 <= 19.487716
```

Currently we allow each step to run 2 times slower than the initial
measurement. Let's allow them to run 3 times slower.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-21 01:04:44 +03:00
Igor Ryzhov
925d7f925b tests: fix test_static_timing route removal
On the first step, the test creates 10000 static routes. It passes 10000
to `get_ip_networks` and it generates 10000 /22 routes.

On the fourth step, the test tries to remove 5000 previously created
routes. It passes 5000 to `get_ip_networks` and here starts the problem.
Instead of generating 5000 /22 routes, it generates 5000 /21 routes. And
the whole step is a no-op, we constantly see the following logs:
```
% Refusing to remove a non-existent route
```

To consistently generate same routes, `get_ip_networks` must always use
the same prefix length.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-21 01:04:44 +03:00
Igor Ryzhov
6db215219e
Merge pull request #9856 from donaldsharp/always_true
zebra: Fix code paths that always resolve to true
2021-10-20 23:16:58 +03:00
David Lamparter
5a001ddd24
Merge pull request #9855 from donaldsharp/ospf_fini 2021-10-20 19:19:43 +02:00
Igor Ryzhov
ee1455dd98 lib: change thread_add_* API
Do not return pointer to the newly created thread from various thread_add
functions. This should prevent developers from storing a thread pointer
into some variable without letting the lib know that the pointer is
stored. When the lib doesn't know that the pointer is stored, it doesn't
prevent rescheduling and it can lead to hard to find bugs. If someone
wants to store the pointer, they should pass a double pointer as the last
argument.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-20 20:07:15 +03:00
Igor Ryzhov
5db95752c0
Merge pull request #9811 from donaldsharp/rib_update_fix
Various thread functional fixes
2021-10-20 19:44:45 +03:00
Igor Ryzhov
16e2b641fa
Merge pull request #9847 from ton31337/feature/prefix-list_autocomplete
bgpd: Add autocomplete for set/match community/large/ext lists
2021-10-20 18:45:07 +03:00
Donald Sharp
e8e6febb74 zebra: Fix code paths that always resolve to true
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 10:37:32 -04:00
Donald Sharp
48dbe48a99 doc: Add documentation about use_oif_addrs_only
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 09:37:44 -04:00
Donald Sharp
e13f12a7d1 zebra: modify rib_update to be a bit smarter about malloc
rib_update() was mallocing memory then attempting to schedule
and if the schedule failed( it was already going to be run )
FRR would then free the memory.  Fix this memory usage pattern

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 08:28:52 -04:00
Donald Sharp
a505383d6a lib: Add a thread_is_scheduled function
The function thread_is_scheduled allows us to know if
the particular thread is scheduled for execution or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 08:28:52 -04:00
Mark Stapp
52e458d922
Merge pull request #9766 from opensourcerouting/typesafe-member-nhrp-zap
lib: add typesafe membership-test functions
2021-10-20 08:13:17 -04:00
Donald Sharp
e9a59a2a59 tests: When heavily loaded do not send SIGBUS so fast
Our topotests send SIGBUS 2 seconds after a SIGTERM is
initiated.  This is bad because under a heavily loaded
topotest system we may have a case where the system has
not had a chance to properly shut down the daemon.
Extend the time greatly before topotests send SIGBUS.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 08:02:10 -04:00
Donald Sharp
6865ffa758 pathd: Call frr_fini() before exit
pathd was never calling frr_fini and as such the
proper shutdown was not happening for libfrr.
This includes logging.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 08:00:57 -04:00
Donald Sharp
e15a935c06 ospfd: Close log files before exiting
When doing a normal exit from ospf we should close
the log file as that we are leaving a bunch of
unterminated logging processes by not doing so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 08:00:02 -04:00
Donatas Abraitis
a2099c1d64 bgpd: Add autocomplete for community/large/extcommunity stuff
```
exit1-debian-9(config)# route-map test1 permit 10
exit1-debian-9(config-route-map)# match community ?
  (1-99)               Community-list number (standard)
  (100-500)            Community-list number (expanded)
  COMMUNITY_LIST_NAME  Community-list name
     testas
exit1-debian-9(config-route-map)# match large-community ?
  (1-99)                Large Community-list number (standard)
  (100-500)             Large Community-list number (expanded)
  LCOMMUNITY_LIST_NAME  Large Community-list name
     LCL-ORIGINATED-ALL
exit1-debian-9(config-route-map)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-20 14:41:24 +03:00
David Lamparter
a243d1db93 *: convert zclient callbacks to table
This removes a giant `switch { }` block from lib/zclient.c and
harmonizes all zclient callback function types to be the same (some had
a subset of the args, some had a void return, now they all have
ZAPI_CALLBACK_ARGS and int return.)

Apart from getting rid of the giant switch, this is a minor security
benefit since the function pointers are now in a `const` array, so they
can't be overwritten by e.g. heap overflows for code execution anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-20 13:28:46 +02:00
Abhishek Naik
800867d85e bgpd: Reset dynamic peer counter
Dynamic peer count is inconsistent in
"show bgp summary json" and "show bgp summary failed json" due to
dynamic peer counter 'dn_count' being reused without resetting

Signed-off-by: Abhishek Naik <bhini@amazon.com>
2021-10-19 23:50:42 +00:00
Russ White
bf4af4ffb5
Merge pull request #9848 from ton31337/feature/as-path_autocomplete
bgpd: Add autocomplete for as-path filters
2021-10-19 19:18:28 -04:00
Russ White
656b3fdceb
Merge pull request #9839 from donaldsharp/test_ospf_summarization
Test ospf summarization
2021-10-19 19:17:35 -04:00
Russ White
4dfa838afa
Merge pull request #9656 from chiragshah6/mdev
zebra: add resolver flag for nexthop in json
2021-10-19 19:16:14 -04:00
Russ White
ed131d8b74
Merge pull request #9752 from opensourcerouting/ospf6d-nssa-ranges
ospf6d: add support for NSSA Type-7 address ranges
2021-10-19 19:15:40 -04:00
Mark Stapp
32c8a3c2ae
Merge pull request #9818 from idryzhov/lib-if-fixes
lib: allow to create interfaces in non-existing VRFs
2021-10-19 16:46:58 -04:00
Donald Lee
30085ba550 doc: Add doc for zebra hook calls
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
310dd2b362 zebra: Add vty cmd zebra on-rib-process script SCRIPT
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
461c173cbd zebra: Add script initialization and destroy
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
1247efcce4 zebra: Add dplane hook point
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
4f7e32bafe zebra: Add encoders/decoders for zebra
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
a3ef7ae835 lib: Add frrscript names hash
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
263951c1be lib: Register encoders/decoders for dplane hook
These are for encoding the dplane ctx object. The decoders are noops.

Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
9b851b74b0 lib: Add encoder/decoder for nexthop/nexthop group
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donald Lee
e6f42b94c6 lib: Add encoders/decoders for ipaddr/ethaddr
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Donatas Abraitis
de71d43e04 bgpd: Add autocomplete for filter-list
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-19 18:03:54 +03:00
David Lamparter
7c1803d0a0 tools: remove Linux kernel bits from checkpatch
These aren't appropriate for use in FRR.  Among other things, this
enables running checkpatch by calling it in a git working tree with
`tools/checkpatch.pl -g origin/master..`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
4d619e25ab tools: add iterators to checkpatch
For the purpose of allowing the space in `frr_each (`, copy the list of
iterators from .clang-format and wire it up appropriately.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
a1103bd352 build: add tests missed in .gitignore
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
6a59615859 nhrpd: drop list.h
`number_of_linked_lists_in_frr--;`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
f9aa07b1a8 nhrpd: convert zbuf queue to DLIST
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
b4f3d41bfd nhrpd: convert SA list to DLIST
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
811de44f34 nhrpd: convert reg list to DLIST
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00