[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241018114200.GG1697@kernel.org>
Date: Fri, 18 Oct 2024 12:42:00 +0100
From: Simon Horman <horms@...nel.org>
To: Gilad Naaman <gnaaman@...venets.com>
Cc: netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Kuniyuki Iwashima <kuniyu@...zon.com>,
Ido Schimmel <idosch@...dia.com>, Petr Machata <petrm@...dia.com>
Subject: Re: [PATCH net-next v5 4/6] Convert neighbour iteration to use
hlist+macro
On Thu, Oct 17, 2024 at 07:04:39AM +0000, Gilad Naaman wrote:
> 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@...venets.com>
...
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
...
> @@ -621,11 +620,9 @@ static struct neigh_hash_table *neigh_hash_grow(struct neigh_table *tbl,
>
> for (i = 0; i < (1 << old_nht->hash_shift); i++) {
> struct neighbour *n, *next;
> + struct hlist_node *tmp;
>
> - for (n = rcu_dereference_protected(old_nht->hash_buckets[i],
> - lockdep_is_held(&tbl->lock));
> - n != NULL;
> - n = next) {
> + neigh_for_each_safe(n, tmp, &old_nht->hash_heads[i]) {
> hash = tbl->hash(n->primary_key, n->dev,
> new_nht->hash_rnd);
>
Hi Gilad,
With this change next is now set but otherwise unused in this function.
Probably it can be removed.
Flagged by W=1 x86_64 allmodconfig builds with gcc-14 and clang-18.
...
Powered by blists - more mailing lists