ipv6: Avoid restarting fib6_lookup() for RTF_CACHE hit
Subsystems (3)
cover ipv6: Avoid restarting fib6_lookup() for RTF_CACHE hit
I am trying to understand why there is a need to restart fib6_lookup() after getting rt with RTF_CACHE.
I have adapted the davem's udpflood test
(https://git.kernel.org/pub/scm/linux/kernel/git/davem/net_test_tools.git) to support IPv6 and here is the result:
#root > time ./udpflood -l 20000000 -c 250 2401:db00:face:face::2
Before:
real 0m33.224s user 0m2.941s sys 0m30.232s
After:
real 0m31.517s user 0m2.938s sys 0m28.536s
RFC PATCH 2/2 ipv6: Avoid restarting fib6_lookup() for RTF_CACHE hit case
When there is a RTF_CACHE hit, no need to redo fib6_lookup() with reachable=0.
--- net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/route.c +2 -1
@@ -937,7 +937,7 @@ restart: rt =rt6_multipath_select (rt, fl6, oif, strict | reachable);BACKTRACK (net, &fl6->saddr);if (rt->rt6i_flags &RTF_CACHE ) - goto out; + goto out1;dst_hold (&rt->dst);read_unlock_bh (&table->tb6_lock);
@@ -974,6 +974,7 @@ out: reachable =0 ; goto restart_2; } +out1:dst_hold (&rt->dst);read_unlock_bh (&table->tb6_lock); out2:
Signature · 1 line
1.8.1
RFC PATCH 1/2 ipv6: Remove the net->ipv6.ip6_null_entry check
In reply to Martin KaFai LauThe above BACKTRACK have already caught the rt == net->ipv6.ip6_null_entry case
--- net/ipv6/route.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/route.c +1 -2
@@ -936,8 +936,7 @@ restart:if (rt->rt6i_nsiblings) rt =rt6_multipath_select (rt, fl6, oif, strict | reachable);BACKTRACK (net, &fl6->saddr); -if (rt == net->ipv6.ip6_null_entry || - rt->rt6i_flags &RTF_CACHE ) +if (rt->rt6i_flags &RTF_CACHE ) goto out;dst_hold (&rt->dst);
Signature · 1 line
1.8.1
David Miller
maintainerFrom: Martin KaFai Lau <[email protected]>
Date: Fri, 3 Oct 2014 15:12:10 -0700
Quoted 10 lines
I am trying to understand why there is a need to restart
fib6_lookup()after getting rt withRTF_CACHE.I have adapted the davem's udpflood test
(https://git.kernel.org/pub/scm/linux/kernel/git/davem/net_test_tools.git) to support IPv6 and here is the result:#root > time ./udpflood -l 20000000 -c 250 2401:db00:face:face::2
Before:
Quoted 8 lines
real 0m33.224s user 0m2.941s sys 0m30.232sAfter:
real 0m31.517s user 0m2.938s sys 0m28.536s
If you are serious about seeing these patches integrated, you must freshly repost this series and provide a proper "Signed-off-by: " tag for yourself in the commit messages.