Kuniyuki Iwashima 43c7ce69d2 rtnetlink: Protect struct rtnl_link_ops with SRCU.
Once RTNL is replaced with rtnl_net_lock(), we need a mechanism to
guarantee that rtnl_link_ops is alive during inflight RTM_NEWLINK
even when its module is being unloaded.

Let's use SRCU to protect ops.

rtnl_link_ops_get() now iterates link_ops under RCU and returns
SRCU-protected ops pointer.  The caller must call rtnl_link_ops_put()
to release the pointer after the use.

Also, __rtnl_link_unregister() unlinks the ops first and calls
synchronize_srcu() to wait for inflight RTM_NEWLINK requests to
complete.

Note that link_ops needs to be protected by its dedicated lock
when RTNL is removed.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-10-22 11:02:04 +02:00
..
2024-10-14 17:54:29 -07:00
2024-10-14 17:54:29 -07:00
2024-09-11 20:44:32 -07:00
2024-10-15 18:52:26 -07:00
2024-10-15 15:19:48 +02:00
2024-03-07 21:12:41 -08:00
2024-10-15 18:52:26 -07:00
2024-04-01 10:49:28 +01:00
2024-09-11 20:44:31 -07:00
2024-09-02 18:43:58 +02:00
2024-06-06 11:52:52 +02:00
2024-09-24 14:54:26 -07:00
2024-08-26 09:37:23 -07:00