| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
excessive types into scope.
ok claudio
|
|
|
|
| |
ok denis@, jmatthew@
|
|
|
|
|
|
|
| |
Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@
OK deraadt@
|
|
|
|
|
|
| |
netstat(1) inspection of routing tables.
From Naoki Fukaumi, ok yasuoka@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an ART node is linked to multiple route entries, in the MPATH case,
it is not safe to dereference ``an_dst''. This non-refcounted pointer
can be changed at any time by another CPU.
So get rid of the pointer and use the first destination of a route entry
when comparing sockaddrs.
This allows us so remove a pointer from 'struct art_node' and save 5Mb of
memory in an IPv4 fullfeed.
ok jmatthew@, claudio@, dlg@
|
|
|
|
|
| |
in the functions. This way it can be used for other trees as well.
OK mpi@ phessler@
|
|
|
|
|
|
| |
taking the kernel lock.
ok mpi@ dlg@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
art_lookup and art_match now return an active srp_ref, which the caller must
leave when it's done with the returned route (if any). This allows lookups
to be done without holding any locks.
The art_table and art_node garbage collectors are still responsible for
freeing items removed from the routing table, so they now use srp_finalize
to wait out any active references, and updates are done using srp_swap
operations.
ok dlg@ mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this will allow us to sleep in srp_finalize before freeing the
memory.
the defer is done by putting the tables and nodes on a list which
is serviced by a task. the task removes all the entries from the
list and pool_puts them.
the art_tables gc code uses at_parent as its list entry, and the
art_node gc code uses a union with the an_dst pointer. both at_parent
and an_dst are only used when theyre active as part of an art data
structure, and are not used in lookups. once the art is done with
them we can reuse these pointers safely.
ok mpi@
|
|
|
|
| |
ok jmatthew@
|
|
|
|
| |
Reported by and ok jmatthew@
|
|
|
|
| |
offset of the address in the sockaddr to initialize the stride lengths.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
allocator for the 4K heap.
In this configuration a fullfeed BGP server for v4 and v6 consumes
10M more than with the radix tree.
This double the depth of the tree and makes the lookup slower. But
the ratio speed/memory can be adjusted in the future, for now we are
interested in a lock-free route lookup.
Tested by and ok benno@
|
|
|
|
|
|
| |
fallback to a SLIST.
ok dlg@, jasper@
|
|
|
|
|
|
|
|
|
|
|
|
| |
to a SRP list.
This turns the rtable_* layer mpsafe. We now only need to protect the
ART implementation itself.
Note that route(8) regress tests will now fail due to a supplementary
reference taken by the SRPL_INIT(9) API.
ok dlg@
|
|
|
|
| |
While here initialize pools in art_init().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
turning rtable_get(9) MP-safe.
Use only one per-AF array, as suggested by claudio@, pointing to an
array of pointers to the routing table heads.
Routing tables are now allocated/initialized per-AF. This will let
us allocate routing table on-demand instead of always having an
AF_INET, AF_MPLS and AF_INET table as soon as a new rtableID is used.
This also get rid of the "void ***" madness.
ok dlg@, jmatthew@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The routing table is not an optional component of the network stack
and initializing it inside the "routing domain" requires some ugly
introspection in the domain interface.
This put the rtable* layer at the same level of the if* level. These
two subsystem are organized around the two global data structure used
in the network stack:
- the global &ifnet list, to be used in process context only, and
- the routing table which can be read in interrupt context.
This change makes the rtable_* layer domain-aware and extends the
"struct domain" such that INET, INET6 and MPLS can specify the length
of the binary key used in lookups. This allows us to keep, or move
towards, AF-free route and rtable layers.
While here stop the madness and pass the size of the maximum key length
in *byte* to rn_inithead0().
ok claudio@, mikeb@
|
|
|
|
|
|
|
|
|
|
| |
Keep route entry/BSD compatibility goos in the rtable layer. The way
addresses and masks (prefix-lengths) are encoded is really tied to the
radix-tree implementation.
Since we decided to no longer support non-contiguous masks, we could get
rid of some extra "sockaddr" allocations and reduce the memory grows
related to the use of a multibit-trie.
|
|
ART implementation.
ART (Allotment Routing Table) is a multibit-trie algorithm invented by
D. Knuth while reviewing Yoichi's SMART [0] (Smart Multi-Array Routing
Table) paper.
This implementation, unlike the one from the KAME project, supports
variable stride lengths which makes it easier to adapt the consumed
memory/speed trade-off. It also let you use a bigger first-level
table, what other algorithms such as POPTRIE [1] need to implement
separately.
Adaptation to the OpenBSD kernel has been done with two different data
structures. ART nodes and route entries are managed separately which
makes the algorithm implementation free of any MULTIPATH logic.
This implementation does not include Path Compression.
[0] http://www.hariguchi.org/art/smart.pdf
[1] http://conferences.sigcomm.org/sigcomm/2015/pdf/papers/p57.pdf
ok dlg@, reyk@
|