Commit Graph

35789 Commits

Author SHA1 Message Date
David Lamparter
b9a02da83b pimd: prepare NHT for tracking BSM C-RPs
For BSMs, we should track which of the RP candidates in the BSM message
are actually available, before trying to use them (which also puts them
in NHT for that).  This applies for both BSRs as well as BSM receivers.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 13:10:51 +02:00
David Lamparter
cca9bc193e pimd: allow sending packets without pinned iface
The upcoming Candidate-RP code needs to send PIM packets that go through
normal unicast routing, without forcing a specific output interface.
Allow passing in NULL ifp to do that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 13:10:51 +02:00
David Lamparter
18b82f64c9 pimd: add prefix_* and IANA_AFI v4/v6 defines
The Candidate-RP code is about to use these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 13:10:51 +02:00
David Lamparter
1f223ae1ee pimd: add debugs for i-am-RP state
This proved helpful in debugging the Candidate-RP code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 13:10:51 +02:00
David Lamparter
f18cb4fb58 pimd: make clang-format slightly less annoying
The YANG module list is really better as 1-item-per-line.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 13:10:51 +02:00
Donatas Abraitis
34a6e223fb
Merge pull request #16059 from kacpekwasny/kkwasny/CLIC-139-4
bgpd: fixed failing to remove VRF if there is a stale l3vni
2024-06-20 10:51:06 +03:00
Donatas Abraitis
550a3a819c
Merge pull request #16243 from donaldsharp/ubsan_documentation
doc: Document the usage of --enable-undefined-sanitizer
2024-06-20 08:08:30 +03:00
Donatas Abraitis
994792bace
Merge pull request #16234 from chiragshah6/fdev2
bgpd: backpressure - fix evpn route sync to zebra
2024-06-20 08:03:42 +03:00
Donald Sharp
248bf31a4f doc: Document the usage of --enable-undefined-sanitizer
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-06-19 08:01:16 -04:00
Donatas Abraitis
64112ed9e6
Merge pull request #16224 from donaldsharp/zebra_dplane_event_loop_starvation
zebra: Prevent starvation in dplane_thread_loop
2024-06-19 10:22:36 +03:00
Donatas Abraitis
86d2466d5a
Merge pull request #16223 from donaldsharp/bgp_vrf_name
bgpd: Convert over to using vrf name instead of id
2024-06-19 10:22:16 +03:00
Chirag Shah
b47a92e2e5 bgpd: backpressure - fix evpn route sync to zebra
In scaled EVPN + ipv4/ipv6 uni route sync to zebra,
some of the ipv4/ipv6 routes skipped reinstallation
due to incorrect local variable's stale value.

Once the local variable value reset in each loop
iteration all skipped routes synced to zebra properly.

Ticket: #3948828

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-06-18 19:41:38 -07:00
Donald Sharp
d10bd26e80 bgpd: Convert over to using vrf name instead of id
Use the name for when putting out debugs in bgp_zebra.c.
Additionally add an evpn flag for announce_route_actual.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-06-18 16:00:42 -04:00
Donald Sharp
a1b21f526a
Merge pull request #16227 from y-bharath14/srib-topotest-e
tests: Avoid importing unused modules
2024-06-18 15:52:38 -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
0c760efa5c
Merge pull request #16230 from zhou-run/202406171103
isisd: After the router switches IS-IS type several times, the neighbor adjacency cannot be established.
2024-06-18 11:20:13 -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
627a8ac091
Merge pull request #16153 from pguibert6WIND/bgp_recursive_duplicate
bgpd: fix do not skip paths with same nexthop
2024-06-18 11:00:41 -04:00
Russ White
66ad4aaf3d
Merge pull request #16172 from LabNConsulting/dleroy/nhrpd-auth-support
nhrpd: add cisco-authentication password support
2024-06-18 10:04:24 -04:00
Russ White
9eae3cf44f
Merge pull request #16179 from pguibert6WIND/isis_psid_and_backup
isisd: fix 'show isis route prefix-sid backup' command
2024-06-18 09:58:47 -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
Russ White
b94fc2d2d6
Merge pull request #16195 from opensourcerouting/fix/drop_recent_confdate
ospfd: Drop `interfaceIp` from `show ip ospf neigh json`
2024-06-18 09:56:19 -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
6d5d4f7000 tests: Check if recursive weighted ECMP works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-18 12:16:54 +03:00
Donatas Abraitis
dbf83cfd36 zebra: Set the weight for non-recursive next-hop
If using weighted ECMP, the weight for non-recursive next-hop should be
inherited from recursive next-hop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-18 12:15:33 +03: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
Y Bharath
8381dbd9e2 tests: Avoid importing unused modules
Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-06-17 15:42:59 +05:30
zhou-run
5d1298de68
isisd: After the router switches IS-IS type several times, the neighbor adjacency cannot be established.
1. Router A is configured with "is-type level-1-2", while Router B is configured with "is-type level-1". Only level 1 neighbor entries are present on Router A.
2. After configuring Router B with "is-type level-2-only", both level 1 and level 2 neighbor entries exist on Router A. The state of these entries is UP, and the level 1 neighbor entry is currently aging.
3. Before the level 1 neighbor entry on Router A ages out, configuring Router B with "is-type level-1", both level 1 and level 2 neighbor entries exist on Router A. The level 2 neighbor entry is UP and will age out normally. However, the level 1 neighbor entry remains in the Initializing state, preventing the establishment of level 1 neighbor adjacency between Router A and Router B.

