[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ebdefd9-3f89-1876-ba03-1a8277ff79e2@cumulusnetworks.com>
Date: Mon, 24 Apr 2017 13:37:00 -0600
From: David Ahern <dsa@...ulusnetworks.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, dvyukov@...gle.com, andreyknvl@...gle.com,
mmanning@...cade.com, kafai@...com
Subject: Re: [PATCH v3 net] net: ipv6: regenerate host route if moved to gc
list
On 4/24/17 10:39 AM, Eric Dumazet wrote:
>
> Very nice changelog !
Thanks. Given my aggressive brain cell recycling program, I needed to
write down the analysis.
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> index 80ce478c4851..93f81d9cd85f 100644
>> --- a/net/ipv6/addrconf.c
>> +++ b/net/ipv6/addrconf.c
>> @@ -3271,14 +3271,25 @@ static void addrconf_gre_config(struct net_device *dev)
>> static int fixup_permanent_addr(struct inet6_dev *idev,
>> struct inet6_ifaddr *ifp)
>> {
>> - if (!ifp->rt) {
>> - struct rt6_info *rt;
>> + /* rt6i_ref == 0 means the host route was removed from the
>> + * FIB, for example, if 'lo' device is taken down. In that
>> + * case regenerate the host route.
>> + */
>> + if (!ifp->rt || !atomic_read(&ifp->rt->rt6i_ref)) {
>> + struct rt6_info *rt, *prev;
>>
>> rt = addrconf_dst_alloc(idev, &ifp->addr, false);
>> if (unlikely(IS_ERR(rt)))
>> return PTR_ERR(rt);
>>
>> + prev = ifp->rt;
>
> I would feel more comfortable if this was moved after the spin_lock() ?
That's what I had in v2; it reads better to me even if it is not
technically required (all changes to ifp->rt happen under rtnl).
Martin you agree?
I'll send a v3 tomorrow -- allow more time for other comments.
Powered by blists - more mailing lists