Commit Graph

30591 Commits

Author SHA1 Message Date
Donald Sharp
3d1588d8ed ripd: Cleanup memory allocations on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-12 07:39:23 -04:00
Donald Sharp
823d80d155 zebra: zrouter.mh_info is leaked on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-12 07:39:23 -04:00
Donald Sharp
ca28a0f6fa lib: Free some memory in scripting subsystem at shutdown
Pre:
staticd: showing active allocations in memory group libfrr
staticd: memstats:  Scripting                     :     16 * (variably sized)
staticd: memstats:  Hash                          :      2 * (variably sized)
staticd: memstats:  Hash Bucket                   :      8 *         32
staticd: memstats:  Hash Index                    :      1 * (variably sized)
staticd: memstats:  Link List                     :      1 *         40
staticd: memstats:  Link Node                     :      1 *         24
staticd: showing active allocations in memory group logging subsystem
staticd: memstats:  log file target               :      1 *         88
staticd: showing active allocations in memory group staticd

Post:
staticd: showing active allocations in memory group libfrr
staticd: showing active allocations in memory group logging subsystem
staticd: memstats:  log file target               :      1 *         88
staticd: showing active allocations in memory group staticd

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-12 07:39:23 -04:00
Donald Sharp
08040409cc staticd: Clean up zclient on shutdown
The zclient data structure was not being cleaned up on shutdown.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-12 07:39:23 -04:00
Madhuri Kuruganti
80f6ea8b99 bgpd: code review comments addressed
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:48:23 +05:30
Madhuri Kuruganti
bba9435157 bgpd, ospfd: update BGP when routes are removed from OSPF routing table
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
5fcf01c9ae bgpd: fix for crash when no neighbor A.B.C.D remote-as AS_NUM with orr config
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
9f2984d97c ospfd: few fixes in rSPF calc when LSA received from non root node
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
d6b2761134 bgpd, ospfd: BGP ORR CI warning fixes
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
a3d3a14c09 ospfd: rSPF calc and messaging for optimal route reflection
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
70cd87ca02 bgpd: optimal router reflection cli and fsm changes
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:43:55 +05:30
Madhuri Kuruganti
2b55ff400f doc: Add documentation for BGP ORR support
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:29:24 +05:30
Madhuri Kuruganti
a5dd4bf47d lib: BGP registration with IGP for BGP ORR rSPF calc
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12 13:29:24 +05:30
Donatas Abraitis
69c736ec06
Merge pull request #12074 from donaldsharp/lib_debugs
*: Create and use infrastructure to show debugs in lib
2022-10-12 10:38:21 +03:00
Donatas Abraitis
4b7ad630e0
Merge pull request #12091 from kuldeepkash/update_assert_msg
tests: [topojson]Update assert messages for better debugging
2022-10-12 10:37:10 +03:00
Stephen Worley
100290e449 bgpd: fix vni table output broken by 8304dabfab
Fix vni table output broken by 8304dabfab

The "Imported from" output was not getting delimitted by a newline
after the mentioned commit. This fixes that and retains the output
wanted by the original change.

Before:

'''
  Route [2]:[0]:[48]:[b6:3a:cc:d5:a1:cd]:[128]:[fe80::b43a:ccff:fed5:a1cd] VNI 30/10  Imported from 2.2.2.2:4:[2]:[0]:[48]:[b6:3a:cc:d5:a1:cd]:[128]:[fe80::b43a:ccff:fed5:a1cd], VNI 30/10

  2
    2.2.2.2(alfred) from alfred(veth1) (2.2.2.2)
      Origin IGP, valid, external, bestpath-from-AS 2, best (First path received)
      Extended Community: RT:2:30 ET:8
      Last update: Fri Oct  7 16:04:59 2022
'''

After:

