Subject: Re: [PATCH net-next] ipv4: avoid quadratic behavior in FIB insertion of common address

From: Simon Horman <[email-masked]>
Date: Thu, 26 Sep 2024 16:43:26 +0100

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 <[email-masked]>

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