Skip to content

Commit

Permalink
ipv4: icmp: use this_cpu_read() in icmp_sk()
Browse files Browse the repository at this point in the history
this_cpu_read(*X) is faster than *this_cpu_ptr(X)

Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and dereference23 committed Jun 18, 2023
1 parent ce6009a commit fd6b69e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1];
*/
static struct sock *icmp_sk(struct net *net)
{
return *this_cpu_ptr(net->ipv4.icmp_sk);
return this_cpu_read(*net->ipv4.icmp_sk);
}

/* Called with BH disabled */
Expand Down

0 comments on commit fd6b69e

Please sign in to comment.