'''
  Route [2]:[0]:[48]:[b2:cf:96:70:4f:b6]:[128]:[fe80::b0cf:96ff:fe70:4fb6] VNI 30/10
  Imported from 2.2.2.2:4:[2]:[0]:[48]:[b2:cf:96:70:4f:b6]:[128]:[fe80::b0cf:96ff:fe70:4fb6], VNI 30/10
  2
    2.2.2.2(alfred) from alfred(veth1) (2.2.2.2)
      Origin IGP, valid, external, bestpath-from-AS 2, best (First path received)
      Extended Community: RT:2:30 ET:8
      Last update: Fri Oct  7 17:02:28 2022
'''

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 16:18:21 -04:00
Stephen Worley
8476d11c49 doc: add new show bgp vni ... command to docs
Add new `show bgp vni ...` command to docs. This command
is used to show the per-VNI EVPN tables in BGP.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 16:18:21 -04:00
Trey Aspelund
b5118501ac bgpd: don't unlock bgp_dest twice
Both install_evpn_route_entry_in_vni_mac() and
install_evpn_route_entry_in_vni_ip() will unlock the bgp_dest when
install_evpn_route_entry_in_vni_common() returns, so there's no need to
unlock the bgp_dest inside the _common function.  Let's let the new
wrappers handle the cleanup of the dest.

Ticket: #3119673

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-10-11 16:18:21 -04:00
Stephen Worley
15919b8915 bgpd: add show bgp vni <VNI|all> json commands
Add add show bgp vni <VNI|all> json commands.

This is very similar to the old `show bgp evpn l2vpn vni route json`
commands but adds a new `macTable` object under the normal output.

This may change in the future but doing it like this for now

VNI ALL:

```
{
"1002":{
"vni":1002,
"[2]:[0]:[48]:[00:00:00:00:00:00]:[128]:[fe80::202:ff:fe00:9]":{
  "prefix":"[2]:[0]:[48]:[00:00:00:00:00:00]:[128]:[fe80::202:ff:fe00:9]",
  "prefixLen":352,
  "paths":[
    [
      {
        "valid":true,
        "pathFrom":"external",
...
...
...
    "numPrefix":4,
    "numPaths":7,
    "macTable":{
      "[2]:[0]:[48]:[00:02:00:00:00:09]":{
        "prefix":"[2]:[0]:[48]:[00:02:00:00:00:09]",
        "prefixLen":352,
        "paths":[
          [
            {
              "valid":true,
              "pathFrom":"external",

```

VNI 1002:

```
{
  "[2]:[0]:[48]:[00:00:00:00:00:00]:[128]:[fe80::202:ff:fe00:9]":{
    "prefix":"[2]:[0]:[48]:[00:00:00:00:00:00]:[128]:[fe80::202:ff:fe00:9]",
    "prefixLen":352,
    "paths":[
      [
        {
          "valid":true,
          "pathFrom":"external",
...
...
...
  "numPrefix":4,
  "numPaths":7,
  "macTable":{
    "[2]:[0]:[48]:[00:02:00:00:00:09]":{
      "prefix":"[2]:[0]:[48]:[00:02:00:00:00:09]",
      "prefixLen":352,
      "paths":[
        [
          {
            "valid":true,
            "pathFrom":"external",
```

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 16:18:21 -04:00
Stephen Worley
0653625d3b zebra: add some neigh del not found debugs
Add some neigh deletion debugs for when the neigh isn't
found or there is a MAC mismatch on what was sent and found.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 16:18:21 -04:00
Stephen Worley
852d9f9757 bgpd,zebra,lib: bgp evpn vni macip into two tables
Re-work the bgp vni table to use separately keyed tables for type2
routes.

So, with type2 routes, we have the main table keyed off of the IP and a
new MAC table keyed off of MACs.

By separating out the two, we are able to run path selection separately
for the neigh and mac. Keeping the two separate is also more in-line
with what happens in zebra (they are managed comptletely seperate).

With this change type2 routes go into each table like so:

```
Remote MAC-IP -> IP Table & MAC Table
Remote MAC -> MAC Table

Local MAC-IP -> IP Table
Local MAC -> MAC Table
```

The difference for local is necessary because we should not ever allow
multiple paths for a local MAC.

Also cleaned up the commands for querying the vni tables:

```
show bgp vni all type ...
show bgp vni VNI type ...

```

Old commands will be deprecated in a separate commit.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 16:18:21 -04:00
Donatas Abraitis
63f99a91c8 tools: Apply black formatting for frr-reload.py
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-11 22:38:30 +03:00
Donatas Abraitis
8bcbee1999 tools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py
If we add/modify community/large/ext lists without sequence numbers, and
doing frr-reload.py, then rules with sequence numbers (show running-config
always adds sequence numbers) will be deleted and new ones will be re-added.

