| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
ok gnezdo@ semarie@ mpi@
|
|
|
|
| |
ok kn@
|
|
|
|
|
|
|
| |
pf table code iterates on a radix tree and currently relies on the
NET_LOCK() to do the serialization.
Found the hardway by jasper@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
different trees are manipulated:
- Stop writting to global variables
- Use a buffer on the stack
- Anotate read/only arrays as such
While here introduce a SALEN() macro and assert that the KERNEL_LOCK()
is held when a tree is modified.
ok bluhm@
|
|
|
|
| |
rectification.
|
|
|
|
|
|
| |
This code insn't used since ART is the default.
ok vgross@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
| |
ok claudio@ mpi@
|
|
|
|
|
|
|
| |
In such kernels multipath routing support is independant from the data
structure used to perform the binary lookup. Is is implemented as a
singly-listed list of route entries. This is possible because a "struct
rtentry" is no longer mapped 1:1 to a node in the tree.
|
|
|
|
| |
Needed by the regression tests.
|
|
|
|
|
|
| |
is no point in keeping an unused level of abstraction.
ok mikeb@, claudio@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
length of the key as argument.
This way every consumer of the radix tree has a chance to explicitly
initialize the shared data structures and no longer rely on another
subsystem to do the initialization.
As a bonus ``dom_maxrtkey'' is no longer used an die.
ART kernels should now be fully usable because pf(4) and IPSEC properly
initialized the radix tree.
ok chris@, reyk@
|
|
|
|
|
|
|
| |
As a side effect there's no need to run if_attachdomain() after the
list of domains has been built.
ok claudio@, reyk@
|
|
|
|
|
|
| |
to never return the internal RNF_ROOT nodes. This removes the checks
in the callee to verify that not an RNF_ROOT node was returned.
OK mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The limit between the radix layer and the route layer is somewhat
vague, if it exists at all. This changes prevent rtrequest1(9) to
find and delete the root node (RNF_ROOT) when trying to delete a
non-existing default route:
# route delete 0.0.0.0
delete host 0.0.0.0
# route delete 0.0.0.0
route: writing to routing socket: No such process
delete host 0.0.0.0: not in table
Historically rn_delete() was a no-op when called with an internal
node as argument. But there's no reason to manipulate such node.
In a better world rn_match() would contain such check, but let's
change the perfect-match function for the moment as this fixes a
bug and many dragons are lurking in there.
Fix a regression introduced by the big refactoring of r1.40 and
reported by tobias@.
ok tobias@, claudio@, pelikan@
|
|
|
|
|
|
|
| |
to the multipath chain when removing routes. This fixes the sbin/route
testcases 17-19 and fixes an annoying opsfd bug because of routes
wrongly marked as multipath ones.
OK deraadt, mpi, sthen, benno, phessler
|
| |
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
| |
Fix a panic when trying to remove a route with the magical 0.0.0.0
destination.
looks ok to claudio@
|
|
|
|
|
|
|
|
| |
of rn_delete was changed). The mpath code gets a much better
rn_mpath_next() function that allows looping through the dupedkey list
based on prio, any or only active routes. This solves the issues seen
with failed deletes of down routes.
Commit this now so that it gets tested. Both sthen@ and blambert@ agree.
|
|
|
|
| |
OK mpi@ and krw@
|
|
|
|
|
|
|
|
|
| |
cases x is just used as a temp variable. Main offender is rn_addmask()
which sets x once at the top uses it then late in the function and then
starts reuing it for various other stuff. While there fix some for loops
to while ones and fix one strange do { } while() loop.
And since rn_search() can not return NULL remove one extra check.
OK mpi@
|
|
|
|
|
|
|
|
| |
Also remove a memset that is already happeing because we use PR_ZERO on
the allocation. Move two memmove to memcpy because the addrs can not
overlap. Make some simple helper functions static __inline and remove one
of the explicit rn_search inlines.
OK mpi@
|
|
|
|
| |
radix_mask pool. With input and OK mikeb@ and henning@
|
|
|
|
| |
since ages so remove the bits used for userland compiles. OK mikeb@
|
|
|
|
|
| |
sprinkle 0 -> NULL where obvious
ok millert mpi
|
| |
|
|
|
|
|
| |
hand-rolled loop was converted to memcmp(). From Kieran Devlin.
OK markus@
|
|
|
|
| |
return the number of active aka RTF_UP multipath routes. OK grep & gcc
|
|
|
|
|
|
| |
exporting them to the outside world via radix.h.
ok claudio@ sthen@ henning@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For masks of identical length rn_lexobetter() did not stop on the
first non-equal byte. This leads rn_addroute() to not detecting
duplicate entries and thus we might create a very long list of masks
to check for each node.
This can have a huge impact on IPsec performance, where non-contiguous
masks are used for the flow lookup. In a setup with 1300 flows we
saw 400 duplicate masks and only a third of the expected throughput.
Lots of help in narrowing this down from markus@.
Improved comments from claudio@.
OK markus@, claudio@
|
|
|
|
|
|
|
| |
rt_if_remove_rtdelete() need to know the table id to be able to correctly
remove nodes.
Problem found by Andrea Parazzini and analyzed by Martin Pelikán.
OK henning@
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now RNF_NORMAL masks did not use the refcount because only one route
in a particular subtree could have this mask. With multipath routing this is
no longer correct. The result was wrong backtracking information beeing stored
in the radix tree and so cretain lookups ended up on the wrong multipath nodes.
Use rm_refs for RNF_NORMAL masks so that all multipath routes are able
to point to the same radix_mask entry. Additional logic ensures that rm_leaf
always points back to the head of the multipath rn_dupedkey chain.
Tested by dlg@, gollo@, david@, sthen@ and a few more
This can have my OK dlg@
|
|
|
|
|
|
| |
when xx can do the trick or in dlg's words: "xx was a copy of x so they
could use x for some temp working and restore it from xx later? yeesh"
ok dlg@
|
|
|
|
|
|
|
| |
not only over routes of the same prio. This makes it possible to modify
rt_mpath_matchgate() so that if only gateway is specified without a specific
priority it will scan the full list and not only the first routes.
This is also needed for upcoming link state tracking.
|
|
|
|
| |
specific routes. OK henning@
|
|
|
|
|
|
|
|
|
| |
and the one route with the lowest number wins. This will be used by the
routing daemons to resolve the synchronisations issue in case of conflicts.
The nasty bits of this are in the multipath code. If no priority is specified
the kernel will choose an appropriate priority.
Looked at by a few people at n2k8 code is much older
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To minimise path disruptions, this implements recommendations made in RFC2992 -
the hash-threshold mechanism to select paths based on source/destination IP
address pairs, and inserts multipath routes in the middle of the route table.
To enable multipath distribution, use:
sysctl net.inet.ip.multipath=1
and/or:
sysctl net.inet6.ip6.multipath=1
testing norby@
ok claudio@ henning@ hshoexer@
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
user visible changes:
- you can add multiple routes with same key (route add A B then route add A C)
- you have to specify gateway address if there are multiple entries on the table
(route delete A B, instead of route delete A)
kernel change:
- radix_node_head has an extra entry
- rnh_deladdr takes extra argument
TODO:
- actually take advantage of multipath (rtalloc -> rtalloc_mpath)
|
|
|
|
| |
ok itojun@
|
| |
|
| |
|
|
|
|
|
|
| |
from itojun@netbsd rev 1.15
ok deraadt@
|
| |
|
|
|
|
|
|
|
| |
makes routing lookups slightly more expensive, and serves no useful
purpose.
ok itojun@ tedu@
|