[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <daac77afd98bd9c10c4c52309067b8dfbba3fad0.camel@redhat.com>
Date: Mon, 22 Jun 2020 12:13:03 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Brian Vazquez <brianvv@...gle.com>,
Brian Vazquez <brianvv.kernel@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Luigi Rizzo <lrizzo@...gle.com>
Subject: Re: [PATCH net-next 2/2] ipv6: fib6: avoid indirect calls from
fib6_rule_lookup
Hi,
On Fri, 2020-06-19 at 20:14 -0700, Brian Vazquez wrote:
> @@ -111,11 +111,13 @@ struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6,
> } else {
> struct rt6_info *rt;
>
> - rt = lookup(net, net->ipv6.fib6_local_tbl, fl6, skb, flags);
> + rt = pol_lookup_func(lookup,
> + net, net->ipv6.fib6_local_tbl, fl6, skb, flags);
> if (rt != net->ipv6.ip6_null_entry && rt->dst.error != -EAGAIN)
> return &rt->dst;
> ip6_rt_put_flags(rt, flags);
> - rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags);
> + rt = pol_lookup_func(lookup,
> + net, net->ipv6.fib6_main_tbl, fl6, skb, flags);
> if (rt->dst.error != -EAGAIN)
> return &rt->dst;
> ip6_rt_put_flags(rt, flags);
Have you considered instead factoring out the slice of
fib6_rule_lookup() using indirect calls to an header file? it looks
like here (gcc 10.1.1) it sufficent let the compiler use direct calls
and will avoid the additional branches.
Thanks!
Paolo
Powered by blists - more mailing lists