[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPA1RqB14m4BERjrOO5Fryu2WAU9iwqAbC8H7Sb_bNUi9jfLAg@mail.gmail.com>
Date: Sat, 7 Oct 2017 08:57:49 +0900
From: 吉藤英明 <hideaki.yoshifuji@...aclelinux.com>
To: Wei Wang <weiwan@...gle.com>
Cc: David Miller <davem@...emloft.net>,
network dev <netdev@...r.kernel.org>,
Eric Dumazet <edumazet@...gle.com>,
Martin KaFai Lau <kafai@...com>,
吉藤英明 <hideaki.yoshifuji@...aclelinux.com>,
YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Subject: Re: [PATCH net-next 11/16] ipv6: replace dst_hold() with
dst_hold_safe() in routing code
Hi,
2017-10-07 4:06 GMT+09:00 Wei Wang <weiwan@...gle.com>:
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 941c062389d2..aeb349aea429 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
:
> @@ -1625,12 +1643,17 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
> if (rt_cache)
> rt = rt_cache;
>
> - if (rt == net->ipv6.ip6_null_entry || (rt->rt6i_flags & RTF_CACHE)) {
> - dst_use(&rt->dst, jiffies);
> + if (rt == net->ipv6.ip6_null_entry) {
> + read_unlock_bh(&table->tb6_lock);
> + dst_hold(&rt->dst);
> + trace_fib6_table_lookup(net, rt, table->tb6_id, fl6);
> + return rt;
> + } else if (rt->rt6i_flags & RTF_CACHE) {
> + if (ip6_hold_safe(net, &rt, true)) {
> + dst_use_noref(&rt->dst, jiffies);
> + rt6_dst_from_metrics_check(rt);
> + }
> read_unlock_bh(&table->tb6_lock);
> -
> - rt6_dst_from_metrics_check(rt);
> -
> trace_fib6_table_lookup(net, rt, table->tb6_id, fl6);
> return rt;
> } else if (unlikely((fl6->flowi6_flags & FLOWI_FLAG_KNOWN_NH) &&
Is it intended to move rt6_dst_from_metrics_check() inside the table lock?
--yoshfuji
Powered by blists - more mailing lists