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 1/6] neighbour: Add hlist_node to struct neighbour
Date: Mon, 21 Oct 2024 12:40:48 -0700	[thread overview]
Message-ID: <20241021194048.88666-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20241021193623.2830318-1-gnaaman@drivenets.com>

From: Gilad Naaman <gnaaman@drivenets.com>
Date: Mon, 21 Oct 2024 19:36:22 +0000
> > > @@ -530,27 +532,47 @@ static void neigh_get_hash_rnd(u32 *x)
> > >  
> > >  static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
> > >  {
> > > +	size_t hash_heads_size = (1 << shift) * sizeof(struct hlist_head);
> > >  	size_t size = (1 << shift) * sizeof(struct neighbour *);
> > > -	struct neigh_hash_table *ret;
> > >  	struct neighbour __rcu **buckets;
> > > +	struct hlist_head *hash_heads;
> > > +	struct neigh_hash_table *ret;
> > >  	int i;
> > >  
> > > +	hash_heads = NULL;
> > 
> > nit: This init is not needed.
> 
> This is needed in order to prevent unitialized memory access if we failed to
> allocate `buckets`.

Ah, you are right.

> 
> If possible I'd prefer to leave this as-is, given that this is rewritten later,
> in commit 5.

Sounds good.  Let's remove that in patch 5.

  reply	other threads:[~2024-10-21 19:40 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 [this message]
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
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=20241021194048.88666-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).