Commit Graph

27618 Commits

Author SHA1 Message Date
Donald Sharp
4e2839de64 lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backwards
On FreeBSD I have noticed that subsuquent calls to clock_gettime(..)
can return an after time that is before first calls value.
This in turn is generating CPU_HOG's because the subtraction
is wrapping into very very large numbers:

2022/02/28 20:12:58 SHARP: [PTDQA-70FG5]     start: 35.741981000  now: 35.740581000
2022/02/28 20:12:58 SHARP: [XK9YH-ZD8FA][EC 100663313] CPU HOG: task zclient_read (800744240) ran for 0ms (cpu time 18446744073709550ms)

(Please note I added the first line of debug to figure this issue out).

I have been asked to open a FreeBSD bug report and have done so.
In the mean time I think that it is important that FRR does
not generate bogus CPU HOG's on FreeBSD ( especially since
this may or may not be easily fixed and FRR has no control
over what version of the operating system, operators are
going to be running with FRR.

So, add a bit of specialized code that checks to see if
the after time in FreeBSD is before the now time in
thread_consumed_time and do some quick manipulations
to not have this issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-01 09:08:32 -05:00
David Lamparter
2821405a69
Merge pull request #10640 from donaldsharp/thread_timers 2022-03-01 11:45:36 +01:00
David Lamparter
17dd5ca8f8
Merge pull request #10584 from donaldsharp/workflow_modification 2022-03-01 11:44:57 +01:00
David Lamparter
145ce1825c
Merge pull request #10634 from patrasar/master_pimv6_last_lookup 2022-03-01 09:39:52 +01:00
sarita patra
3e394a7729 pim6d: Handling pim_rpf for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-01 06:30:03 -08:00
Donatas Abraitis
4e6e0ac2bf
Merge pull request #10691 from anlancs/bgp-evpn-check
bgpd: fix missing name of default vrf
2022-03-01 10:13:15 +02:00
sarita patra
113f29b90d pim6d: Handling last_lookup in pim_nexthop for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 18:03:12 -08:00
sarita patra
d4addb4839 pim6d: moving FRR_PIM_AF_XPATH_VAL into pim_nb.h
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 15:57:47 -08:00
Martin Winter
720f01c5c1
snapcraft: Add missing libelf-dev build package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2022-03-01 00:41:29 +01:00
Jafar Al-Gharaibeh
868efb9e9f
Merge pull request #10672 from donaldsharp/bsd_zebra_graceful_restart_cleanup
Bsd zebra graceful restart cleanup
2022-02-28 14:57:35 -06:00
Jafar Al-Gharaibeh
0acdda46c4
Merge pull request #10683 from donaldsharp/correct_vrf
zebra: Use the routes vrf not the nexthop vrf for route-map application
2022-02-28 14:47:16 -06:00
Sri Mohana Singamsetty
32c7d45175
Merge pull request #10682 from mjstapp/fix_zebra_doc
doc: fix typo in zebra doc
2022-02-28 10:54:31 -08:00
Mobashshera Rasool
17280eee1f pimd: Handle pim join/prune recv flow for ipv6
Making the code changes to handle both ipv4 and ipv6 in the same code

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 10:36:04 -08:00
Donald Sharp
45dafca86c zebra: Use the routes vrf not the vrf of the nexthop for route-map application
When a end operator is doing cross vrf imports in bgp:

router bgp 3239 vrf FOO
  address-family ipv4 uni
    import vrf BAR
!

and zebra has this configuration:

vrf FOO
  ip protocol bgp route-map EVA
!

The current code in zebra_nhg.c was looking up the vrf of the
nexthop and attempting to apply the ip protocol route-map.

