diff options
author | Kuniyuki Iwashima <kuniyu@google.com> | 2025-07-16 22:08:19 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-07-17 16:25:21 -0700 |
commit | 13a936bb99fb6385dc8620d24d7111e514448371 (patch) | |
tree | 35c5d9fe24899669317ff356014991ea7430b9d5 /net/nsh/nsh.c | |
parent | b8b7ed1ea83a9b2b6e697c10c4b24b9ea0003e19 (diff) |
neighbour: Protect tbl->phash_buckets[] with a dedicated mutex.
tbl->phash_buckets[] is only modified in the slow path by pneigh_create()
and pneigh_delete() under the table lock.
Both of them are called under RTNL, so no extra lock is needed, but we
will remove RTNL from the paths.
pneigh_create() looks up a pneigh_entry, and this part can be lockless,
but it would complicate the logic like
1. lookup
2. allocate pengih_entry for GFP_KERNEL
3. lookup again but under lock
4. if found, return it after freeing the allocated memory
5. else, return the new one
Instead, let's add a per-table mutex and run lookup and allocation
under it.
Note that updating pneigh_entry part in neigh_add() is still protected
by RTNL and will be moved to pneigh_create() in the next patch.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250716221221.442239-15-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/nsh/nsh.c')
0 files changed, 0 insertions, 0 deletions