Commit Graph

173 Commits

Author SHA1 Message Date
Mark Stapp
5047884528 *: unify thread/event cancel macros
Replace all lib/thread cancel macros, use thread_cancel()
everywhere. Only the THREAD_OFF macro and thread_cancel() api are
supported. Also adjust thread_cancel_async() to NULL caller's pointer (if
present).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 12:16:52 -04:00
Donatas Abraitis
2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Donald Sharp
99e5d4af38 isisd: circuit->area->isis to circuit->isis
The code in isisd uses `circuit->area->isis` all the time
but we know that circuit now has a valid `circuit->isis` pointer
so let's use that and cleanup the long dereference.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-09 08:18:21 -04:00
Renato Westphal
98a496368a isisd: introduce two LSP iteration functions
Iterating over all IP or IS reachability information from a given
LSP isn't a trivial task. That information is scattered throughout
different TLV types, and which ones need to be used depend on
multiple variables (e.g. the SPF tree address family, MT-ID,
etc). This not to mention that an LSP might consist of multiple
fragments.

Introduce the following two LSP iteration function to facilitate
obtaining IP/IS reachability information from a given LSP:
* isis_lsp_iterate_ip_reach()
* isis_lsp_iterate_is_reach()

These functions will be used extensively by the upcoming TI-LFA
code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26 20:16:19 -03:00
Kaushik
eab88f3655 isisd : Transformational changes to support different VRFs.
1. Created a structure "isis master".
2. All the changes are related to handle ISIS with different vrf.
3. A new variable added in structure "isis" to store the vrf name.
4. The display commands for isis is changed to support different VRFs.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-08-14 13:46:22 -07:00
Renato Westphal
d607c409b8 isisd: don't attach Adj-SIDs to pseudo-node LSPs
No need to do this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-11 01:00:56 -03:00
David Lamparter
6cde4b4552 *: remove PRI[udx](8|16|32)
These are completely pointless and break coccinelle string replacements.

Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'`
```

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14 10:43:40 +02:00
David Lamparter
3efd0893d0 *: un-split strings across lines
Remove mid-string line breaks, cf. workflow doc:

  .. [#tool_style_conflicts] For example, lines over 80 characters are allowed
     for text strings to make it possible to search the code for them: please
     see `Linux kernel style (breaking long lines and strings)
     <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_
     and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_.

Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'`
```

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14 10:37:25 +02:00
GalaxyGorilla
690497fb10 isisd: Fast RIB recovery from BFD recognized link failures
Unfortunately as the topotests show a fast recovery after failure
detection due to BFD is currently not possible because of the following
issue:

There are multiple scheduling mechanisms within isisd to prevent
overload situations. Regarding our problem these two are important:

* scheduler for regenerating ISIS Link State PDUs scheduler for managing
* consecutive SPF calculations

In fact both schedulers are coupled, the first one triggers the second
one, which again is triggered by isis_adj_state_change (which again is
triggered by a BFD 'down' message). The re-calculation of SPF paths
finally triggers updates in zebra for the RIB.

Both schedulers work as a throttle, e.g. they allow the regeneration of
Link State PDUs or a re-calculation for SPF paths only once within a
certain time interval which is configurable (and by default different!).

This means that a request can go through the first scheduler but might
still be 'stuck' at the second one for a while. Or a request can be
'stuck' at the first scheduler even though the second one is ready. This
also explains the 'random' behaviour one can observe testing since a
'fast' recovery is only possible if both schedulers are ready to process
this request.

Note that the solution in this commit is 'thread safe' in the sense that
both schedulers use the same thread master such that the introduced
flags are only used exactly one time (and one after another) for a
'fast' execution.

Further there are some irritating comments and logs which I partially
removed. They seems to be not valid anymore due to changes in thread
management (or they were never valid in the first place).

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-07-03 08:46:17 +00:00
Donald Sharp
b6eaf9065b
Merge pull request #6619 from Niral-Networks/niral_isis_debug_p2
ISIS VRF: ISIS Debug structure modifications Type 2
2020-06-25 09:07:42 -04:00
harios
e740f9c159 ISIS VRF: ISIS Debug structure modifications
1. The "isis->debug" variable dependency on debug logs print is removed.

Signed-off-by: harios <hari@niralnetworks.com>
2020-06-24 14:45:06 +05:30
Olivier Dugeon
d839131273 isisd: Add Segment Routing Local Block support
Segment Routing Local Block (SRLB) is part of RFC8667. This change introduces
the possibility for isisd to advertize SRLB in LSP. Base and Range of SRLB
could be configured through CLI or Yang.

Adjacency-SID are now using this SRLB for label allocation. SRLB could also
be used for SID-Binding (e.g. LDP to SR).

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-06-23 16:36:56 +02:00
Renato Westphal
26f6acafc3 isisd: add support for segment routing
This is an implementation of the IS-IS SR draft [1] for FRR.

The following features are supported:
* IPv4 and IPv6 Prefix-SIDs;
* IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs;
* Index and absolute labels;
* The no-php and explicit-null Prefix-SID flags;
* Full integration with the Label Manager.

Known limitations:
* No support for Anycast-SIDs;
* No support for the SID/Label Binding TLV (required for LDP interop).
* No support for persistent Adj-SIDs;
* No support for multiple SRGBs.

[1] draft-ietf-isis-segment-routing-extensions-25

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-30 12:15:47 +02:00
Quentin Young
4ced1a2cb3 bgpd, isis, tools: style fixen
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:15:35 -04:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20 19:14:33 -04:00
Renato Westphal
2a1c520e9f isisd: split northbound callbacks into multiple files
Rearrange the isisd northbound callbacks as following:
* isis_nb.h: prototypes of all northbound callbacks.
* isis_nb.c: definition of all northbound callbacks and their
  associated YANG data paths.
* isis_nb_config.c: implementation of YANG configuration nodes.
* isis_nb_state.c: implementation of YANG state nodes.
* isis_nb_notifications.c: implementation of YANG notifications.

This should help to keep to code more organized and easier to
maintain.

No behavior changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-10-29 21:49:14 -03:00
Olivier Dugeon
1b3f47d04c isisd: Update TLVs processing for TE, RI & SR
In preparation to Segment Routing:
 - Update the management of Traffic Engineering subTLVs to the new tlvs parser
 - Add Router Capability TLV 242 as per RFC 4971 & 7981
 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25

Modified files:
 - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs
 - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process
   TE subTLVs, Router Capability TLV and SR subTLVs
 - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing
 - isis_te.[c,h]: remove all old TE structures and managment functions,
   and add hook call to set local and remote IP addresses as wellas update TE
   parameters
 - isis_zebra.[c,h]: add hook call when new interface is up
 - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs
 - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-09-17 17:35:50 +02:00
Renato Westphal
81fddbe7ae *: rename new ForEach macros from the typesafe API
This is necessary to avoid a name collision with std::for_each
from C++.

Fixes the compilation of the gRPC northbound module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-21 15:59:08 -03:00
Lou Berger
31e944a8a7
Merge pull request #3045 from opensourcerouting/atoms
READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
2019-04-30 10:26:35 -04:00
David Lamparter
4bef0ec4fb isisd: replace dict_* with DECLARE_RBTREE
Historically, isisd has been carrying around its own red-black tree to
manage its LSP DB in.  This replaces that with the newly-added
DECLARE_RBTREE_*.  This allows completely removing the dict_* code.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-27 19:33:45 +02:00
Olivier Dugeon
2e2a8b9136 isisd: Add IS-IS-TE support per Area
Solve issue #4032

 - Change MPLS-TE from global to per Area
 - Add new mpls_te_area structure to area in replacement of global variable
isisMPLS_TE
 - Move mpls-te from global to instance in frr-isisd.yang
 - Change code in isis_te.c, isis_northbound.c, isis_cli.c, isis_pdu.c,
isis_lsp.c and isis_zebra.c accordingly

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-04-25 18:59:26 +02:00
Russ White
231e94e32a
Revert "isisd: Add IS-IS-TE support per Area" 2019-04-23 09:24:18 -04:00
Olivier Dugeon
9c95fe6986 Issue #4032: Add IS-IS-TE support per Area
- Change MPLS-TE from global to per Area
 - Add new mpls_te_area structure to area in replacement of global variable
isisMPLS_TE
 - Move mpls-te frmo global to instance in frr-isisd.yang
 - Change code in isis_te.c, isis_northbound.c, isis_cli.c, isis_pdu.c,
isis_lsp.c and isis_zebra.c accordingly

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-04-15 16:22:38 +02:00
David Lamparter
0c77e17821 isisd: skip over deleted fragments
Since LSP fragments are also on our lspdb dict, lsp_tick() needs to skip
over them after calling lsp_destroy().  Otherwise it ends up accessing
free'd memory.

Fixes: #3533
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-18 23:04:21 +01:00
Emanuele Di Pascale
998011fa8b isisd: implement the 'lsp-generation' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
b21b068dc9 isisd: implement the 'attempt-to-exceed-max-sequence' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Christian Franke
6f004b60ed isisd: Provide statistics over number of generated purges
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
062f4d3691 isisd: Provide statistics over number of LSP regenerations
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
1eb7c3a195 fabricd: Add show openfabric flooding command
Add a command to show to what neighbors an LSP has been flooded.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
0d6fb551c1 isisd: Make lspid_print non-static
`lspid_print` is useful in other places, so make it available
in `isis_lsp.h`.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
ddb33326ff isisd: Provide better flooding debugging
Show from where LSP flooding is triggered.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
16c2ab97f9 isisd: Always consider purges as newer
When receiving an LSP with same sequence number but different
checksum as in the local database, we would always treat it as
newer than the local LSP.

That behavior is incorrect if the local LSP is indeed a purged
LSP waiting for age-out and the received one is not.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-15 15:06:40 +01:00
Olivier Dugeon
510ccb8d36
Merge pull request #3303 from opensourcerouting/bugfix/isis-fragment-retransmission
isisd: Fix issues with purged fragments
2018-11-12 17:59:50 +01:00
Donald Sharp
226e1b7b1e
Merge pull request #3305 from opensourcerouting/bugfix/isis-lsp-aggregate-time
isisd: Adjust duration until lsp is regenerated
2018-11-12 09:27:34 -05:00
Donald Sharp
059cce897a
Merge pull request #3304 from opensourcerouting/bugfix/openfabric-flooding
fabricd: never flood back through the incoming interface
2018-11-12 09:20:27 -05:00
Christian Franke
8f27aa2729 isisd: Fix issues with purged fragments
Purged fragments would always be reoriginated by isisd. They
should only be purged once and never be reoriginated.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-10 18:04:43 +01:00
Christian Franke
37212c410d fabricd: never flood back through the incoming interface
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-10 18:03:04 +01:00
Christian Franke
9337256ebf isisd: Fix lsp_build_list_nonzero_ht
When `first` would be initialized to the same value as `last`, the
function would return incorrect results.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-10 18:00:57 +01:00
Christian Franke
01c3745f56 isisd: Adjust duration until lsp is regenerated
It turns out 50ms is actually too short to aggregate all changes
in some cases, so allow for 100ms.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-09 17:14:13 +01:00
Christian Franke
f93025e1a6 isisd: delay lsp regeneration while events are still coming in
When there is a stream of events coming in, where IS-IS learns
about a lot of updates, IS-IS would regenerate its LSPs before
the updates have been processed completely.

This causes suboptimal convergence because the intermediate state
will be flooded. Only after the configured `lsp_gen_interval`, a
new update with the correct and final state will be generated.

Resolve this by holding off LSP generation while there are still
events coming in.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-24 07:53:23 +02:00
Christian Franke
9196731f9d isisd: Combine lsp_l1/l2_refresh
lsp_l1_refresh and lsp_l2_refresh are identical apart from the
hardcoded IS-IS level they are referring to. So merge them and
pass the level as part of the argument.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-24 07:52:44 +02:00
Christian Franke
691f3e768a isisd: Log LSP-update trigger source
For debugging the timing of LSP generation, it is useful to know
which event caused a regeneration to be scheduled. Therefore, add
this information to the debug log.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-24 07:51:50 +02:00
Christian Franke
d07067ba45 isisd: adjust lsp size to area->lsp_size before packing
IS-IS would ignore any area lsp-mtu setting configured after initial
creation of the LSP since move to the new tlv serialized/deserializer.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-16 19:35:54 +02:00
Christian Franke
dc84cf1494 isisd: Unlink LSP fragments from LSP0 on lsp_destroy
isisd would crash when lsp fragments aged out, since they got freed
correctly, but were not removed from LSP0's linked list of fragments.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-16 19:35:54 +02:00
Christian Franke
a5b5e946ce isisd: Replace isis_event_adjacency_state_change with a hook
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05 14:05:28 +02:00
F. Aragon
7968405d87
isisd: null check (Coverity 1424529)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-10-03 16:38:49 +02:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
F. Aragon
f2fcf867f5
isisd: null check (Coverity 1473285)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-20 15:39:00 +02:00
Quentin Young
1c50c1c0d6 *: style for EC replacements
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:38:57 +00:00
Quentin Young
450971aa99 *: LIB_[ERR|WARN] -> EC_LIB
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:34:28 +00:00