netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Wei Wang <weiwan@google.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Ido Schimmel <idosch@idosch.org>,
	roopa@cumulusnetworks.com, Eric Dumazet <eric.dumazet@gmail.com>,
	Martin KaFai Lau <kafai@fb.com>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Subject: Re: [PATCH RFC net-next 16/20] net/ipv6: Cleanup exception route handling
Date: Mon, 26 Feb 2018 16:02:49 -0700	[thread overview]
Message-ID: <4ad3e5be-8539-0b87-8fee-192e4f9876e8@gmail.com> (raw)
In-Reply-To: <CAEA6p_DcBMWpV9-vaP06eCwFwAj_WGiCtiRWpifZLjFSnTvKEw@mail.gmail.com>

On 2/26/18 3:29 PM, Wei Wang wrote:
> On Sun, Feb 25, 2018 at 11:47 AM, David Ahern <dsahern@gmail.com> wrote:
>> IPv6 FIB will only contain FIB entries with exception routes added to
>> the FIB entry. Remove CACHE and dst checks from fib6 add and delete since
>> they can never happen once the data type changes.
>>
>> Fixup the lookup functions to use a f6i name for fib lookups and retain
>> the current rt name for return variables.
>>
>> Signed-off-by: David Ahern <dsahern@gmail.com>
>> ---
>>  net/ipv6/ip6_fib.c |  16 +------
>>  net/ipv6/route.c   | 122 ++++++++++++++++++++++++++++++-----------------------
>>  2 files changed, 71 insertions(+), 67 deletions(-)
>>
>> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
>> index 5b03f7e8d850..63a91db61749 100644
>> --- a/net/ipv6/ip6_fib.c
>> +++ b/net/ipv6/ip6_fib.c
>> @@ -1046,7 +1046,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
>>  static void fib6_start_gc(struct net *net, struct rt6_info *rt)
>>  {
>>         if (!timer_pending(&net->ipv6.ip6_fib_timer) &&
>> -           (rt->rt6i_flags & (RTF_EXPIRES | RTF_CACHE)))
>> +           (rt->rt6i_flags & RTF_EXPIRES))
>>                 mod_timer(&net->ipv6.ip6_fib_timer,
>>                           jiffies + net->ipv6.sysctl.ip6_rt_gc_interval);
>>  }
>> @@ -1097,8 +1097,6 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
> 
> This rt here should be f6i?
> 
>>
>>         if (WARN_ON_ONCE(!atomic_read(&rt->dst.__refcnt)))
>>                 return -EINVAL;
>> -       if (WARN_ON_ONCE(rt->rt6i_flags & RTF_CACHE))
>> -               return -EINVAL;
>>
>>         if (info->nlh) {
>>                 if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
>> @@ -1622,8 +1620,6 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
>>
>>         RT6_TRACE("fib6_del_route\n");
>>
>> -       WARN_ON_ONCE(rt->rt6i_flags & RTF_CACHE);
>> -
>>         /* Unlink it */
>>         *rtp = rt->rt6_next;
> 
> This rt here is also f6i right?
> 
>>         rt->rt6i_node = NULL;
>> @@ -1692,21 +1688,11 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
> 
> This rt here is also f6i right?
> 
>>         struct rt6_info __rcu **rtp;
>>         struct rt6_info __rcu **rtp_next;
>>
>> -#if RT6_DEBUG >= 2
>> -       if (rt->dst.obsolete > 0) {
>> -               WARN_ON(fn);
>> -               return -ENOENT;
>> -       }
>> -#endif
>>         if (!fn || rt == net->ipv6.fib6_null_entry)
>>                 return -ENOENT;
>>
>>         WARN_ON(!(fn->fn_flags & RTN_RTINFO));
>>
>> -       /* remove cached dst from exception table */
>> -       if (rt->rt6i_flags & RTF_CACHE)
>> -               return rt6_remove_exception_rt(rt);
> 
> Could you help delete rt6_remove_exception_rt() function? I don't
> think it is used anymore.

It is still used by ip6_negative_advice, ip6_link_failure and
ip6_del_cached_rt. It can be made static; will fix.


The rest of your comments for this patch are renaming rt to f6i. My
thought is to follow up with another patch that does the rename of rt to
f6i for all fib6_info. Given how large this change is already I did not
want to add extra diffs for that. If there is agreement to fold that
part in now, I can do it.

  reply	other threads:[~2018-02-26 23:02 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-25 19:47 [PATCH RFC net-next 00/20] net/ipv6: Separate data structures for FIB and data path David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 01/20] net: Move fib_convert_metrics to dst core David Ahern
2018-02-26 19:05   ` David Miller
2018-02-26 20:07     ` David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 02/20] vrf: Move fib6_table into net_vrf David Ahern
2018-02-26 19:08   ` David Miller
2018-02-26 20:13     ` David Ahern
2018-02-26 20:34       ` David Miller
2018-02-25 19:47 ` [PATCH RFC net-next 03/20] net/ipv6: Pass net to fib6_update_sernum David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 04/20] net/ipv6: Pass net namespace to route functions David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 05/20] net/ipv6: Move support functions up in route.c David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 06/20] net/ipv6: Save route type in rt6_info flags David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 07/20] net/ipv6: Move nexthop data to fib6_nh David Ahern
2018-02-26 22:28   ` Wei Wang
2018-02-26 22:47     ` David Ahern
2018-02-26 23:05       ` Wei Wang
2018-02-25 19:47 ` [PATCH RFC net-next 08/20] net/ipv6: Defer initialization of dst to data path David Ahern
2018-02-26 19:17   ` David Miller
2018-02-26 20:20     ` David Ahern
2018-02-26 20:22       ` David Miller
2018-02-25 19:47 ` [PATCH RFC net-next 09/20] net/ipv6: move metrics from dst to rt6_info David Ahern
2018-02-27  0:01   ` [net/ipv6] 15c9251fd2: BUG:unable_to_handle_kernel kernel test robot
2018-02-25 19:47 ` [PATCH RFC net-next 10/20] net/ipv6: move expires into rt6_info David Ahern
2018-02-26 22:28   ` Wei Wang
2018-02-26 22:55     ` David Ahern
2018-02-27  0:31       ` Wei Wang
2018-02-28 19:21       ` Martin KaFai Lau
2018-02-28 22:25         ` David Ahern
2018-02-28 22:56           ` Martin KaFai Lau
2018-02-25 19:47 ` [PATCH RFC net-next 11/20] net/ipv6: Add fib6_null_entry David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 12/20] net/ipv6: Add rt6_info create function for ip6_pol_route_lookup David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 13/20] net/ipv6: Move dst flags to booleans in fib entries David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 14/20] net/ipv6: Create a neigh_lookup for FIB entries David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 15/20] net/ipv6: Add gfp_flags to route add functions David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 16/20] net/ipv6: Cleanup exception route handling David Ahern
2018-02-26 19:27   ` David Miller
2018-02-26 20:25     ` David Ahern
2018-02-26 20:29       ` David Miller
2018-02-26 22:29   ` Wei Wang
2018-02-26 23:02     ` David Ahern [this message]
2018-02-27  0:32       ` Wei Wang
2018-02-25 19:47 ` [PATCH RFC net-next 17/20] net/ipv6: introduce fib6_info struct and helpers David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 18/20] net/ipv6: separate handling of FIB entries from dst based routes David Ahern
2018-02-28 18:44   ` Martin KaFai Lau
2018-02-28 20:10     ` David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 19/20] net/ipv6: Flip FIB entries to fib6_info David Ahern
2018-02-25 19:47 ` [PATCH RFC net-next 20/20] net/ipv6: Remove unused code and variables for rt6_info David Ahern

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=4ad3e5be-8539-0b87-8fee-192e4f9876e8@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=idosch@idosch.org \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=weiwan@google.com \
    --cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).