Commit Graph

5931 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
7aeb51e194
Merge pull request #16406 from opensourcerouting/fix/remove_deprecation_for_show_threads
Drop deprecation for `show thread ...`
2024-07-19 13:19:17 -04:00
Donatas Abraitis
193e14e401 lib: Rename clear thread cpu ... to clear event cpu ...
Add a deprecation cycle also.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-17 02:17:59 +03:00
Donatas Abraitis
f46ce043fc lib, vtysh: Removed deprecated aliases for show thread ...
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-17 02:12:48 +03:00
Nathan Bahr
fd8edc3dfb pimd, lib, vtysh: Added new 'router pim[6] [vrf NAME]' config node
Moved all existing global/vrf PIM config to the new subnode.
Existing configuration updated to be hidden and deprecated.
Both versions of configuration still work together.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-07-16 13:30:35 -05:00
David Lamparter
6ade526f7b lib: add some quick explainers for path vars
It's not immediately obvious what exactly the `frr_*dir` variables
exported from lib/libfrr.c are for.  Add a little text each to clarify.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-07-11 05:44:24 +02:00
David Lamparter
ebf05b4ee1
Merge pull request #16140 from donaldsharp/linklist_discouragement 2024-07-10 09:08:21 +02:00
Russ White
22db85a714
Merge pull request #16258 from opensourcerouting/tsan-20240620
lib, tests: fix some b0rked tests, then fix TSAN warnings
2024-07-09 11:36:24 -04:00
Acee Lindem
ed48014884 ospfd: Fix several problems with direct acknowledgments and improved delay acks.
1. On P2MP interfaces, direct ack would include the same LSA multiple times
      multiple packets are processed before the OSPF interfae direct LSA
      acknowledgment event is processed. Now duplicates LSA in the same event
      are suppressed.
   2. On non-broadcast interfaces, direct acks for multiple neighbors would be
      unicast to the same neighbor due to the multiple OSPF LS Update packets
      being process prior to the OSPF interface direct ack event. Now, separate
      direct acks are unicast to the neighbors requiring them.
   3. The interface delayed acknowledgment timer runs would run continously
      (every second as long as the interace is up). Now, the timer is set
      when delayed acknowledgments are queued and all queued delayed
      acknowledges are sent when it fires.
   4. For non-broadcast interface delayed acknowledgments, the logic to send
      to multiple neighbors wasn't working because the list was emptied while
      building the packet for the first neighbor.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-07-06 13:42:40 +00:00
vivek
b5682ffbf0 *: Add and use option for graceful (re)start
Add a new start option "-K" to libfrr to denote a graceful start,
and use it in zebra and bgpd.

zebra will use this option to denote a planned FRR graceful restart
(supporting only bgpd currently) to wait for a route sync completion
from bgpd before cleaning up old stale routes from the FIB. An optional
timer provides an upper-bounds for this cleanup.

