Re: [PATCH 4.19 008/114] nfp: flower: add rcu locks when accessing netdev for tunnels
From: Pavel Machek
Date: Sat May 25 2019 - 08:15:58 EST
Hi!
> From: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@xxxxxxxxxxxxx>
>
> [ Upstream commit cb07d915bf278a7a3938b983bbcb4921366b5eff ]
>
> Add rcu locks when accessing netdev when processing route request
> and tunnel keep alive messages received from hardware.
> /* Get the neighbour entry for the lookup */
> n = dst_neigh_lookup(&rt->dst, &flow.daddr);
> ip_rt_put(rt);
> if (!n)
> - goto route_fail_warning;
> - nfp_tun_write_neigh(n->dev, app, &flow, n, GFP_KERNEL);
> + goto fail_rcu_unlock;
> + nfp_tun_write_neigh(n->dev, app, &flow, n, GFP_ATOMIC);
> neigh_release(n);
> + rcu_read_unlock();
> return;
This will make allocations more likely to fail. I thought it is okay to sleep in
rcu lock critical sections...?
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html