ipv6: icmp: use this_cpu_read() in icmpv6_sk()
Subsystems (3)
PATCH 1/1 ipv6: icmp: use this_cpu_read() in icmpv6_sk()
In general, this_cpu_read(*X) is faster than *this_cpu_ptr(X)
Also remove the inline attibute, totally useless.
Signed-off-by Eric Dumazet <[email protected]>
Cc Kefeng Wang <[email protected]>
--- net/ipv6/icmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/icmp.c +2 -2
@@ -79,9 +79,9 @@* * On SMP we have one ICMP socket per-cpu. */ -static inline struct sock *icmpv6_sk (struct net *net) +static struct sock *icmpv6_sk (struct net *net) { -return *this_cpu_ptr (net->ipv6.icmp_sk); +return this_cpu_read (*net->ipv6.icmp_sk); } static int icmpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
Signature · 1 line
2.22.0.rc1.257.g3120a18244-goog
From: Eric Dumazet <[email protected]>
Date: Fri, 31 May 2019 15:27:00 -0700
Quoted 6 lines
In general,
this_cpu_read(*X)is faster than*this_cpu_ptr(X)Also remove the inline attibute, totally useless.
Signed-off-by Eric Dumazet <[email protected]>Cc Kefeng Wang <[email protected]>
Applied.