]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Cache output routes in fib_info nexthops.
authorDavid S. Miller <davem@davemloft.net>
Tue, 17 Jul 2012 19:20:47 +0000 (12:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jul 2012 20:36:16 +0000 (13:36 -0700)
commit5c23bd9fd8defc8e370e030f9044fad6882626d2
treed68e90f5541302bfda64f044c5713e4f22aca599
parent3887ddd0669d8f8622c85f0662bc8ea07d5fbd5b
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>
include/net/ip_fib.h
net/ipv4/fib_semantics.c
net/ipv4/route.c