]> git.dujemihanovic.xyz Git - linux.git/commitdiff
net: dst_cache: minor optimization in dst_cache_set_ip6()
authorEric Dumazet <edumazet@google.com>
Tue, 7 May 2024 13:27:17 +0000 (13:27 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 May 2024 01:50:11 +0000 (18:50 -0700)
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@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20240507132717.627518-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dst_cache.c

index f9df84a6c4b2dbe63c6f61fb431e179f92e072e0..6a0482e676d379f1f9bffdda51c7535243b3ec38 100644 (file)
@@ -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;
 }