netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Alexandre Ferrieux <alexandre.ferrieux@gmail.com>
Cc: edumazet@google.com, alexandre.ferrieux@orange.com,
	nicolas.dichtel@6wind.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ipv4: avoid quadratic behavior in FIB insertion of common address
Date: Thu, 26 Sep 2024 16:43:26 +0100	[thread overview]
Message-ID: <20240926154326.GF4029621@kernel.org> (raw)
In-Reply-To: <20240926100807.3790287-1-alexandre.ferrieux@orange.com>

On Thu, Sep 26, 2024 at 12:08:07PM +0200, Alexandre Ferrieux wrote:
> Mix netns into all IPv4 FIB hashes to avoid massive collision
> when inserting the same address in many netns.
> 
> Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com>

Hi Alexandre,

Thanks for your updated patch.

net-next is currently closed for the v6.12 merge window. It should
reopen next week, after v6.12-rc1 has been released. Please repost
your patch, keeping in mind other feedback from Nicolas Dichtel after
it has reopned.

> ---
>  net/ipv4/fib_semantics.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index ba2df3d2ac15..e25c8bc56067 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -347,11 +347,9 @@ static unsigned int fib_info_hashfn_1(int init_val, u8 protocol, u8 scope,
>  	return val;
>  }
>  
> -static unsigned int fib_info_hashfn_result(unsigned int val)
> +static unsigned int fib_info_hashfn_result(const struct net *net, unsigned int val)

Please line wrap the above so it fits within 80 columns, as is still
preferred by Networking code.

checkpatch can be run with an option to flag this.

>  {
> -	unsigned int mask = (fib_info_hash_size - 1);
> -
> -	return (val ^ (val >> 7) ^ (val >> 12)) & mask;
> +	return hash_32(val ^ net_hash_mix(net), fib_info_hash_bits);
>  }
>  
>  static inline unsigned int fib_info_hashfn(struct fib_info *fi)

...

-- 
pw-bot: defer

      parent reply	other threads:[~2024-09-26 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 10:08 [PATCH net-next] ipv4: avoid quadratic behavior in FIB insertion of common address Alexandre Ferrieux
2024-09-26 10:19 ` Nicolas Dichtel
2024-09-26 15:43 ` Simon Horman [this message]

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=20240926154326.GF4029621@kernel.org \
    --to=horms@kernel.org \
    --cc=alexandre.ferrieux@gmail.com \
    --cc=alexandre.ferrieux@orange.com \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.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).