Skip to content

Commit e2d09e5

Browse files
Eric Dumazetkuba-moo
authored andcommitted
net: dst_cache: minor optimization in dst_cache_set_ip6()
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 <[email protected]> Acked-by: Paolo Abeni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3b09b2b commit e2d09e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/dst_cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst,
112112
return;
113113

114114
idst = this_cpu_ptr(dst_cache->cache);
115-
dst_cache_per_cpu_dst_set(this_cpu_ptr(dst_cache->cache), dst,
115+
dst_cache_per_cpu_dst_set(idst, dst,
116116
rt6_get_cookie(dst_rt6_info(dst)));
117117
idst->in6_saddr = *saddr;
118118
}

0 commit comments

Comments
 (0)