mbox series

[v4,net-next,0/5] net: More movement to fib_nh_common

Message ID 20190402211158.19459-1-dsahern@kernel.org
Headers show
Series net: More movement to fib_nh_common | expand

Message

David Ahern April 2, 2019, 9:11 p.m. UTC
From: David Ahern <dsahern@gmail.com>

Second set of three with the end goal of enabling IPv6 gateways with IPv4
routes.

This set moves:
- the ipv4 tracepoint to take a fib_nh_common and updates it to handle
  a v6 gateway.
- consolidates route notifications to use the same fill functions
  for both ipv4 and ipv6

v4
- enhanced the commit message for patches 1 and 2

v3
- comments from Martin:
  + renamed FIB_RES_NH to FIB_RES_NHC
  + removed family check from fib_result_prefsrc
  + in fib_nexthop_info, renamed nexthop arg to nhc and dropped for_ipv4 arg

v2
- dropped patches moving cached routes and exception buckets to
  fib_nh_common. The goal is allowing a fib6_nh to be used with an
  IPv4 route. The hold up is the need for separate exception buckets -
  one for v6 routes and one for v4 routes. When all of the nexthop patches
  are in, adding a secondi exception bucket pushes IPv6 fib6_info
  allocations over 256 which means fib6_info allocations roll up to 512.
  Hence, deferring the patches until some data mining can be done to keep
  the allocations at 256.

David Ahern (5):
  ipv4: Update fib_table_lookup tracepoint to take common nexthop
  ipv4: Add fib_nh_common to fib_result
  ipv4: Refactor nexthop attributes in fib_dump_info
  ipv4: Change fib_nexthop_info and fib_add_nexthop to take
    fib_nh_common
  ipv6: Flip to fib_nexthop_info

 include/net/ip_fib.h       |  52 +++++------
 include/trace/events/fib.h |  45 ++++++----
 net/core/filter.c          |  12 +--
 net/ipv4/fib_frontend.c    |   6 +-
 net/ipv4/fib_lookup.h      |   1 +
 net/ipv4/fib_semantics.c   | 215 ++++++++++++++++++++++++++++++++-------------
 net/ipv4/fib_trie.c        |  13 +--
 net/ipv4/route.c           |  60 ++++++++-----
 net/ipv6/route.c           |  77 ++--------------
 9 files changed, 267 insertions(+), 214 deletions(-)

Comments

Martin KaFai Lau April 3, 2019, 5:27 a.m. UTC | #1
On Tue, Apr 02, 2019 at 02:11:53PM -0700, David Ahern wrote:
> From: David Ahern <dsahern@gmail.com>
> 
> Second set of three with the end goal of enabling IPv6 gateways with IPv4
> routes.
I am still not completely convinced on the new "*nhc" in patch 2 without
seeing a patch showing why nh_sel is not enough.

However, since it seems guaranteed that it will be needed soon, for this set,

Acked-by: Martin KaFai Lau <kafai@fb.com>
David Ahern April 3, 2019, 6:59 p.m. UTC | #2
On 4/2/19 11:27 PM, Martin Lau wrote:
> On Tue, Apr 02, 2019 at 02:11:53PM -0700, David Ahern wrote:
>> From: David Ahern <dsahern@gmail.com>
>>
>> Second set of three with the end goal of enabling IPv6 gateways with IPv4
>> routes.
> I am still not completely convinced on the new "*nhc" in patch 2 without
> seeing a patch showing why nh_sel is not enough.

fib_table_lookup and fib_select_path have determined the address of the
preferred fib_nh struct. To look it up again will get costly for nexthop
groups: dereference the nexthop pointer, see that it is a group, get the
pointer to the group data, find the Nth (nh_sel) entry and return it.
Since we already have the end pointer, avoid repeated lookups which
nh_sel requires and save the fib_nh to fib_result. That's what patch 2
is doing and the updated commit message shows that.
David Miller April 4, 2019, 4:50 a.m. UTC | #3
From: David Ahern <dsahern@kernel.org>
Date: Tue,  2 Apr 2019 14:11:53 -0700

> From: David Ahern <dsahern@gmail.com>
> 
> Second set of three with the end goal of enabling IPv6 gateways with IPv4
> routes.
> 
> This set moves:
> - the ipv4 tracepoint to take a fib_nh_common and updates it to handle
>   a v6 gateway.
> - consolidates route notifications to use the same fill functions
>   for both ipv4 and ipv6
 ...

Series applied, thanks David.
David Ahern April 4, 2019, 3:07 p.m. UTC | #4
On 4/3/19 10:50 PM, David Miller wrote:
> From: David Ahern <dsahern@kernel.org>
> Date: Tue,  2 Apr 2019 14:11:53 -0700
> 
>> From: David Ahern <dsahern@gmail.com>
>>
>> Second set of three with the end goal of enabling IPv6 gateways with IPv4
>> routes.
>>
>> This set moves:
>> - the ipv4 tracepoint to take a fib_nh_common and updates it to handle
>>   a v6 gateway.
>> - consolidates route notifications to use the same fill functions
>>   for both ipv4 and ipv6
>  ...
> 
> Series applied, thanks David.
> 

Hi Dave: Have you pushed the changes out? not seeing them on git.kernel.org
David Miller April 4, 2019, 8:30 p.m. UTC | #5
From: David Ahern <dsahern@gmail.com>
Date: Thu, 4 Apr 2019 09:07:04 -0600

> On 4/3/19 10:50 PM, David Miller wrote:
>> From: David Ahern <dsahern@kernel.org>
>> Date: Tue,  2 Apr 2019 14:11:53 -0700
>> 
>>> From: David Ahern <dsahern@gmail.com>
>>>
>>> Second set of three with the end goal of enabling IPv6 gateways with IPv4
>>> routes.
>>>
>>> This set moves:
>>> - the ipv4 tracepoint to take a fib_nh_common and updates it to handle
>>>   a v6 gateway.
>>> - consolidates route notifications to use the same fill functions
>>>   for both ipv4 and ipv6
>>  ...
>> 
>> Series applied, thanks David.
>> 
> 
> Hi Dave: Have you pushed the changes out? not seeing them on git.kernel.org

Should be there now.