For most people the nexthop vrf and the re vrf are one and the
same so they never see a problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 13:08:01 -05:00
David Lamparter
ee95029ac4
Merge pull request #10424 from patrasar/master_pimv6_nht 2022-02-28 17:50:42 +01:00
sarita patra
90ab4458a1 pim6d: pim_nht changes for pimv6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 13:36:02 -08:00
Mark Stapp
2f5997dc56 doc: fix typo in zebra doc
Fix a typo in the zebra doc file that triggers a warning.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-02-28 11:28:25 -05:00
Jafar Al-Gharaibeh
5ff968abbe
Merge pull request #10678 from donaldsharp/staticd_make_check_fix
staticd: Fix `make check` failures
2022-02-28 09:40:12 -06:00
Donald Sharp
4e7a5f06be
Merge pull request #10668 from Jafaral/frr-conf-topotest
topotests: add support for frr.conf as a unified config
2022-02-28 10:28:10 -05:00
David Lamparter
b9db469fe9
Merge pull request #10667 from donaldsharp/bufsize 2022-02-28 15:56:51 +01:00
Russ White
801d1f9ccf
Merge pull request #10627 from ton31337/fix/enforce_using_documentation_prefixes
doc: Enforce using IPv4/IPv6 reserved ranges for documentation
2022-02-28 09:54:09 -05:00
Russ White
d2dfd26697
Merge pull request #10636 from ton31337/fix/use_get_set_for_communities
bgpd: Reuse get/set helpers for attr->community
2022-02-28 09:52:50 -05:00
Donald Sharp
fd149fe625 doc: Update documentation to indicate *BSD struggles
*BSD has some special struggles associated with the graceful
restart code in zebra.  Add a bit of documentation to outline
this problem and how it is solved.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 09:50:35 -05:00
Donald Sharp
73d3197c73 zebra: Get zebra graceful restart working when restarting on *BSD
Upon restart zebra reads in the kernel state.  Under linux
there is a mechanism to read the route and convert the protocol
to the correct internal FRR protocol to allow the zebra graceful
restart efforts to work properly.

Under *BSD I do not see a mechanism to convey the original FRR
protocol into the kernel and thus back out of it.  Thus when
zebra crashes ( or restarts ) the routes read back in are kernel
routes and are effectively lost to the system and FRR cannot
remove them properly.  Why?  Because FRR see's kernel routes
as routes that it should not own and in general the admin
distance for those routes will be a better one than the
admin distance from a routing protocol.  This is even
worse because when the graceful restart timer pops and rib_sweep
is run, FRR becomes out of sync with the state of the kernel forwarding
on *BSD.

On restart, notice that the route is a self route that there
is no way to know it's originating protocol.  In this case
let's set the protocol to ZEBRA_ROUTE_STATIC and set the admin
distance to 255.

This way when an upper level protocol reinstalls it's route
the general zebra graceful restart code still works.  The
high admin distance allows the code to just work in a way
that is graceful( HA! )

The drawback here is that the route shows up as a static
route for the time the system is doing it's work.  FRR
could introduce *another* route type but this seems like
a bad idea and the STATIC route type is loosely analagous
to the type of route it has become.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 09:50:35 -05:00
Donald Sharp
16d91fce15 zebra: Prevent crash if ZEBRA_ROUTE_ALL is used for a route type
FRR will crash when the re->type is a ZEBRA_ROUTE_ALL and it
is inserted into the meta-queue.  Let's just put some basic
code in place to prevent a crash from happening.  No routing
protocol should be using ZEBRA_ROUTE_ALL as a value but
bugs do happen.  Let's just accept the weird route type
gracefully and move on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 09:50:35 -05:00
Russ White
e3aa338256
Merge pull request #10566 from whichbug/master
isisd: use base64 to encode the binary data.
2022-02-28 09:44:47 -05:00
Donald Sharp
5506048083
Merge pull request #10353 from opensourcerouting/vtysh-live-log
lib & vtysh: RFC5424 syslog + vtysh live log display
2022-02-28 09:43:29 -05:00
Donald Sharp
47ed380ba4
Merge pull request #9674 from leonshaw/fix/staticd-nht-reg
staticd: Don't register existing nexthop to zebra
2022-02-28 09:05:44 -05:00
Donald Sharp
7c1e76aa8d staticd: Fix make check failures
Recent commit:
abc246e193

Has broken `make check` with recently new compilers:

/usr/bin/ld: staticd/libstatic.a(static_nb_config.o): warning: relocation against `zebra_ecmp_count' in read-only section `.text'
  CCLD     tests/bgpd/test_peer_attr
  CCLD     tests/bgpd/test_packet
