Commit Graph

5846 Commits

Author SHA1 Message Date
Olivier Dugeon
5a373ce912
Merge pull request #15653 from pguibert6WIND/link_state_srv6_capas
Link state srv6 capas
2024-04-30 15:39:11 +02:00
Donatas Abraitis
5f059e0c7d
Merge pull request #15854 from mjstapp/dump_outofsync_flag
lib: add ZEBRA_FLAG_OUTOFSYNC to dump_flags function
2024-04-27 21:16:49 +03:00
Mark Stapp
c943b71c9f lib: add ZEBRA_FLAG_OUTOFSYNC to dump_flags function
Right where the zapi route flags are defined, there's a comment
asking that the flag-dumper-function also be updated.

Also apply clang-format's preferences, so next person won't have
to.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-26 14:48:00 -04:00
Russ White
f19817f71d
Merge pull request #15723 from opensourcerouting/feature/extended_link_bw_refactored_v1
bgpd: Implement extended link-bandwidth
2024-04-26 14:41:05 -04:00
Donald Sharp
6a7fadaecc
Merge pull request #15588 from opensourcerouting/sqlite-filename-size
lib: fix SQLite dbfile path length
2024-04-26 10:19:05 -04:00
David Lamparter
b472b024ea yang: ietf-netconf-acm needs to be in libfrr
ietf-key-chain depends on ietf-netconf-acm, and lib/ code sets up the
former, so ietf-netconf-acm needs to be embedded in the libfrr too.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 15:06:14 +02:00
Mark Stapp
3a59d4f984 lib,bgpd,vtysh: move bgp vty defines to lib
Stop including a bgp header file from vtysh; move a couple
of cli string defines to a library header.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-24 08:23:12 -04:00
Mark Stapp
1c49f93b5f
Merge pull request #15769 from raja-rajasekar/rajasekarr/backpressure_display_i_o_buf
zebra: Actually display I/O buffer sizes (part-2)
2024-04-23 13:01:35 -04:00
Donald Sharp
b8f0be9ddd
Merge pull request #15714 from mjstapp/sync_pthread_startup
lib: serialize pthread startup
2024-04-23 12:55:27 -04:00
Philippe Guibert
a08922256a isis, lib: add isis srv6 capability to ls_node
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:27:01 +02:00
Philippe Guibert
196f0d69fa isisd, lib: add link state support for srv6 adjacencies
Add support for endx_lan and endx adjacency.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:27:01 +02:00
Mark Stapp
a4e60f3399
Merge pull request #15815 from donaldsharp/blackhole_reinstall
lib, zebra: Check for not being a blackhole route
2024-04-23 08:08:43 -04:00
Donatas Abraitis
5738263065
Merge pull request #15750 from piotrsuchy/json_show_ip_prefix_list_fix
vtysh, lib: fix 'show ip[v6] prefix-list ... json' JSON display by moving it to vtysh to fix formatting issue
2024-04-23 11:06:44 +03:00
Donatas Abraitis
a988a0a88a *: Use uint64_t for weight down the path to Zebra
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
09e2a362a3 bgpd: Implement draft-li-idr-link-bandwidth-ext-01
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donald Sharp
29c1ff446e lib, zebra: Check for not being a blackhole route
In zebra_interface_nhg_reinstall zebra is checking that the
nhg is a singleton and not a blackhole nhg.  This was originally
done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX,
NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX.  This
was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6.  These
were both possible to be received and maintained from the upper
level protocol for when a route is being recursively resolved.
If we have gotten to this point in zebra_interface_nhg_reinstall
the nexthop group has already been installed at least once
and we *know* that it is actually a valid nexthop.  What the
test is really trying to do is ensure that we are not reinstalling
a blackhole nexthop group( Which is not possible to even be
here by the way, but safety first! ).  So let's change
to test for that instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-22 10:44:55 -04:00
Christian Hopps
7f7bcb1ffa
Merge pull request #15468 from idryzhov/mgmt-native-edit
mgmtd: add support for native 'edit' operation
2024-04-22 05:42:44 -04:00
Piotr Suchy
0a17289a3b vtysh, lib: fix 'show ip[v6] prefix-list ... json' formatting by moving it to vtysh
Json output is not valid for 'show ip[v6] prefix-list ... json' commands,
as it goes through all the running daemons and for each one it calls
'vty_show_prefix_list' creating a new json object. To aggreagate the output
and create a valid json that can be parsed, the commands were moved to vtysh.