bgpd will use this option to denote either a planned FRR graceful
restart or a bgpd-only graceful restart, and this will drive the BGP
GR restarting router procedures.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-07-01 13:02:52 -07:00
Acee Lindem
c494702929 ospfd: Improve OSPF neighbor retransmission list granularity and precision
The current OSPF neighbor retransmission operates on a single per-neighbor
periodic timer that sends all LSAs on the list when it expires.
Additionally, since it skips the first retransmission of received LSAs so
that at least the retransmission interval (resulting in a delay of between
the retransmission interval and twice the interval. In environments where
the links are lossy on P2MP networks with "delay-reflood" configured (which
relies on neighbor retransmission in partial meshs), the implementation
is sub-optimal (to say the least).

This commit reimplements OSPF neighbor retransmission as follows:

   1. A new data structure making use the application managed
      typesafe.h doubly linked list implements an OSPF LSA
      list where each node includes a timestamp.
   2. The existing neighbor LS retransmission LSDB data structure
      is augmented with a pointer to the list node on the LSA
      list to faciliate O(1) removal when the LSA is acknowledged.
   3. The neighbor LS retransmission timer is set to the expiration
      timer of the LSA at the top of the list.
   4. When the timer expires, LSAs are retransmitted that within
      the window of the current time and a small delta (50 milli-secs
      default). The LSAs that are retransmited are given an updated
      retransmission time and moved to the end of the LSA list.
   5. Configuration is added to set the "retransmission-window" to a
      value other than 50 milliseconds.
   6. Neighbor and interface LSA retransmission counters are added
      to provide insight into the lossiness of the links. However,
      these will increment quickly on non-fully meshed P2MP networks
      with "delay-reflood" configured.
   7. Added a topotest to exercise the implementation on a non-fully
      meshed P2MP network with "delay-reflood" configured. The
      alternative was to use existing mechanisms to instroduce loss
      but these seem less determistic in a topotest.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-06-20 15:31:07 +00:00
David Lamparter
b9541fe77f lib: use seqlock slow path with TSAN
TSAN doesn't understand the OS specific "fast" seqlock code.  Use the
pthread mutex/condvar based path when TSAN is enabled.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:16:10 +02:00
David Lamparter
1f67dfb143 lib: fix typo in rcu_do()
I lost an underscore somewhere along the way.  Which never caused issues
because we don't use that function macro.  It is, however, useful for
testing, so fix it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:04:09 +02:00
Donald Sharp
69b36cdf07 lib: Discourage usage of deprecated data structures
Put some verbiage in place to warn people that we
are actively discouraging new development that uses
an older data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-06-19 07:49:53 -04:00
Donald Sharp
c7276d1580
Merge pull request #16237 from pguibert6WIND/json_ttable_caml_format
lib: add json API to dump and override row naming convention
2024-06-18 15:26:00 -04:00
Russ White
7834c38ab3
Merge pull request #15604 from cscarpitta/srv6-sid-manager
Add support for SRv6 SID Manager
2024-06-18 12:16:24 -04:00
Russ White
ae4e030813
Merge pull request #16236 from opensourcerouting/fix/recursive_weighted_ecmp
zebra: Set the weight for non-recursive next-hop
2024-06-18 11:14:00 -04:00
Russ White
e9e8a4baa4
Merge pull request #16194 from opensourcerouting/fix/bfd_profile_shutdown
bgpd: Do not start BGP session if BFD profile is in shutdown state
2024-06-18 09:57:00 -04:00
Philippe Guibert
073fec520c lib: add json API to dump and override row naming convention
The following table is not compliant with caml format when displayed in
json:

>                 ttable_add_row(
>                         tt,
>                         "Vertex|Type|Metric|Next-Hop|Interface|Parent");
>
>                 ttable_json(tt, "ssdsss");

output observed:

> [..]
>        {
>          "Vertex":"r1",
>          "Type":"",
>          "Metric":0,
>          "Next-Hop":"",
>          "Interface":"",
>          "Parent":""
>        }

output expected:

> [..]
>        {
>          "vertex":"r1",
>          "type":"",
>          "metric":0,
>          "nextHop":"",
>          "interface":"",
>          "parent":""
>        }

Override the ttable_json() function with a new function which has an
extra paramter: this parameter will redefine the initial row value for
json:

> ttable_json_with_json_text(tt,
> "vertex|type|metric|nextHop|interface|parent");

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-18 14:33:41 +02:00
Donatas Abraitis
83b4706f30 lib: Get the weight from Zebra
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-18 12:15:33 +03:00
Philippe Guibert
36a310cc9f zebra, lib: add locator name in sid notify messages
In the near future, some daemons may only register SIDs. This may be
the case for the pathd daemon when creating SRv6 binding SIDs.

When a locator is getting deleted at ZEBRA level, the daemon may have
an easy way to find out the SIds to unregister to.

This commit proposes to add the locator name to the SID_SRV6_NOTIFY
message whenever possible. Only case when an allocation failure happens,
the locator will not be present. In all other places, the notify API
at procol levels has the locator name extra-parameter.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-17 17:09:45 +02:00
Carmine Scarpitta
4dcb69e0f9 zebra: Fix checkpatch warning
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
b90cb00974 lib: Add ZAPI command ZEBRA_SRV6_SID_NOTIFY
Add a new ZAPI command `ZEBRA_SRV6_SID_NOTIFY` used by zebra to send
asynchronous SRv6 SIDs notifications to zclients.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
164117f2ec lib: Add missing info to locator encode/decode
Include block/node/function/argument lengthi when
encoding/decoding an SRv6 locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
ee1d20879b lib: Add ZAPI operations to get/release SRv6 SIDs
Add two new ZAPI operations: `ZEBRA_SRV6_MANAGER_GET_SRV6_SID` and
`ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID`. These APIs allow a daemon to get and
release an SRv6 SID, respectively.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
ded79d7013 lib: Add ZAPI operation get SRv6 locator
Add a new ZAPI operation, ZEBRA_SRV6_MANAGER_GET_LOCATOR, which allows a
daemon to request information about a specific locator from the SRv6 SID
Manager.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
3cb88e6984 lib: Add support for SRv6 SIDs
Add a data structure to represent an SRv6 SID context and the related
management functions (allocate/free).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
779d4c2702 zebra: CLI to specify format of an SRv6 locator
Add the CLI to choose the SID format of a locator. When the SID format
of a locator is changed, the SIDs allocated from that locator might no
longer be valid (for example, because the new format might involve a
different SID allocation schema). In such a case, it is necessary to
notify all the zclients so that they can withdraw/uninstall the old SIDs
that use the previous format and allocate/install/advertise the new SIDs
based on the new format.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
f00554ed56 lib: Add function to copy an SRv6 locator
Add a new function to copy an SRv6 locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
35f4bedfa3 lib: Add CLI nodes to support SRv6 SID format
Add CLI commands to support overriding default configuration of the SID
format.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
021386a34e lib: Add support for SRv6 SID formats
Add functionalities to manage SRv6 SID formats (allocate / free).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Jafar Al-Gharaibeh
2e02bd2366
Merge pull request #16184 from LabNConsulting/chopps/fe-notify-select
mgmtd: add notification selection to front-end API
2024-06-13 00:20:09 -05:00
Donatas Abraitis
8dac2215ed
Merge pull request #16191 from pguibert6WIND/srte_color_not_copied
lib: fix copy srte_color from zapi_nexthop structure
2024-06-12 15:39:10 +03:00
Donatas Abraitis
1fb48f5d13 bgpd: Do not start BGP session if BFD profile is in shutdown state
If we do:

```
bfd
 profile foo
  shutdown
```

The session is dropped, but immediately established again because we don't
have a proper check on BFD.

If BFD is administratively shutdown, ignore starting the session.

Fixes: https://github.com/FRRouting/frr/issues/16186

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-12 08:39:48 +03:00
Christian Hopps
3dad09b228 mgmtd: add native session-req (create/delete) messages
This addition allows for a limited native-message-only front-end
interaction.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-11 10:37:31 -04:00
Philippe Guibert
49bc1b6c21 lib: fix copy srte_color from zapi_nexthop structure
When switching from nexthop to zapi_nexthop, the srte color
is copied. Do the same in reverse.

Fixes: 31f937fb43 ("lib, zebra: Add SR-TE policy infrastructure to zebra")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-10 12:13:56 +02:00
Donatas Abraitis
19c3e0eca6
Merge pull request #16093 from louis-6wind/fix-show-route-memory
zebra: fix Out Of Memory issue when displaying large route tables in JSON
2024-06-10 11:26:23 +03:00
Donald Sharp
2a00a648f1
Merge pull request #15900 from mikemallin/v6-vtep-lib-upstream
lib, bgpd, tests, zebra: prefix_sg changes for V6 VTEP
2024-06-07 14:34:11 -04:00
Louis Scalbert
03b1ee7a39 lib: add helpers to print json keys
Add helpers to print json keys in order to prepare the next commits.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:13:26 +02:00
Christian Hopps
657f1650e6 mgmtd: add front-end notification selector support
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:39:53 -04:00
Christian Hopps
33b73f8e3a lib: native msg add array of strings support
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:39:47 -04:00
Christian Hopps
22eccbfab9 lib: fix incorrect use of error checking macro
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:38:48 -04:00
Christian Hopps
e14781eb1d lib: darr: add free with element cleanup functions
- `darr_free_free` to `darr_free` each element prior to `darr_free`
  the array.
- `darr_free_func` to call `func` on each element prior to `darr_free`
  the array.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:38:48 -04:00
Christian Hopps
41c236120f lib: comments about public vs private message apis
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-04 00:51:33 -04:00
Mike RE Mallin
a514e34e30 bgpd, lib, zebra: Extend ES_VTEP_LIST_STR_SZ to support IPv6 addresses
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
2024-05-31 10:27:22 -04:00
Mike RE Mallin
f4f19cc20f lib, zebra: Update prefix_sg structure for IPv6 group support
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
2024-05-31 10:27:22 -04:00
Mike RE Mallin
b69ec60dc6 lib: Make the ip arg const in stream_put_ipaddr
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
2024-05-31 10:27:22 -04:00
Mike RE Mallin
b30523d3c9 lib: Add clang-format wrapper around printfrr_ext
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
2024-05-31 10:27:22 -04:00
Mike RE Mallin
f381bc2148 lib: Add ipaddr_is_same to compare IPv6 addresses
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
2024-05-31 10:27:22 -04:00
Mike RE Mallin
75e8750142 lib: Add SET_IPADDR_NONE macro
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
2024-05-31 10:27:21 -04:00
David Lamparter
5daf64f63b lib: make python/ts_expand.py actually work
lib/typesafe.h was supposed to be outside the _TYPESAFE_EXPAND_MACROS
guard, so that including lib/atomlist.h grabs all the typesafe container
macros.

(No effect on normal build, as _TYPESAFE_EXPAND_MACROS is never defined
there.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-31 11:32:05 +02:00