summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-05-31 18:11:25 -0700
committerDavid S. Miller <davem@davemloft.net>2019-06-03 15:06:36 -0700
commitc353071ad0a2ef754fcba4153098e3cdc5ca516e (patch)
tree5fea2e27c303f86fe2912e58225b60bf7a018a2e /net/ipv6
parent4ebcfd9a9fbc44375ef73c938b1a23dbd10fd8a2 (diff)
ipv6: use this_cpu_read() in rt6_get_pcpu_route()
this_cpu_read(*X) is faster than *this_cpu_ptr(X) Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index fada5a13bcb2..a72d01010cb6 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1268,10 +1268,9 @@ static struct rt6_info *ip6_rt_pcpu_alloc(const struct fib6_result *res)
/* It should be called with rcu_read_lock() acquired */
static struct rt6_info *rt6_get_pcpu_route(const struct fib6_result *res)
{
- struct rt6_info *pcpu_rt, **p;
+ struct rt6_info *pcpu_rt;
- p = this_cpu_ptr(res->nh->rt6i_pcpu);
- pcpu_rt = *p;
+ pcpu_rt = this_cpu_read(*res->nh->rt6i_pcpu);
if (pcpu_rt)
ip6_hold_safe(NULL, &pcpu_rt);