From: David Ahern <dsa@cumulusnetworks.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, dvyukov@google.com,
andreyknvl@google.com, mmanning@brocade.com, kafai@fb.com
Subject: Re: [PATCH v3 net] net: ipv6: regenerate host route if moved to gc list
Date: Mon, 24 Apr 2017 13:37:00 -0600 [thread overview]
Message-ID: <0ebdefd9-3f89-1876-ba03-1a8277ff79e2@cumulusnetworks.com> (raw)
In-Reply-To: <1493051946.6453.37.camel@edumazet-glaptop3.roam.corp.google.com>
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.
next prev parent reply other threads:[~2017-04-24 19:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 15:09 [PATCH v3 net] net: ipv6: regenerate host route if moved to gc list David Ahern
2017-04-24 16:39 ` Eric Dumazet
2017-04-24 19:37 ` David Ahern [this message]
2017-04-24 21:08 ` Martin KaFai Lau
2017-04-25 12:50 ` Andrey Konovalov
2017-04-25 15:54 ` David Ahern
2017-04-25 16:35 ` Andrey Konovalov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ebdefd9-3f89-1876-ba03-1a8277ff79e2@cumulusnetworks.com \
--to=dsa@cumulusnetworks.com \
--cc=andreyknvl@google.com \
--cc=dvyukov@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kafai@fb.com \
--cc=mmanning@brocade.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox