Re: [PATCH v2 net-next 4/7] ipv6: Plumb support for nexthop object in a fib6_info
From: Martin Lau <hidden>
Date: 2019-06-05 06:01:30
From: Martin Lau <hidden>
Date: 2019-06-05 06:01:30
On Tue, Jun 04, 2019 at 08:05:58PM -0600, David Ahern wrote:
On 6/4/19 6:39 PM, Martin Lau wrote:quoted
IMO, ip6_create_rt_rcu(), which returns untracked rt, was a mistake and removing it has been overdue. Tracking down the unregister dev bug is not easy.I must be missing something because I don't have the foggiest idea why you are barking up this tree. If code calls a function that returns a dst_entry with a refcount taken, that code is responsible for releasing it.
The code is responsible but there is no control on when.
That code can cache it for a long time. May be re-look at the dev_put() in
this recent bug fix to begin with?
f5b51fe804ec ("ipv6: route: purge exception on removal")
and also the current rt6_uncached_list + rt6_uncached_list_flush_dev()
Using a pcpu cached dst versus a new one in no way tells you who took the dst and bumped the refcnt on the netdev. Either way the dst refcount is bumped. Tracking netdev refcnt is the only way to methodically figure it out. What am I overlooking here?