Commit graph

21 commits

Author SHA1 Message Date
Carmine Scarpitta ab7a7541a6 staticd: Add no form for static-sids command
Currently, when the user tries to delete all static SIDs with the
`no static-sids` command, staticd returns an error.

```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
% Unknown command: no  static-sids
```

The problem is the `static-sids` command does not support the `no` form.

This PR enables the `no` form for the `static-sids` command.

```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-27 12:17:26 +01:00
Carmine Scarpitta 646c4f95d9 staticd: Add nb callbacks to configure a nexthop for SRv6 uA behavior
An SRv6 uA SID is associated with the interface and (optionally) the
IPv6 address of the nexthop.

This commit adds the modify and destroy nortbound callbacks required to
set the nexthop.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta 7438a94eeb staticd: Add nb callbacks to configure an interface for SRv6 uA behavior
An SRv6 uA SID is associated with the interface and (optionally) the
IPv6 address of the nexthop.

This commit adds the modify and destroy nortbound callbacks required to
set the interface.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
David Lamparter 3671ce36fd staticd: fix botched staticd YANG for dst-src
The staticd YANG conversion completely f*cked up dst-src routes.
Stupidly enough, the correct thing is much simpler as seen by the amount
of deletes in this commit.

This does, unfortunately, involve a rather annoying YANG edge case with
what should reasonably be an optional leaf as part of a list key, which
is not possible.  It uses `::/0` as unconditional filler instead, since
that is semantically correct.

The `test_yang_mgmt` topotest needed to be adjusted after this to add
`src-prefix='::/0'`.

Fixes: 88fa5104a0 ("staticd : Configuration northbound implementation")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-01-28 15:40:17 +01:00
Yuqing Zhao 69a49c7359 staticd: Add CLI for SRv6 static SIDs
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
2025-01-18 10:28:49 +00:00
Yuqing Zhao 07ba1cd8b8 staticd: Add Northbound APIs for SRv6
Add Northbound APIs to create/modify/destroy an SRv6 SID

Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
2025-01-18 10:28:49 +00:00
Igor Ryzhov cb781f6097 staticd: fix NB dependency hack
Currently, staticd configuration is tightly coupled with VRF existence.
Because of that, it has to use a hack in NB infrastructure to create a
VRF configuration when at least one static route is configured for this
VRF. This hack is incompatible with mgmtd, because mgmtd doesn't execute
configuration callbacks. Because of that, the configuration may become
out of sync between mgmtd and staticd. There are two main cases:

1. Create static route in a VRF. The VRF data node will be created
   automatically in staticd by the NB hack, but not in mgmtd.
2. Delete VRF which has some static routes configured. The static route
   configuration will be deleted from staticd by the NB hack, but not
   from mgmtd.

To fix the problem, decouple configuration of static routes from VRF
configuration. Now it is possible to configure static routes even if the
VRF doesn't exist yet. Once the VRF is created, staticd applies all the
preconfigured routes.

This change also fixes the problem with static routes being preserved in
the system when staticd "control-plane-protocol" container is deleted
but the VRF is still configured.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-02 00:57:59 +02:00
Christian Hopps 83abe9c3cb ripd: ripd convert to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26 12:34:46 -05:00
Dmytro Shytyi b13b5f85f9 staticd: northbound srv6 hooks for segs stack yang model
Provive hooks for srv6 segs SIDs stack yang model.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-09-20 15:07:15 +02:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Rafael Zalamena 351ad68405 staticd: BFD integration northbound support
Implement all BFD integration northbound callbacks and integrate BFD
with `staticd` route installation procedure.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-01-13 15:32:12 -03:00
Christian Hopps deca28a33b tests: add grpc unit test
Test uses staticd which required some C++ header protections.
Additionally, the test also runs in the ubuntu20 docker container as
grpc is supported there by the packaging system.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-06 18:03:17 +00:00
Igor Ryzhov e1ea6b20df staticd: fix distance processing
When the user adds the route + nexthop pair that already exists with a
different distance, we should replace it instead of adding a new one.

Likewise, when the user wants to delete the route + nexthop pair without
explicitly entering the distance, we should delete the route.

Fixes #8695.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-25 15:50:54 +03:00
Christian Hopps 3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
Russ White 21a7815dc1
Merge pull request #7863 from chiragshah6/mdev
[yang,staticd]: remove when condition from static nexthop om
2021-01-19 07:48:28 -05:00
Chirag Shah 6dfc022ff2 staticd: handle when condition check in nb callbacks
At present, libyang validate api takes longer time to complete
for a transaction to complete if the same config is re-applied.
For instance if set of static routes are reapplied the config
completion takes longer than it took initial time.

One of the solution is to remove when statement from staticd nexthop yang OM.
When condition adds peformance toll on libyang's validate api.
The same when condition checks are done in frr northbound
validation phase (which are must faster).

With this change, if the same static routes are configured
agian and again, the time to completion does not go up and
perfomance does not degrade.

Ticket:CM-32530
Testing Done:

Configure 400 static routes across two vrfs and keep re-applying them.
The time to complete the config remains in few seconds.

Before:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg

real    0m19.877s
user    0m0.263s
sys 0m0.014s

After:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg

real    0m3.857s
user    0m0.239s
sys 0m0.034s

Co-developed-by: VishalDhingra <vdhingra@vmware.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-01-13 09:24:25 -08:00
vdhingra ef4b6b2230 staticd: Backend cofiguration code to fix table-id problem
problem: table-id gets overwritten for a given route.

RCA: table-id was getting overwritten from the NB layer,
     So route was getting installed with the latest table-id.

Fix: make the table-id as the key in the NB layer.
     This will program the route in zebra correctly.

- Removed the table-id modify callbacks.
- Moved the validate and apply table-id changes to path-list creation

issue #7347

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2021-01-12 07:55:16 -08:00
vdhingra d787163ced staticd: autogenerated code modifications due to yang changes
updated callback methods based on autogenerated code.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2021-01-09 23:55:33 -08:00
Sebastien Merle 065276ae1f staticd: add support for SR Policies
Configuration example:

    ip route 9.9.9.9/32 6.6.6.6 color 123

The SR Policy to be chosen is uniquely identified by the policy
endpoint (6.6.6.6) and the SR-TE color (123). Traffic will be
augmented with an MPLS label stack according to the active
candidate path of that particular policy.

Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-08-12 13:28:48 +02:00
vdhingra 314825ff91 staticd: Added afi-safi as a key in route-list
To address the ip mroute command there is a need to add
safi as a key. So adding the afi-safi-type identityref
as a key.

Signed-off-by: VishalDhingra <vdhingra@vmware.com>
2020-07-16 08:40:45 -07:00
vdhingra 88fa5104a0 staticd : Configuration northbound implementation
1. Modifies the data structs to make the distance, tag and table-id
   property of a route, i.e created a hireachical data struct to save
   route and nexthop information.
2. Backend northbound implementation

Signed-off-by: VishalDhingra <vdhingra@vmware.com>
2020-07-16 08:33:00 -07:00