mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
ipv4: Cache output routes in fib_info nexthops.
If we have an output route that lacks nexthop exceptions, we can cache it in the FIB info nexthop. Such routes will have DST_HOST cleared because such routes refer to a family of destinations, rather than just one. The sequence of the handling of exceptions during route lookup is adjusted to make the logic work properly. Before we allocate the route, we lookup the exception. Then we know if we will cache this route or not, and therefore whether DST_HOST should be set on the allocated route. Then we use DST_HOST to key off whether we should store the resulting route, during rt_set_nexthop(), in the FIB nexthop cache. With help from Eric Dumazet. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ceb3320610
commit
f2bb4bedf3
3 changed files with 100 additions and 42 deletions
|
@ -46,6 +46,7 @@ struct fib_config {
|
|||
};
|
||||
|
||||
struct fib_info;
|
||||
struct rtable;
|
||||
|
||||
struct fib_nh_exception {
|
||||
struct fib_nh_exception __rcu *fnhe_next;
|
||||
|
@ -80,6 +81,7 @@ struct fib_nh {
|
|||
__be32 nh_gw;
|
||||
__be32 nh_saddr;
|
||||
int nh_saddr_genid;
|
||||
struct rtable *nh_rth_output;
|
||||
struct fnhe_hash_bucket *nh_exceptions;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue