Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5472c3c6 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: use this_cpu_read(*X) instead of *this_cpu_ptr(X)



this_cpu_read(*X) is slightly faster than *this_cpu_ptr(X)

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 046386ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -771,7 +771,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
	arg.tos = ip_hdr(skb)->tos;
	arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL);
	local_bh_disable();
	ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk);
	ctl_sk = this_cpu_read(*net->ipv4.tcp_sk);
	if (sk)
		ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?
				   inet_twsk(sk)->tw_mark : sk->sk_mark;
@@ -863,7 +863,7 @@ static void tcp_v4_send_ack(const struct sock *sk,
	arg.tos = tos;
	arg.uid = sock_net_uid(net, sk_fullsock(sk) ? sk : NULL);
	local_bh_disable();
	ctl_sk = *this_cpu_ptr(net->ipv4.tcp_sk);
	ctl_sk = this_cpu_read(*net->ipv4.tcp_sk);
	if (sk)
		ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?
				   inet_twsk(sk)->tw_mark : sk->sk_mark;