netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Wang <weiwan@google.com>
To: David Miller <davem@davemloft.net>
Cc: 王蔚 <tracywwnj@gmail.com>,
	"Linux Kernel Network Developers" <netdev@vger.kernel.org>,
	"Martin KaFai Lau" <kafai@fb.com>,
	"Eric Dumazet" <edumazet@google.com>,
	"Mahesh Bandewar" <maheshb@google.com>,
	"David Ahern" <dsahern@gmail.com>
Subject: Re: [PATCH net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic
Date: Wed, 19 Jun 2019 09:51:30 -0700	[thread overview]
Message-ID: <CAEA6p_Cz31v798F=9+54hnf7yy8diPzXR2FjPuANeaWu0xD7YQ@mail.gmail.com> (raw)
In-Reply-To: <20190619.120726.374612750372065747.davem@davemloft.net>

On Wed, Jun 19, 2019 at 9:07 AM David Miller <davem@davemloft.net> wrote:
>
> From: Wei Wang <tracywwnj@gmail.com>
> Date: Tue, 18 Jun 2019 11:25:41 -0700
>
> > @@ -237,13 +240,16 @@ static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
> >                       goto out;
> >       }
> >  again:
> > -     ip6_rt_put(rt);
> > +     if (!(flags & RT6_LOOKUP_F_DST_NOREF) ||
> > +         !list_empty(&rt->rt6i_uncached))
> > +             ip6_rt_put(rt);
>
> This conditional release logic, with the special treatment of uncache items
> when using DST_NOREF, seems error prone.
>
> Maybe you can put this logic into a helper like ip6_rt_put_any() and do the
> list empty test etc. there?
>
>         ip6_rt_put_any(struct rt6_info *rt, int flags);
>
> What do you think?

Thanks David. Sure. Will update.

  reply	other threads:[~2019-06-19 16:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 18:25 [PATCH net-next 0/5] ipv6: avoid taking refcnt on dst during route lookup Wei Wang
2019-06-18 18:25 ` [PATCH net-next 1/5] ipv6: introduce RT6_LOOKUP_F_DST_NOREF flag in ip6_pol_route() Wei Wang
2019-06-18 18:25 ` [PATCH net-next 2/5] ipv6: initialize rt6->rt6i_uncached in all pre-allocated dst entries Wei Wang
2019-06-18 18:25 ` [PATCH net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic Wei Wang
2019-06-19 16:07   ` David Miller
2019-06-19 16:51     ` Wei Wang [this message]
2019-06-18 18:25 ` [PATCH net-next 4/5] ipv6: convert rx data path to not take refcnt on dst Wei Wang
2019-06-18 18:25 ` [PATCH net-next 5/5] ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF Wei Wang
2019-06-20 22:47   ` kbuild test robot

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='CAEA6p_Cz31v798F=9+54hnf7yy8diPzXR2FjPuANeaWu0xD7YQ@mail.gmail.com' \
    --to=weiwan@google.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=kafai@fb.com \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tracywwnj@gmail.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).