netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Wei Wang <weiwan@google.com>, Eric Dumazet <edumazet@google.com>,
	Martin KaFai Lau <kafai@fb.com>, Xin Long <lucien.xin@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: Re: [PATCH net-next 3/3] ipv6: obsolete cached dst when removing them from fib tree
Date: Wed, 18 Oct 2017 15:03:02 +0200	[thread overview]
Message-ID: <1508331782.2559.5.camel@redhat.com> (raw)
In-Reply-To: <CAEA6p_AS9c6pOym4t6FGW-bWfU=YmmL96Fc4vMcnDMCc8ywVqg@mail.gmail.com>

On Tue, 2017-10-17 at 13:48 -0700, Wei Wang wrote:
> On Tue, Oct 17, 2017 at 1:02 PM, Paolo Abeni <pabeni@redhat.com> wrote:
> > Meanwhile others sockets may grab more references to (and use) the same
> > aged-out dst.
> > 
> 
> I don't think other sockets could grab more reference to this dst
> because this dst should already be removed from the fib6 tree.

With the current net-next code, the dst is not removed from the fib
tree while someone else is holding it and dst_check() does not fail
after that the cached dst is aged out. If a socket cache grab a
reference to the CACHE dst, it will not release it untill the next
sernum change, regardless of the dst aging.

> > The commit 1e2ea8ad37be ("ipv6: set dst.obsolete when a cached route
> > has expired") was the solution to the above issue prior to the recent
> > refactor.
> > 
> 
> I don't really understand how this commit is solving the above issue.
> This commit still only ages out cached route if &rt->dst.__refcnt ==
> 1. So if socket is holding refcnt to this dst and dst_check() is not
> getting called,  this cached route still won't get deleted.

Setting obsolete to DST_OBSOLETE_KILL forced whoever was holding the
dst reference to drop it on the next dst_check(), so that refcnt could
go down. 

Cheers,

Paolo

  reply	other threads:[~2017-10-18 13:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 17:40 [PATCH net-next 0/3] ipv6: fixes for RTF_CACHE entries Paolo Abeni
2017-10-17 17:40 ` [PATCH net-next 1/3] ipv6: fix route cache dump Paolo Abeni
2017-10-17 18:26   ` Wei Wang
2017-10-17 18:41     ` Eric Dumazet
2017-10-17 19:35       ` Paolo Abeni
2017-10-17 17:40 ` [PATCH net-next 2/3] ipv6: start fib6 gc on RTF_CACHE dst creation Paolo Abeni
2017-10-17 18:35   ` Wei Wang
2017-10-17 21:53     ` Martin KaFai Lau
2017-10-17 17:40 ` [PATCH net-next 3/3] ipv6: obsolete cached dst when removing them from fib tree Paolo Abeni
2017-10-17 18:58   ` Wei Wang
2017-10-17 20:02     ` Paolo Abeni
2017-10-17 20:48       ` Wei Wang
2017-10-18 13:03         ` Paolo Abeni [this message]
2017-10-18 17:56           ` Wei Wang
2017-10-18 19:05             ` Martin KaFai Lau
2017-10-18 20:30               ` Paolo Abeni
2017-10-17 21:52     ` Martin KaFai Lau

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=1508331782.2559.5.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=kafai@fb.com \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=weiwan@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).