On Tue, Oct 15, 2019 at 09:44:11AM -0700, Wei Wang wrote: > On Tue, Oct 15, 2019 at 7:29 AM Jesse Hathaway <je...@mbuki-mvuki.org> wrote: > > > > On Fri, Oct 11, 2019 at 12:54 PM Wei Wang <wei...@google.com> wrote: > > > Hmm... Yes... I would think a per-CPU input cache should work for the > > > case above. > > > Another idea is: instead of calling dst_dev_put() in rt_cache_route() > > > to switch out the dev, we call, rt_add_uncached_list() to add this > > > obsolete dst cache to the uncached list. And if the device gets > > > unregistered, rt_flush_dev() takes care of all dst entries in the > > > uncached list. I think that would work too. > > > > > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > > > index dc1f510a7c81..ee618d4234ce 100644 > > > --- a/net/ipv4/route.c > > > +++ b/net/ipv4/route.c > > > @@ -1482,7 +1482,7 @@ static bool rt_cache_route(struct fib_nh_common > > > *nhc, struct rtable *rt) > > > prev = cmpxchg(p, orig, rt); > > > if (prev == orig) { > > > if (orig) { > > > - dst_dev_put(&orig->dst); > > > + rt_add_uncached_list(orig); > > > dst_release(&orig->dst); > > > } > > > } else { > > > > > > > Thanks Wei for your work on this issue, > > > > Any chance this patch will make it into 5.4? > > I can submit the patch to NET branch if everyone agrees with this one liner > fix. Acked-by: Martin KaFai Lau <ka...@fb.com>
I don't think it is a very critical bug though. Not sure how far it should be ported. > Then I believe it will be patched into the next 5.4 release automatically?