All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Gilad Naaman <gnaaman@drivenets.com>
Cc: netdev <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Kuniyuki Iwashima <kuniyu@amazon.com>,
	Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>
Subject: Re: [PATCH net-next v5 4/6] Convert neighbour iteration to use hlist+macro
Date: Fri, 18 Oct 2024 12:42:00 +0100	[thread overview]
Message-ID: <20241018114200.GG1697@kernel.org> (raw)
In-Reply-To: <20241017070445.4013745-5-gnaaman@drivenets.com>

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@drivenets.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.

...

  reply	other threads:[~2024-10-18 11:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17  7:04 [PATCH net-next v5 0/6] Improve neigh_flush_dev performance Gilad Naaman
2024-10-17  7:04 ` [PATCH net-next v5 1/6] Add hlist_node to struct neighbour Gilad Naaman
2024-10-17  7:04 ` [PATCH net-next v5 2/6] Define neigh_for_each Gilad Naaman
2024-10-17 16:26   ` Petr Machata
2024-10-20  7:16     ` Gilad Naaman
2024-10-21  9:07       ` Petr Machata
2024-10-17  7:04 ` [PATCH net-next v5 3/6] Convert neigh_* seq_file functions to use hlist Gilad Naaman
2024-10-17  7:04 ` [PATCH net-next v5 4/6] Convert neighbour iteration to use hlist+macro Gilad Naaman
2024-10-18 11:42   ` Simon Horman [this message]
2024-10-17  7:04 ` [PATCH net-next v5 5/6] Remove bare neighbour::next pointer Gilad Naaman
2024-10-18  4:56   ` kernel test robot
2024-10-17  7:04 ` [PATCH net-next v5 6/6] Create netdev->neighbour association Gilad Naaman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241018114200.GG1697@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gnaaman@drivenets.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.