Before:
{
  "ZEBRA":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}
{
  "OSPF":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}
{
  "BGP":{
    "DEFAULT":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":10,
          "type":"permit",
          "prefix":"0.0.0.0/0"
        }
      ]
    }
  }
}

After:
{"zebra":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
,"ospfd":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
,"bgpd":{
  "DEFAULT":{
    "addressFamily":"IPv4",
    "entries":[
      {
        "sequenceNumber":10,
        "type":"permit",
        "prefix":"0.0.0.0/0"
      }
    ]
  }
}
}

Signed-off-by: Piotr Suchy <piotrsuchy@proton.me>
2024-04-21 23:40:06 +02:00
Jafar Al-Gharaibeh
8e7fb950c1
Merge pull request #15770 from idryzhov/fix-yang-exit
lib, zebra: fix exit commands
2024-04-18 01:33:07 -05:00
Igor Ryzhov
5f018a36d5 lib: fix keychain NB crash
Operational data should not be used on validation stage. Move the usage
to apply stage only.

Fixes #15707.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-16 23:34:20 +03:00
Igor Ryzhov
57811a53ba lib, zebra: fix exit commands
If a command is not marked as `YANG`-converted, the current command
batching buffer is flushed before executing the command. We shouldn't
flush the buffer when executing an `exit` command. It should only be
flushed if the next command is not `YANG`-converted, which is checked by
the command itself, not the previous `exit`.

Fixes #15706.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-16 22:18:01 +03:00
Rajasekar Raja
33dccbe31c zebra: Actually display I/O buffer sizes (part-2)
An extension of commit-8d8f12ba8e5cd11c189b8475b05539fa8415ccb9

Removing ifdef DEV_BUILD in stream_fifo_push as well to make the 'sh
zebra client' display the current I/O fifo along with max fifo items.

TICKET :#3390099

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-04-16 11:33:08 -07:00
Jafar Al-Gharaibeh
692f916b88
Merge pull request #15688 from mjstapp/dplane_api_version
lib, zebra: Add a version scheme for the dataplane API
2024-04-11 23:54:02 -05:00
Mark Stapp
44eb133b52 lib: serialize pthread startup
Add a new condition var and mutex to serialize pthread startup.
When a new pthread is started, it will wait very early on for the
parent pthread to permit it to run. This ensures that that the
ordering between parent and child is predictable.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-11 09:00:58 -04:00
Donatas Abraitis
73a6aa6a14
Merge pull request #15708 from donaldsharp/zebra_fix_io_display
Zebra fix io display and shorten evpn zapi packet sizes
2024-04-10 08:26:02 +03:00
Russ White
7f6cda36b1
Merge pull request #15660 from LabNConsulting/acee/ospf-p2mp-non-broadcast
ospfd: Implement non-broadcast support for point-to-multipoint networks
2024-04-09 11:56:34 -04:00
Donald Sharp
8d8f12ba8e zebra: Actually display I/O buffer sizes
An operator found a situation where zebra was
backing up in a significant way towards BGP
with EVPN changes taking up some serious amounts
of memory.  The key lines that would have clued
us in on it were behind a dev build.  Let's change
this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-09 10:08:03 -04:00
Mark Stapp
f090079390 lib: add simple generic version helpers
Add some simple helpers for generic major+minor+sub version
values.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-09 08:59:13 -04:00
Philippe Guibert
6f45349197 lib: add srv6 bsid to seg6local_context2str
Add SRv6 Binding SID END.B6.Encaps nh6 str to lib.
It is used to display nh6 when one uses 'show ipv6 route'.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-03 21:03:26 +02:00
Acee Lindem
58e623714b ospfd: Implement non-broadcast support for point-to-multipoint networks
This extends non-broadcast support to point-to-multipoint networks.
Neighbors will be explicitly configured and polled in lieu of multicast
dicovery. Toptotests and documentation updates are included.

Additionally, the ospf neighbor commands have been greatly simplified taking
advantage of DEFPY() capabilities.