When the adjacency type of the link is switched in function isis_circuit_is_type_set, the function circuit_resign_level() is called to delete the old level's circuit->u.bc.lan_neighs linked list. If the old level is not level-1-2, the function circuit_commence_level() is called to create a new level's circuit->u.bc.lan_neighs linked list, but neither of these functions handle the circuit->u.bc.adjdb linked list. This leads to a situation where upon receiving hello packets again before the circuit->u.bc.adjdb linked list entries age out, the circuit->u.bc.lan_neighs linked list is not constructed based on the circuit->u.bc.adjdb linked list. As a result, the hello packets sent will consistently lack an SNPA, causing the neighbor to remain unable to establish an adjacency upon receiving the hello packets.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
2024-06-17 16:45:09 +08:00
Renato Westphal
045029e244
Merge pull request #16225 from anlancs/doc/ldpd-fix-one-session-cmd
doc: fix one ldp neighbor command
2024-06-15 09:07:05 -03:00
anlan_cs
accdf83c57 doc: fix one ldp neighbor command
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-06-15 13:56:30 +08:00
Donald Sharp
6faad863f3 zebra: Prevent starvation in dplane_thread_loop
When removing a large number of routes, the linux kernel can take the
cpu for an extended amount of time, leaving a situation where FRR
detects a starvation event.

r1# sharp install routes 10.0.0.0 nexthop 192.168.44.33 1000000 repeat 10
2024-06-14 12:55:49.365 [NTFY] sharpd: [M7Q4P-46WDR] vty[5]@# sharp install routes 10.0.0.0 nexthop 192.168.44.33 1000000 repeat 10
2024-06-14 12:55:49.365 [DEBG] sharpd: [YP4TQ-01TYK] Inserting 1000000 routes
2024-06-14 12:55:57.256 [DEBG] sharpd: [TPHKD-3NYSB] Installed All Items 7.890085
2024-06-14 12:55:57.256 [DEBG] sharpd: [YJ486-NX5R1] Removing 1000000 routes
2024-06-14 12:56:07.802 [WARN] zebra: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task dplane_thread_loop (634377bc8f9e) ran for 7078ms (cpu time 220ms)
2024-06-14 12:56:25.039 [DEBG] sharpd: [WTN53-GK9Y5] Removed all Items 27.783668
2024-06-14 12:56:25.039 [DEBG] sharpd: [YP4TQ-01TYK] Inserting 1000000 routes
2024-06-14 12:56:32.783 [DEBG] sharpd: [TPHKD-3NYSB] Installed All Items 7.743524
2024-06-14 12:56:32.783 [DEBG] sharpd: [YJ486-NX5R1] Removing 1000000 routes
2024-06-14 12:56:41.447 [WARN] zebra: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task dplane_thread_loop (634377bc8f9e) ran for 5175ms (cpu time 179ms)