/usr/bin/ld: staticd/libstatic.a(static_zebra.o): in function `static_zebra_capabilities':
/home/sharpd/frr5/staticd/static_zebra.c:208: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: staticd/libstatic.a(static_zebra.o): in function `static_zebra_route_add':
/home/sharpd/frr5/staticd/static_zebra.c:418: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: staticd/libstatic.a(static_nb_config.o): in function `static_nexthop_create':
/home/sharpd/frr5/staticd/static_nb_config.c:174: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: /home/sharpd/frr5/staticd/static_nb_config.c:175: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:8679: tests/lib/test_grpc] Error 1
make: *** Waiting for unfinished jobs....

Essentially the newly introduced variable zebra_ecmp_count is not available in the
libstatic.a compiled and make check has code that compiles against it.

The fix is to just move the variable to the library.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 08:18:55 -05:00
David Lamparter
1917b9e480
Merge pull request #10639 from patrasar/master_pimv6_upstream 2022-02-28 14:10:44 +01:00
sarita patra
fd3af22930 pim6d: Handling IPV6 in pim_upstream
Signed-off-by: sarita patra <saritap@vmware.com>
2022-02-28 11:10:00 -08:00
David Lamparter
bec667a6bc vtysh: show live log messages
https://www.youtube.com/watch?v=8psFQCEgA18

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:33:27 +01:00
Donald Sharp
6da9f59f4f
Merge pull request #10664 from opensourcerouting/checksum-iov
lib: make checksum code take iovec for input
2022-02-28 07:28:49 -05:00
David Lamparter
4c92dd90d3 vtysh: use poll/callback-driven readline interface
Create a thread_master and funnel readline terminal I/O through it.
This allows processing other input in parallel, e.g. log messages.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:43 +01:00
David Lamparter
12d25fa69a vtysh: receive file descriptors from daemons
The other half of yielding back a file descriptor from a daemon to
vtysh.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:43 +01:00
David Lamparter
e960eedd98 python: improve clippy/clidef macro processing
Process macros from the current file, and warn if something is
redefined (to a different value).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:43 +01:00
David Lamparter
0798d2760d lib: implement terminal monitor for vtysh
Adds a new logging target that sends log messages to vtysh.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:43 +01:00
David Lamparter
b2dde56b2c lib: allow returning a file descriptor over vtysh
This adds the plumbing necessary to yield back a file descriptor to
vtysh.  The fd is passed on the command status code bytes through
AF_UNIX SCM_RIGHTS.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:28:40 +01:00
David Lamparter
df45017f48 lib: add accessor for raw timestamp in zlog
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-28 13:25:47 +01:00
David Lamparter
ce2e1a7418
Merge pull request #10387 from mobash-rasool/pim-cli-top 2022-02-28 13:22:06 +01:00
Donald Sharp
fbc83b9a10 zebra: Limit speed lookup to at most 4 minutes
There exists some interface types that are slow on startup
to fully register their link speed.  Especially those that
are working with an asic backend.  The speed_update timer
associated with each interface would keep trying if the
system returned a MAX_UINT32 as the speed.  This speed
means both unknown or there is none under linux.

Since some interface types are slow on startup let's modify
FRR to try for at most 4 minutes and give up trying on those
interfaces where we never get any useful data.

Why 4 minutes?  I wanted to balance the time associated with
slow interfaces coming up with those that will never give us
a value.  So I choose 4 minutes as a good ballpark of time
to keep trying

Why not track all those interfaces and just not attempt to
do the speed lookup?  I would prefer to not keep track of these
as that I do not know all the interface types, nor do I wish
to keep programming as new ones come in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 06:39:07 -05:00
Donald Sharp
115335d3e3 tools: Add show thread timers to support bundle generation
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 06:39:07 -05:00
Donald Sharp
a698ba1639 doc: Add show thread timers doc commands
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 06:39:07 -05:00
Donald Sharp
22f31b8c52 lib, vtysh: Add show thread timers command
Add the ability to inspect the timers and when they will pop
per daemon:

sharpd@eva ~/frr (thread_return_null)> vtysh -c "show thread timers"
Thread timers for zebra:

Showing timers for default
--------------------------
  rtadv_timer                                       00:00:00.520
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.746
  if_zebra_speed_update                             00:00:02.744
  if_zebra_speed_update                             00:00:02.745

Showing timers for Zebra dplane thread
--------------------------------------

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-28 06:39:07 -05:00
Xiao Liang
f1d6b7e36e staticd: Don't register existing nexthop to zebra
Zebra sends a nexthop-update message on registeration, which will cause
existing routes to be reconfigured even no changes actually happened.
Don't register the nexthop again if it's already done.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2022-02-28 18:08:49 +08:00
Mobashshera Rasool
18ca7de516 pim6d: Add ipv6 pim register-suppress-time CLI
Adding below CLI for pim6d
[no] ipv6 pim register-suppress-time (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
2322b99150 pim6d: Adding ipv6 pim rp keep-alive-timer
Adding below CLI for pim6d daemon
[no] ipv6 pim rp keep-alive-timer [(1-65535)]

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
28e32366e3 pim6d: Adding ipv6 pim keep-alive-timer
Adding the below CLI for pim6d daemon:
ipv6 pim keep-alive-timer (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
0da72f1f59 pim6d: Adding ipv6 pim packet CLI
Adding below CLI for pim6d daemon:
[no] ipv6 pim packet (1-255)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00
Mobashshera Rasool
fb991ce9d4 pim6d: Adding ipv6 pim spt-switchover CLI
Adding the below CLIs for ipv6:
[no] ipv6 pim spt-switchover infinity-and-beyond
[no] ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-02-28 01:38:41 -08:00