netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <gnaaman@drivenets.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<kuniyu@amazon.com>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>
Subject: Re: [PATCH net-next v6 4/6] neighbour: Convert iteration to use hlist+macro
Date: Mon, 21 Oct 2024 12:21:14 -0700	[thread overview]
Message-ID: <20241021192114.85237-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20241021102102.2560279-5-gnaaman@drivenets.com>

From: Gilad Naaman <gnaaman@drivenets.com>
Date: Mon, 21 Oct 2024 10:20:56 +0000
> @@ -3146,18 +3135,18 @@ EXPORT_SYMBOL(neigh_for_each);
>  void __neigh_for_each_release(struct neigh_table *tbl,
>  			      int (*cb)(struct neighbour *))
>  {
> -	int chain;
>  	struct neigh_hash_table *nht;
> +	int chain;
>  
>  	nht = rcu_dereference_protected(tbl->nht,
>  					lockdep_is_held(&tbl->lock));
>  	for (chain = 0; chain < (1 << nht->hash_shift); chain++) {
>  		struct neighbour *n;
> +		struct hlist_node *tmp;
>  		struct neighbour __rcu **np;

nit: Reverse xmas order

>  
>  		np = &nht->hash_buckets[chain];
> -		while ((n = rcu_dereference_protected(*np,
> -					lockdep_is_held(&tbl->lock))) != NULL) {
> +		neigh_for_each_in_bucket_safe(n, tmp, &nht->hash_heads[chain]) {
>  			int release;
>  
>  			write_lock(&n->lock);

  reply	other threads:[~2024-10-21 19:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21 10:20 [PATCH net-next v6 0/6] neighbour: Improve neigh_flush_dev performance Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 1/6] neighbour: Add hlist_node to struct neighbour Gilad Naaman
2024-10-21 19:11   ` Kuniyuki Iwashima
2024-10-21 19:36     ` Gilad Naaman
2024-10-21 19:40       ` Kuniyuki Iwashima
2024-10-21 10:20 ` [PATCH net-next v6 2/6] neighbour: Define neigh_for_each_in_bucket Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 3/6] neighbour: Convert seq_file functions to use hlist Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 4/6] neighbour: Convert iteration to use hlist+macro Gilad Naaman
2024-10-21 19:21   ` Kuniyuki Iwashima [this message]
2024-10-21 10:20 ` [PATCH net-next v6 5/6] neighbour: Remove bare neighbour::next pointer Gilad Naaman
2024-10-21 10:20 ` [PATCH net-next v6 6/6] neighbour: Create netdev->neighbour association Gilad Naaman
2024-10-21 18:04 ` [PATCH net-next v6 0/6] neighbour: Improve neigh_flush_dev performance Stanislav Fomichev
2024-10-22 11:21   ` 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=20241021192114.85237-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gnaaman@drivenets.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).