Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

neighbour: Use RCU list helpers for neigh_parms.list writers.

We will convert RTM_GETNEIGHTBL to RCU soon, where we traverse
tbl->parms_list under RCU in neightbl_dump_info().

Let's use RCU list helper for neigh_parms in neigh_parms_alloc()
and neigh_parms_release().

neigh_table_init() uses the plain list_add() for the default
neigh_parm that is embedded in the table and not yet published.

Note that neigh_parms_release() already uses call_rcu() to free
neigh_parms.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251022054004.2514876-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
06d63222 f0a24b25

+2 -2
+2 -2
net/core/neighbour.c
··· 1764 1764 } 1765 1765 1766 1766 write_lock_bh(&tbl->lock); 1767 - list_add(&p->list, &tbl->parms.list); 1767 + list_add_rcu(&p->list, &tbl->parms.list); 1768 1768 write_unlock_bh(&tbl->lock); 1769 1769 1770 1770 neigh_parms_data_state_cleanall(p); ··· 1786 1786 if (!parms || parms == &tbl->parms) 1787 1787 return; 1788 1788 write_lock_bh(&tbl->lock); 1789 - list_del(&parms->list); 1789 + list_del_rcu(&parms->list); 1790 1790 parms->dead = 1; 1791 1791 write_unlock_bh(&tbl->lock); 1792 1792 netdev_put(parms->dev, &parms->dev_tracker);