The AllOSPFRouters (224.0.0.5) is still joined for non-broadcast networks
since it is joined for NBMA networks. It seems this could be removed but
it should done be in a separate commit.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-02 21:34:29 +00:00
Jafar Al-Gharaibeh
d5f17cd51e
Merge pull request #15557 from idryzhov/remove-confd
*: remove confd plugin
2024-03-27 12:38:31 -05:00
Igor Ryzhov
1196d947d3 mgmtd: add support for native 'edit' operation
This operation basically implements support for RESTCONF operations. It
receives an xpath and a data tree in JSON/XML format, instead of a list
of (xpath, value) tuples as required by the current protobuf interface.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-26 17:00:15 +02:00
Russ White
94e6a0f0c1
Merge pull request #15524 from raja-rajasekar/rajasekarr/backpressure_bgp_zebra_client
backpressure bgp zebra client
2024-03-26 10:03:35 -04:00
Donald Sharp
ccfe452763 bgpd : backpressure - Handle BGP-Zebra Install evt Creation
BGP is now keeping a list of dests with the dest having a pointer
to the bgp_path_info that it will be working on.

1) When bgp receives a prefix, process it, add the bgp_dest of the
prefix into the new Fifo list if not present, update the flags (Ex:
earlier if the prefix was advertised and now it is a withdrawn),
increment the ref_count and DO NOT advertise the install/withdraw
to zebra yet.

2) Schedule an event to wake up to invoke the new function which will
walk the list one by one and installs/withdraws the routes into zebra.
  a) if BUFFER_EMPTY, process the next item on the list
  b) if BUFFER_PENDING, bail out and the callback in
  zclient_flush_data() will invoke the same function when BUFFER_EMPTY

Changes
 - rename old bgp_zebra_announce to bgp_zebra_announce_actual
 - rename old bgp_zebra_withdrw to bgp_zebra_withdraw_actual
 - Handle new fifo list cleanup in bgp_exit()
 - New funcs: bgp_handle_route_announcements_to_zebra() and
   bgp_zebra_route_install()
 - Define a callback function to invoke
   bgp_handle_route_announcements_to_zebra() when BUFFER_EMPTY in
   zclient_flush_data()

The current change deals with bgp installing routes via
bgp_process_main_one()

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-03-25 17:49:35 -07:00
Igor Ryzhov
988d4444d4 mgmtd: fix a couple of log messages
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-22 16:35:52 +02:00
Mark Stapp
75bc220a10
Merge pull request #15591 from opensourcerouting/fix/housekeeping
*: License housekeeping
2024-03-22 07:28:43 -04:00
Christian Hopps
043a4183c2 grpc: fix grpc for various failures
lib: don't define a `fallthrough` in c++ to avoid conflict with protobuf c++

check: add link libs required by some versions of grpc++ or it's dependent
linked libs

tests: don't fail the test due to known at exit memleaks
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-21 15:57:01 +00:00
Donatas Abraitis
874242f129 *: Add missing SPDX-License-Identifier for some .c/.h files
Adding them as others: GPL-2.0-or-later

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-03-21 16:46:58 +02:00
David Lamparter
8043a71dbf lib: fix SQLite dbfile path length
I can't see them but apparently this causes compiler warnings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-03-21 10:25:26 +10:00
Russ White
e2d63567ec
Merge pull request #15565 from LabNConsulting/chopps/code-cover
tests: enable code coverage reporting with topotests
2024-03-19 17:19:45 -04:00
Donald Sharp
051f2249e9
Merge pull request #15566 from idryzhov/daemonize-nb-logs
lib: remove nb/yang memory cleanup when daemonizing
2024-03-18 07:59:04 -04:00
Mark Stapp
8cc52ef79c
Merge pull request #15424 from askorichenko/master
zebra: fix route deletion during zebra shutdown
2024-03-18 07:44:14 -04:00
Igor Ryzhov
a564710c34 lib: remove nb/yang memory cleanup when daemonizing
We're not calling any other termination functions to free allocated
memory when daemonizing except these two. There's no reason for such an
exception, and because of these calls we have the following libyang
warnings every time FRR is started:
```
MGMTD: libyang: String "15" not freed from the dictionary, refcount 2
MGMTD: libyang: String "200" not freed from the dictionary, refcount 2
MGMTD: libyang: String "mrib-then-urib" not freed from the dictionary, refcount 2
MGMTD: libyang: String "1000" not freed from the dictionary, refcount 2
MGMTD: libyang: String "10" not freed from the dictionary, refcount 2
MGMTD: libyang: String "5" not freed from the dictionary, refcount 2
```

Remove these calls to get rid of the unnecessary warnings.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-17 22:44:28 +02:00
Christian Hopps
71368f9e06 tests: enable code coverage reporting with topotests
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-17 04:53:13 -04:00
Donald Sharp
22ac450b79 lib: Prevent crash then another crash from happening
When a memory operation (malloc/free/... ) causes a crash
and the call to core_handler causes another crash then
instead of actually writing a core dump the alarm is
hit and the daemon in trouble will not cause a core dump.
Modify the shutdown code to just try to dump the buffers
and leave instead of cleaning up after itself.

