Re: [PATCH] RDMA/rxe: rework per-net tunnel socket lifetime to fix refcount underflow

From: Jason Gunthorpe

Date: Thu Jul 09 2026 - 11:52:13 EST


On Mon, Jul 06, 2026 at 09:14:04PM +0300, Serhat Kumral wrote:

> For that remaining window, instead of rtnl_lock() or a global mutex,
> v2 makes rxe_net_del() idempotent per device with a test_and_set_bit()
> in struct rxe_dev, so only the first invocation drops the pernet
> socket references. This keeps the serialization at device granularity
> without adding any global locking. If you would rather serialize
> dellink itself, I am happy to respin that way.

I'm not taking any bodges for this namespace stuff until it is
rewritten not to use net ns notifiers.

sockets need to be linked to GID entries and take their namespaces and
addressing from the gid entries.

This will fix all the lifetime issues.

Jason