Let's modify the loop in dplane_thread_loop such that after a provider
has been run, check to see if the event should yield, if so, stop
and reschedule this for the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-06-14 13:36:51 -04:00
Jafar Al-Gharaibeh
41776f81bc
Merge pull request #16221 from donaldsharp/atomic_surprise
zebra: Use built in data structure counter
2024-06-14 11:45:47 -05:00
Donatas Abraitis
e8ce036a7b
Merge pull request #16202 from y-bharath14/srib-topotest-d
tests: suppress unused variables at topotests
2024-06-14 10:25:25 +03:00
Philippe Guibert
7a905c0d01 isisd: fix 'show isis route prefix-sid backup' command
It is not possible to dump both backup and prefix-sid
information. Fix this by authorising it.

> rt1# show isis route prefix-sid backup
> Area 1:
> IS-IS paths to level-1 routers that speak IP
> Vertex               Type         Metric Next-Hop             Interface Parent
> rt1
> 10.12.0.0/24         IP internal  0                                     rt1(4)
> 10.13.0.0/24         IP internal  0                                     rt1(4)
> 1.1.1.1/32           IP internal  0                                     rt1(4)
> rt2                  TE-IS        10     rt2                  eth-rt2   rt1(4)
> rt3                  TE-IS        10     rt3                  eth-rt3   rt1(4)
> 10.12.0.0/24         IP TE        20     rt2                  eth-rt2   rt2(4)
> 10.23.0.0/24         IP TE        20     rt2                  eth-rt2   rt2(4)
>                                          rt3                  eth-rt3   rt3(4)
> 2.2.2.2/32           IP TE        20     rt2                  eth-rt2   rt2(4)
> 10.13.0.0/24         IP TE        20     rt3                  eth-rt3   rt3(4)
> 3.3.3.3/32           IP TE        20     rt3                  eth-rt3   rt3(4)
>
> IS-IS L1 IPv4 routing table:
>
> IS-IS paths to level-1 routers that speak IPv6
> Vertex               Type         Metric Next-Hop             Interface Parent
> rt1
> 2001:db8:1000::1/128 IP6 internal 0                                     rt1(4)
> rt2                  TE-IS        10     rt2                  eth-rt2   rt1(4)
> rt3                  TE-IS        10     rt3                  eth-rt3   rt1(4)
> 2001:db8:1000::2/128 IP6 internal 20     rt2                  eth-rt2   rt2(4)
> 2001:db8:1000::3/128 IP6 internal 20     rt3                  eth-rt3   rt3(4)
>
> IS-IS L1 IPv6 routing table:
>

Fixes: d47d6089e0 ("isisd: refactor handling of SR Prefix-SIDs")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-14 08:42:18 +02:00
Donald Sharp
a23a9385a7 zebra: Use built in data structure counter
Instead of keeping a counter that is independent
of the queue's data structure.  Just use the queue's
built-in counter.  Ensure that it's pthread safe by
keeping it wrapped inside the mutex for adding/deleting
to the queue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-06-13 15:30:00 -04:00
Olivier Dugeon
7b59adcbcb
Merge pull request #16188 from anlancs/isisd/fix-metric-style
yang: fix wrong check for isis metric style
2024-06-13 15:27:21 +02:00
Philippe Guibert
209223dae2 zebra: fix sid allocation should be different with 2 isis instances
With 2 ISIS SRv6 instances, the second ISIS instance always gets
the same End SID as the first one.

> router isis 1
> segment-routing srv6
> locator loc1
> exit
> exit
> router isis 2
> segment-routing srv6
> locator loc2
> end
> segment-routing
> srv6
> locators
> locator loc1
> prefix 2001::1/64
> exit
> locator loc2
> prefix 3001::1/64
>

output:
> 2024/06/11 17:30:15 ISIS: [N6PCR-FQ5ZA] SRv6 locator (locator loc1, prefix 2001::1/64) set for IS-IS area 1
> 2024/06/11 17:30:15 ISIS: [V4RBG-TYW5S] Requesting SRv6 SIDs for IS-IS area 1
> 2024/06/11 17:30:15 ISIS: [ZRHYM-6RMYK] isis_zebra_srv6_sid_notify: received SRv6 SID notify: ctx End USP sid_value 2001::1 sid_func 0 note ZAPI_SRV6_SID_ALLOCATED
> [..]
> 2024/06/11 17:36:49 ISIS: [N6PCR-FQ5ZA] SRv6 locator (locator loc2, prefix 3001::1/64) set for IS-IS area 2
> 2024/06/11 17:36:49 ISIS: [V4RBG-TYW5S] Requesting SRv6 SIDs for IS-IS area 2
> 2024/06/11 17:36:49 ISIS: [ZRHYM-6RMYK] isis_zebra_srv6_sid_notify: received SRv6 SID notify: ctx End USP sid_value 2001::1 sid_func 0 note ZAPI_SRV6_SID_ALLOCATED