Back Trace:

(gdb) bt
0  0x00007f17082ec056 in __lll_lock_wait_private () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f17082fc8bd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f17082fee8f in free () from /lib/x86_64-linux-gnu/libc.so.6
3  0x00007f170866c2ea in qfree (mt=<optimized out>, ptr=<optimized out>) at lib/memory.c:141
4  0x00007f17086c156a in zlog_tls_free (arg=0x55584f816fb0) at lib/zlog.c:390
5  zlog_tls_buffer_fini () at lib/zlog.c:346
6  0x00007f1708695e5f in core_handler (signo=11, siginfo=0x7ffd173229f0, context=<optimized out>) at lib/sigevent.c:264
7  <signal handler called>
8  0x00007f17082fd7bc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
9  0x00007f17082ff6e2 in calloc () from /lib/x86_64-linux-gnu/libc.so.6
10 0x00007f1708451e78 in lh_table_new () from /lib/x86_64-linux-gnu/libjson-c.so.5
11 0x00007f170844c979 in json_object_new_object () from /lib/x86_64-linux-gnu/libjson-c.so.5
12 0x000055584e002fd9 in evpn_show_all_routes (vty=vty@entry=0x55584fb5ea00, bgp=bgp@entry=0x55584f82c600, type=<optimized out>, json=json@entry=0x55584f998130, detail=<optimized out>,
    self_orig=<optimized out>) at bgpd/bgp_evpn_vty.c:3192
13 0x000055584e009ed6 in show_bgp_l2vpn_evpn_route (self=<optimized out>, vty=0x55584fb5ea00, argc=6, argv=0x55584f998970) at bgpd/bgp_evpn_vty.c:5048
14 0x00007f170863af60 in cmd_execute_command_real (vline=vline@entry=0x55584fa87cb0, vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x0, up_level=up_level@entry=0, filter=FILTER_RELAXED)
    at lib/command.c:1030
15 0x00007f170863b2be in cmd_execute_command (vline=vline@entry=0x55584fa87cb0, vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1089
16 0x00007f170863b550 in cmd_execute (vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x55584fb65160 "sh bgp l2vpn evpn route json", matched=matched@entry=0x0, vtysh=vtysh@entry=0)
    at lib/command.c:1257
17 0x00007f17086acc77 in vty_command (vty=vty@entry=0x55584fb5ea00, buf=0x55584fb65160 "sh bgp l2vpn evpn route json") at lib/vty.c:503
18 0x00007f17086ad444 in vty_execute (vty=vty@entry=0x55584fb5ea00) at lib/vty.c:1266
19 0x00007f17086b06c8 in vtysh_read (thread=<optimized out>) at lib/vty.c:2165
20 0x00007f17086a798d in thread_call (thread=thread@entry=0x7ffd17325ce0) at lib/thread.c:2008
21 0x00007f1708660568 in frr_run (master=0x55584f22a120) at lib/libfrr.c:1223
22 0x000055584dfc8c96 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:555

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-03-15 12:10:58 -04:00
Alexander Skorichenko
444ce317b2 zebra: fix route deletion during zebra shutdown
Split zebra's vrf_terminate() into disable() and delete() stages.
The former enqueues all events for the dplane thread.
Memory freeing is performed in the second stage.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
2024-03-15 11:42:02 +01:00
Igor Ryzhov
84a00a47b8 *: remove confd plugin
ConfD is not supported anymore and its use is discouraged by developers:
https://discuss.tail-f.com/t/confd-premium-no-longer-available-future-of-confd/4552/6

Remove the code and all mentions of ConfD from the documentation.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-15 00:58:10 +02:00
Russ White
dfa27764a2
Merge pull request #15457 from opensourcerouting/fix/docker_builds_for_10.0
docker: Fix build for Alpine Linux after the recent changes since 9.1
2024-03-12 09:52:39 -04:00
Donatas Abraitis
1942951ea4
Merge pull request #15523 from donaldsharp/lib_mtype_cleanup
Lib mtype cleanup
2024-03-12 07:14:10 +01:00
Donald Sharp
a67e159e3b lib: Remove MTYPE_SYSREPO it is not used
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-03-11 16:52:51 -04:00