summaryrefslogtreecommitdiff
path: root/include/net/neighbour.h
diff options
context:
space:
mode:
authorGilad Naaman <gnaaman@drivenets.com>2024-11-07 16:04:38 +0000
committerJakub Kicinski <kuba@kernel.org>2024-11-09 13:22:56 -0800
commit41b3caa7c0761141aa6d508924b9d23db57a17bc (patch)
treed3bc0c2805d46db5cb705b72204f2bb4598cf291 /include/net/neighbour.h
parent5e5be50342c04d4ff8aa2670c202b15efd4c459d (diff)
neighbour: Add hlist_node to struct neighbour
Add a doubly-linked node to neighbours, so that they can be deleted without iterating the entire bucket they're in. Signed-off-by: Gilad Naaman <gnaaman@drivenets.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20241107160444.2913124-2-gnaaman@drivenets.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r--include/net/neighbour.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3887ed9e5026..0402447854c7 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -136,6 +136,7 @@ struct neigh_statistics {
struct neighbour {
struct neighbour __rcu *next;
+ struct hlist_node hash;
struct neigh_table *tbl;
struct neigh_parms *parms;
unsigned long confirmed;
@@ -191,6 +192,7 @@ struct pneigh_entry {
struct neigh_hash_table {
struct neighbour __rcu **hash_buckets;
+ struct hlist_head *hash_heads;
unsigned int hash_shift;
__u32 hash_rnd[NEIGH_NUM_HASH_RND];
struct rcu_head rcu;