diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2024-10-16 11:53:50 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-10-22 11:02:04 +0200 |
commit | 43c7ce69d28e185f62fe2b8be2c681c5cac0bc6b (patch) | |
tree | 0ef68da66ece223cb40e655d78dfb9801df96d8c /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 0d3008d1a9aefb89e09e8dd39134512d678e3461 (diff) |
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>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions