lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5469a5edb05fc458a16ca3f1661d65c2cb0fea6e.camel@redhat.com>
Date: Tue, 07 May 2024 16:18:05 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
 <davem@...emloft.net>,  Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next] net: dst_cache: minor optimization in
 dst_cache_set_ip6()

On Tue, 2024-05-07 at 13:27 +0000, Eric Dumazet wrote:
> There is no need to use this_cpu_ptr(dst_cache->cache) twice.
> 
> Compiler is unable to optimize the second call, because of
> per-cpu constraints.
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
>  net/core/dst_cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/dst_cache.c b/net/core/dst_cache.c
> index f9df84a6c4b2dbe63c6f61fb431e179f92e072e0..6a0482e676d379f1f9bffdda51c7535243b3ec38 100644
> --- a/net/core/dst_cache.c
> +++ b/net/core/dst_cache.c
> @@ -112,7 +112,7 @@ void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst,
>  		return;
>  
>  	idst = this_cpu_ptr(dst_cache->cache);
> -	dst_cache_per_cpu_dst_set(this_cpu_ptr(dst_cache->cache), dst,
> +	dst_cache_per_cpu_dst_set(idst, dst,
>  				  rt6_get_cookie(dst_rt6_info(dst)));
>  	idst->in6_saddr = *saddr;
>  }

Acked-by: Paolo Abeni <pabeni@...hat.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