This could lead to blackholing for some time.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-11 22:36:26 +03:00
Anuradha Karuppiah
36bac85c7f bgpd: sync seq numbers only if the MAC address is the same
We locate the sync path with the highest seq number for normalizing
local path to the same seq. With the change to maintain the VNI RT table
by IP address (instead of MAC&IP) we need additional changes to skip
paths with a different mac address than the local one we are trying to
normalize.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-10-11 15:18:39 -04:00
Anuradha Karuppiah
90f30caa24 bgpd: include ESI in the zebra update log
Log changes only; no functional change.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-10-11 15:18:39 -04:00
Stephen Worley
1e1398e3da zebra: special sync routes lower seq handling
Add some special handling to accept lower seq routes for local
known routes when not ready. This aligns the code back a bit more
to where it was before to fix seen issues with sync routes.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 15:18:39 -04:00
Stephen Worley
34c7f35f02 bgpd: rework VNI table for type2/macip routes
Use the IP addr of type2/macip routes only for the hash/key
of the VNI table and carry the MAC in a path_info_extra attribute.

There is exists situations that can be hit during extended MAC mobility events
where two MACs could be pointing to the same IP in our global table. It
is requires very specific timings.

When that happens, BPG would (because we key'd on both MAC and IP)
install both into it's VNI table as separate entries, but zebra only
knows/needs to know about a single IP -> MAC relationship for it's VNI
table's type2 routes. So it was compleletly undeterministic which one
zebra would end up with in these timing situations.

With these changes, we move BGP's VNI table to key'd the same as Zebra's
and now a single IP will have multiple path_info's with a path_info_extra
that is carrying the MAC info for each path.

BGP will then run best path to deterministically decide which one to send to
zebra during the occasions where there exist's two possible MACs.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-11 15:18:39 -04:00
Donatas Abraitis
9cd8485420
Merge pull request #12090 from patrasar/pimv6_show_bsm_db
pim6d: Fix RpAddress in "show ipv6 pim bsm-database"
2022-10-11 21:59:22 +03:00
Donatas Abraitis
656878e513
Merge pull request #12087 from achernavin22/fix-no-match-rpki
bgpd: fix "no match rpki" in route-map
2022-10-11 17:05:19 +03:00
Donatas Abraitis
9f03e9b2e5
Merge pull request #12099 from cscarpitta/fix/remove-null-check-before-free
bgpd: Don't check for `NULL` when removing SRv6 SIDs
2022-10-11 16:39:16 +03:00
Carmine Scarpitta
944909f4f7 bgpd: Don't check for NULL when removing SRv6 SIDs
When an SRv6 locator is unset, all the SRv6 SIDs allocated from the
locator are removed. Before freeing the memory allocated for an SRv6
SID, we check if the pointer to the SID is `NULL`.

However, checking for `NULL` before freeing memory is useless.

This PR aims to improve the code's readability by removing the
useless `NULL` checks.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-11 13:06:39 +02:00
Alexander Chernavin
05ab8ceda4 bgpd: fix "bgp max-med on-startup"
Currently, if `bgp max-med on-startup` is configured, after BGP session
is established for the first time, a timer for the specified time is
started. When the timer is expired, an UPDATE message should be sent to
reflect changes in the routes' MED value. The problem is that the routes
are being suppressed because based on the attributes they look like they
have not changed. However, in the case of max-med, the value is copied
to the packet directly from `bgp->maxmed_value`, not from the
attributes. Thus, changes in this case cannot be detected by comparing
attributes.

With this fix, avoid route suppressing when the `max-med on-startup`
timer expires and initiates an UPDATE.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2022-10-11 10:45:06 +00:00
Alexander Chernavin
87c3ed1bf8 bgpd: fix "no match rpki" in route-map
With this fix, make "no match rpki" in a route-map actually remove the
node in the candidate configuration instead of creating it.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2022-10-11 10:39:50 +00:00
Donatas Abraitis
afd4d90111
Merge pull request #12084 from ak503/bgp_show_lc
bgpd: fix display bgp large-community exact-match
2022-10-11 09:56:39 +03:00
Kuldeep Kashyap
84ab38367d tests: Applied black formatting
Applied black formatting to suites,
which were missing.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-10-11 12:17:54 +05:30
Sarita Patra
7e371efb85 pim6d: Fix RpAddress in "show ipv6 pim bsm-database"
RpAddress is showing wrong value in
"show ipv6 pim bsm-database" cli. This is fixed now.

Issue: #12089

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-10 22:10:43 -07:00
Ryoga Saito
68fb161b22 doc: Update docs for SRv6 locator prefix command
In previous commits, func-bits was expanded to 0-64. This PR reflects
these changes.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-10-11 10:00:19 +09:00
Kuldeep Kashyap
d63c7094e4 tests: Updated assert message for better debugging
Updating topojson script's assert messages,
which will help in better debugging, when
test will fail.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-10-11 06:07:48 +05:30
Donatas Abraitis
2ab760f056 watchfrr: Delay restart_kill if still reading configuration
This mostly happens only for large configuration files, where the default
restart-time (-T, --restart-time / 20s) is not enough.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-10 17:18:30 +03:00
Donatas Abraitis
eb53128367
Merge pull request #9998 from pguibert6WIND/bgp_tcp_keepalive
Bgp tcp keepalive
2022-10-10 15:46:30 +03:00
Your Name
1857760c1e bgpd: fix display bgp large-community exact-match
Before patch:
frr# show bgp large-community 1:1:1 exact-match
% Large-community malformed

After patch:
frr# show bgp large-community 1:1:1 exact-match

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
2022-10-10 13:51:27 +03:00
Donatas Abraitis
0c993136ef
Merge pull request #12082 from anlancs/fix/cleanup-21
bgpd: cosmetic function address
2022-10-10 12:37:21 +03:00
Donatas Abraitis
5feffa8147
Merge pull request #12070 from cscarpitta/fix/srv6-sid-print-using-pI6
bgpd: Use `%pI6` to print the SRv6 VPN SIDs
2022-10-10 09:36:36 +03:00
Donatas Abraitis
a957e14cdf
Merge pull request #11961 from maduri111/ospfd-debug-cmds
ospfd: fix for some of ospf debug commands config lost after reboot
2022-10-09 21:16:01 +03:00
Donatas Abraitis
05d16acb20
Merge pull request #12073 from donaldsharp/pi_or_die
bgpd: Remove unnecessary check for pi and setting type and sub-type
2022-10-09 17:01:38 +03:00
Donatas Abraitis
e7954294a7
Merge pull request #12083 from donaldsharp/nexthop_group_issues_local
tests: nhid is interfering with pattern match
2022-10-09 17:01:16 +03:00
Donald Sharp
a61f4f48c7 tests: nhid is interfering with pattern match
The bgp_gr_restart_retain_routes test is looking for specific output
that does not include the routes nexthop id:

    def _bgp_check_kernel_retained_routes():
        output = (
            r2.cmd("ip route show 172.16.255.1/32 proto bgp dev r2-eth0")
            .replace("\n", "")
            .rstrip()
        )
        expected = "172.16.255.1 via 192.168.255.1 metric 20"
        diff = topotest.get_textdiff(
            output, expected, "Actual IP Routing Table", "Expected IP RoutingTable"
        )
        if diff:
            return False
        return True

While the output includes nexthop group id's now:

root@r2:# ip route show 172.16.255.1 proto bgp dev r2-eth0
172.16.255.1 nhid 8 via 192.168.255.1 metric 20

Let's just mark r2 as not to use nexthop groups for installation
and this test issue will go away.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-08 10:35:35 -04:00
anlan_cs
f714e57a32 bgpd: cosmetic function address
No mistake, just to unify style for the parameter of function address - remove
ampersand.  In current code, only this one place of `hook_register()`s needs
to be made.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-10-08 06:11:52 -04:00
Stephen Worley
7d99ad7f93 zebra: add knob to accept lower seq in evpn
Add a knob to accept lower seq number in evpn updates
from BGP in Zebra.

Note: Knob is enabled by default

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-07 15:36:57 -04:00
Donald Sharp
cf00164b69 *: Create and use infrastructure to show debugs in lib
There are lib debugs being set but never show up in
`show debug` commands because there was no way to show
that they were being used.  Add a bit of infrastructure
to allow this and then use it for `debug route-map`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-07 12:39:05 -04:00