diff options
| author | Gilad Naaman <gnaaman@drivenets.com> | 2024-11-07 16:04:41 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-09 13:22:57 -0800 |
| commit | 0e3bcb0f78a0ca7cfdb7906dc79d922e19ba09b5 (patch) | |
| tree | a7cdb8dacb3a76e19d797a2515253486cc7fed73 /include | |
| parent | 00df5e1a3fdf36624d59ef6ab09010ebaee6e66a (diff) | |
neighbour: Convert iteration to use hlist+macro
Remove all usage of the bare neighbour::next pointer,
replacing them with neighbour::hash and its for_each macro.
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-5-gnaaman@drivenets.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/neighbour.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 4b9068c5e668..94cf4f8c118f 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -311,12 +311,9 @@ static inline struct neighbour *___neigh_lookup_noref( u32 hash_val; hash_val = hash(pkey, dev, nht->hash_rnd) >> (32 - nht->hash_shift); - for (n = rcu_dereference(nht->hash_buckets[hash_val]); - n != NULL; - n = rcu_dereference(n->next)) { + neigh_for_each_in_bucket_rcu(n, &nht->hash_heads[hash_val]) if (n->dev == dev && key_eq(n, pkey)) return n; - } return NULL; } |
