Re: [patch net-next v3 2/7] devlink: call peernet2id_alloc() with net pointer under RCU read lock

From
Simon Horman <horms@kernel.org>
Date
2023-10-17 08:50:19
Reply to
Jiri Pirko, 2023-10-13
On Fri, Oct 13, 2023 at 02:10:24PM +0200, Jiri Pirko wrote:
From: Jiri Pirko <redacted>

peernet2id_alloc() allows to be called lockless with peer net pointer
obtained in RCU critical section and makes sure to return ns ID if net
namespaces is not being removed concurrently. Benefit from
read_pnet_rcu() helper addition, use it to obtain net pointer under RCU
read lock and pass it to peernet2id_alloc() to get ns ID.

Fixes: c137743bce02 ("devlink: introduce object and nested devlink relationship infra")
Signed-off-by: Jiri Pirko <redacted>
Reviewed-by: Simon Horman <horms@kernel.org>
Thread (16 messages) 16 messages, 3 authors, last reply 2023-10-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help