18 Jul 2012 20:24
[PATCH 09/15] ipv4: Cache output routes in fib_info nexthops.
David Miller <davem <at> davemloft.net>
2012-07-18 18:24:04 GMT
2012-07-18 18:24:04 GMT
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. To counter adding a new argument to rt_set_nexthop() I'm removing the 'fl4' arg to rt_set_nexthop() and rt_init_metrics(), which is no longer used. Signed-off-by: David S. Miller <davem <at> davemloft.net> --- include/net/ip_fib.h | 2 + net/ipv4/fib_semantics.c | 2 + net/ipv4/route.c | 109 ++++++++++++++++++++++++++++++++-------------- 3 files changed, 80 insertions(+), 33 deletions(-) diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h(Continue reading)
RSS Feed