Actually, at the second request, ZEBRA always gives an existing dynamic
SID of the first available locator, because the locator name is never
checked.

> 2024/06/11 17:36:49 ZEBRA: [XMBTQ-GE6EY] get_srv6_sid: received SRv6 SID alloc request: SID ctx End USP ((null)), mode=dynamic
> 2024/06/11 17:36:49 ZEBRA: [R61Q3-QWR23] get_srv6_sid_dynamic: returning existing SID End USP 2001::1
> 2024/06/11 17:36:49 ZEBRA: [J1GMY-B6CAK] srv6_manager_get_sid_internal: got existing SRv6 SID for ctx End USP: sid_value=2001::1 (func=0) (proto=9, instance=0, sessionId=0), notify client

Fix this by checking the locator of the existing SID.

Fixes: b771bf8ce687 ("zebra: Add functions to alloc/release SRv6 SIDs")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-13 14:54:17 +02:00
Philippe Guibert
35a87b6acd zebra: fix display explicit sid refused
> 2024/06/07 15:09:43 ZEBRA: [MZYPC-GBDGR] srv6_manager_get_sid_internal: getting SRv6 SID for ctx End.DT4 vrf vrf1, sid_value=1003::4, locator_name=
> [..]
> 2024/06/07 15:09:43 ZEBRA: [QGJBT-YJ11W] zsend_srv6_sid_notify: notifying ZEBRA_SRV6_SID_NOTIFY ctx End.DT4 vrf vrf2, sid (null) note ZAPI_SRV6_SID_FAIL_ALLOC (proto=30, instance=0, sessionId=0)

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-13 14:54:16 +02:00
Philippe Guibert
708f20e58a zebra: fix display srv6 address only for explicit-sid
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-13 14:54:16 +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
33bd67a006 doc: Add documentation for SRv6 SID formats CLI
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
5365c56614 zebra: Notify all daemons about locator delete
Currently, when a locator is deleted in zebra, zebra notifies only the
zclient that owns the locator.

With the introduction of SID Manager, the locator is no longer owned by
any client. Instead, the locator is owned by Zebra, and clients can
allocate and release SIDs from the locator using the ZAPI
ZEBRA_SRV6_MANAGER_GET_SID and ZEBRA_SRV6_MANAGER_RELEASE_SID.

Therefore, when a locator is removed in Zebra, we need to notify all
daemons so that they can release/uninstall the SIDs allocated by that
locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
efa830e89c zebra: Notify daemons about SIDs
Send asynchronous notifications to zclients when an SRv6 SID is
allocated/released and when a SID alloc/release operation fails.

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
84dd482cb9 zebra: Alloc/Release SIDs to daemons upon request
Previous commits introduced two new ZAPI operations,
`ZEBRA_SRV6_MANAGER_GET_SRV6_SID` and
`ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID`. These operations allow a daemon
to interact with the SRv6 SID Manager to get and release an SRv6 SID,
respectively.

This commit extends the SID Manager by adding logic to process the
requests `ZEBRA_SRV6_MANAGER_GET_SRV6_SID` and
`ZEBRA_SRV6_MANAGER_RELEASE_SRV6_SID`, and allocate/release SIDs to
requesting daemons.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
c570d2bcae zebra: Add functions to alloc/release SRv6 SIDs
Add functions to allocate/release SRv6 SIDs. SIDs can be allocated
either explicitly (allocate a specific SID) or dynamically (allocate any
available SID).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-13 14:54:16 +02:00
Carmine Scarpitta
f8da4a29e5 zebra: Repond to GET_LOCATOR ZAPI request
The previous commits introduced a new operation,
`ZEBRA_SRV6_MANAGER_GET_LOCATOR`, allowing a daemon to request
information about a specific SRv6 locator from the SRv6 SID Manager.

This commit extends the SID Manager to respond to a
`ZEBRA_SRV6_MANAGER_GET_LOCATOR` request and provide the requested
locator information.

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