aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-04-27 19:44:39 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-27 22:48:24 -0400
commit02a1d6e7a6bb025a77da77012190e1efc1970f1c (patch)
tree79fdbbaa1812a45cff7148cdaca96685e2c1a287
parentb15084ec7d4c89000242d69b5f57b4d138bad1b9 (diff)
net: rename NET_{ADD|INC}_STATS_BH()
Rename NET_INC_STATS_BH() to __NET_INC_STATS() and NET_ADD_STATS_BH() to __NET_ADD_STATS() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip.h4
-rw-r--r--include/net/tcp.h4
-rw-r--r--net/core/dev.c4
-rw-r--r--net/dccp/ipv4.c10
-rw-r--r--net/dccp/ipv6.c8
-rw-r--r--net/dccp/timer.c4
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/inet_hashtables.c2
-rw-r--r--net/ipv4/inet_timewait_sock.c4
-rw-r--r--net/ipv4/ip_input.c2
-rw-r--r--net/ipv4/syncookies.c4
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/tcp_cdg.c20
-rw-r--r--net/ipv4/tcp_cubic.c20
-rw-r--r--net/ipv4/tcp_fastopen.c14
-rw-r--r--net/ipv4/tcp_input.c100
-rw-r--r--net/ipv4/tcp_ipv4.c22
-rw-r--r--net/ipv4/tcp_minisocks.c10
-rw-r--r--net/ipv4/tcp_output.c14
-rw-r--r--net/ipv4/tcp_recovery.c4
-rw-r--r--net/ipv4/tcp_timer.c22
-rw-r--r--net/ipv6/inet6_hashtables.c2
-rw-r--r--net/ipv6/syncookies.c4
-rw-r--r--net/ipv6/tcp_ipv6.c16
-rw-r--r--net/sctp/input.c2
25 files changed, 153 insertions, 149 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 55f5de50a564..fb3b766ca1c7 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -193,9 +193,9 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
193#define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64((net)->mib.ip_statistics, field, val) 193#define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64((net)->mib.ip_statistics, field, val)
194#define __IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64_BH((net)->mib.ip_statistics, field, val) 194#define __IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64_BH((net)->mib.ip_statistics, field, val)
195#define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field) 195#define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field)
196#define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field) 196#define __NET_INC_STATS(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field)
197#define NET_ADD_STATS(net, field, adnd) SNMP_ADD_STATS((net)->mib.net_statistics, field, adnd) 197#define NET_ADD_STATS(net, field, adnd) SNMP_ADD_STATS((net)->mib.net_statistics, field, adnd)
198#define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd) 198#define __NET_ADD_STATS(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd)
199 199
200u64 snmp_get_cpu_field(void __percpu *mib, int cpu, int offct); 200u64 snmp_get_cpu_field(void __percpu *mib, int cpu, int offct);
201unsigned long snmp_fold_field(void __percpu *mib, int offt); 201unsigned long snmp_fold_field(void __percpu *mib, int offt);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 939ebd5320a9..ff8b4265cb2b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1743,7 +1743,7 @@ static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops,
1743 __u16 *mss) 1743 __u16 *mss)
1744{ 1744{
1745 tcp_synq_overflow(sk); 1745 tcp_synq_overflow(sk);
1746 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT); 1746 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT);
1747 return ops->cookie_init_seq(skb, mss); 1747 return ops->cookie_init_seq(skb, mss);
1748} 1748}
1749#else 1749#else
@@ -1852,7 +1852,7 @@ static inline void tcp_segs_in(struct tcp_sock *tp, const struct sk_buff *skb)
1852static inline void tcp_listendrop(const struct sock *sk) 1852static inline void tcp_listendrop(const struct sock *sk)
1853{ 1853{
1854 atomic_inc(&((struct sock *)sk)->sk_drops); 1854 atomic_inc(&((struct sock *)sk)->sk_drops);
1855 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 1855 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENDROPS);
1856} 1856}
1857 1857
1858#endif /* _TCP_H */ 1858#endif /* _TCP_H */
diff --git a/net/core/dev.c b/net/core/dev.c
index 6324bc9267f7..e96a3bc2c634 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4982,8 +4982,8 @@ bool sk_busy_loop(struct sock *sk, int nonblock)
4982 netpoll_poll_unlock(have); 4982 netpoll_poll_unlock(have);
4983 } 4983 }
4984 if (rc > 0) 4984 if (rc > 0)
4985 NET_ADD_STATS_BH(sock_net(sk), 4985 __NET_ADD_STATS(sock_net(sk),
4986 LINUX_MIB_BUSYPOLLRXPACKETS, rc); 4986 LINUX_MIB_BUSYPOLLRXPACKETS, rc);
4987 local_bh_enable(); 4987 local_bh_enable();
4988 4988
4989 if (rc == LL_FLUSH_FAILED) 4989 if (rc == LL_FLUSH_FAILED)
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index a9c75e79ba99..a8164272e0f4 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -205,7 +205,7 @@ void dccp_req_err(struct sock *sk, u64 seq)
205 * socket here. 205 * socket here.
206 */ 206 */
207 if (!between48(seq, dccp_rsk(req)->dreq_iss, dccp_rsk(req)->dreq_gss)) { 207 if (!between48(seq, dccp_rsk(req)->dreq_iss, dccp_rsk(req)->dreq_gss)) {
208 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 208 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
209 } else { 209 } else {
210 /* 210 /*
211 * Still in RESPOND, just remove it silently. 211 * Still in RESPOND, just remove it silently.
@@ -273,7 +273,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
273 * servers this needs to be solved differently. 273 * servers this needs to be solved differently.
274 */ 274 */
275 if (sock_owned_by_user(sk)) 275 if (sock_owned_by_user(sk))
276 NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); 276 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
277 277
278 if (sk->sk_state == DCCP_CLOSED) 278 if (sk->sk_state == DCCP_CLOSED)
279 goto out; 279 goto out;
@@ -281,7 +281,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
281 dp = dccp_sk(sk); 281 dp = dccp_sk(sk);
282 if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && 282 if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) &&
283 !between48(seq, dp->dccps_awl, dp->dccps_awh)) { 283 !between48(seq, dp->dccps_awl, dp->dccps_awh)) {
284 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 284 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
285 goto out; 285 goto out;
286 } 286 }
287 287
@@ -431,11 +431,11 @@ struct sock *dccp_v4_request_recv_sock(const struct sock *sk,
431 return newsk; 431 return newsk;
432 432
433exit_overflow: 433exit_overflow:
434 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); 434 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
435exit_nonewsk: 435exit_nonewsk:
436 dst_release(dst); 436 dst_release(dst);
437exit: 437exit:
438 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 438 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENDROPS);
439 return NULL; 439 return NULL;
440put_and_exit: 440put_and_exit:
441 inet_csk_prepare_forced_close(newsk); 441 inet_csk_prepare_forced_close(newsk);
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 323c6b595e31..0f4eb4ea57a5 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -106,7 +106,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
106 106
107 bh_lock_sock(sk); 107 bh_lock_sock(sk);
108 if (sock_owned_by_user(sk)) 108 if (sock_owned_by_user(sk))
109 NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); 109 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
110 110
111 if (sk->sk_state == DCCP_CLOSED) 111 if (sk->sk_state == DCCP_CLOSED)
112 goto out; 112 goto out;
@@ -114,7 +114,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
114 dp = dccp_sk(sk); 114 dp = dccp_sk(sk);
115 if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && 115 if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) &&
116 !between48(seq, dp->dccps_awl, dp->dccps_awh)) { 116 !between48(seq, dp->dccps_awl, dp->dccps_awh)) {
117 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 117 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
118 goto out; 118 goto out;
119 } 119 }
120 120
@@ -527,11 +527,11 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk,
527 return newsk; 527 return newsk;
528 528
529out_overflow: 529out_overflow:
530 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); 530 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
531out_nonewsk: 531out_nonewsk:
532 dst_release(dst); 532 dst_release(dst);
533out: 533out:
534 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 534 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENDROPS);
535 return NULL; 535 return NULL;
536} 536}
537 537
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index 4ff22c24ff14..3a2c34027758 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -179,7 +179,7 @@ static void dccp_delack_timer(unsigned long data)
179 if (sock_owned_by_user(sk)) { 179 if (sock_owned_by_user(sk)) {
180 /* Try again later. */ 180 /* Try again later. */
181 icsk->icsk_ack.blocked = 1; 181 icsk->icsk_ack.blocked = 1;
182 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED); 182 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
183 sk_reset_timer(sk, &icsk->icsk_delack_timer, 183 sk_reset_timer(sk, &icsk->icsk_delack_timer,
184 jiffies + TCP_DELACK_MIN); 184 jiffies + TCP_DELACK_MIN);
185 goto out; 185 goto out;
@@ -209,7 +209,7 @@ static void dccp_delack_timer(unsigned long data)
209 icsk->icsk_ack.ato = TCP_ATO_MIN; 209 icsk->icsk_ack.ato = TCP_ATO_MIN;
210 } 210 }
211 dccp_send_ack(sk); 211 dccp_send_ack(sk);
212 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKS); 212 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKS);
213 } 213 }
214out: 214out:
215 bh_unlock_sock(sk); 215 bh_unlock_sock(sk);
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index c34c7544d1db..89a8cac4726a 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -436,7 +436,7 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
436 if (IS_ERR(rt)) 436 if (IS_ERR(rt))
437 return 1; 437 return 1;
438 if (rt->dst.dev != dev) { 438 if (rt->dst.dev != dev) {
439 NET_INC_STATS_BH(net, LINUX_MIB_ARPFILTER); 439 __NET_INC_STATS(net, LINUX_MIB_ARPFILTER);
440 flag = 1; 440 flag = 1;
441 } 441 }
442 ip_rt_put(rt); 442 ip_rt_put(rt);
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index b76b0d7e59c1..3177211ab651 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -360,7 +360,7 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row,
360 __sk_nulls_add_node_rcu(sk, &head->chain); 360 __sk_nulls_add_node_rcu(sk, &head->chain);
361 if (tw) { 361 if (tw) {
362 sk_nulls_del_node_init_rcu((struct sock *)tw); 362 sk_nulls_del_node_init_rcu((struct sock *)tw);
363 NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED); 363 __NET_INC_STATS(net, LINUX_MIB_TIMEWAITRECYCLED);
364 } 364 }
365 spin_unlock(lock); 365 spin_unlock(lock);
366 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); 366 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index c67f9bd7699c..99ee5c4a9b68 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -147,9 +147,9 @@ static void tw_timer_handler(unsigned long data)
147 struct inet_timewait_sock *tw = (struct inet_timewait_sock *)data; 147 struct inet_timewait_sock *tw = (struct inet_timewait_sock *)data;
148 148
149 if (tw->tw_kill) 149 if (tw->tw_kill)
150 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED); 150 __NET_INC_STATS(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED);
151 else 151 else
152 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITED); 152 __NET_INC_STATS(twsk_net(tw), LINUX_MIB_TIMEWAITED);
153 inet_twsk_kill(tw); 153 inet_twsk_kill(tw);
154} 154}
155 155
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 8fda63d78435..751c0658e194 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -337,7 +337,7 @@ static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
337 iph->tos, skb->dev); 337 iph->tos, skb->dev);
338 if (unlikely(err)) { 338 if (unlikely(err)) {
339 if (err == -EXDEV) 339 if (err == -EXDEV)
340 NET_INC_STATS_BH(net, LINUX_MIB_IPRPFILTER); 340 __NET_INC_STATS(net, LINUX_MIB_IPRPFILTER);
341 goto drop; 341 goto drop;
342 } 342 }
343 } 343 }
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 4c04f09338e3..e3c4043c27de 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -312,11 +312,11 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
312 312
313 mss = __cookie_v4_check(ip_hdr(skb), th, cookie); 313 mss = __cookie_v4_check(ip_hdr(skb), th, cookie);
314 if (mss == 0) { 314 if (mss == 0) {
315 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED); 315 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED);
316 goto out; 316 goto out;
317 } 317 }
318 318
319 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); 319 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV);
320 320
321 /* check for timestamp cookie support */ 321 /* check for timestamp cookie support */
322 memset(&tcp_opt, 0, sizeof(tcp_opt)); 322 memset(&tcp_opt, 0, sizeof(tcp_opt));
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 96833433c2c3..040f35e7efe0 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2148,7 +2148,7 @@ adjudge_to_death:
2148 if (tp->linger2 < 0) { 2148 if (tp->linger2 < 0) {
2149 tcp_set_state(sk, TCP_CLOSE); 2149 tcp_set_state(sk, TCP_CLOSE);
2150 tcp_send_active_reset(sk, GFP_ATOMIC); 2150 tcp_send_active_reset(sk, GFP_ATOMIC);
2151 NET_INC_STATS_BH(sock_net(sk), 2151 __NET_INC_STATS(sock_net(sk),
2152 LINUX_MIB_TCPABORTONLINGER); 2152 LINUX_MIB_TCPABORTONLINGER);
2153 } else { 2153 } else {
2154 const int tmo = tcp_fin_time(sk); 2154 const int tmo = tcp_fin_time(sk);
@@ -2167,7 +2167,7 @@ adjudge_to_death:
2167 if (tcp_check_oom(sk, 0)) { 2167 if (tcp_check_oom(sk, 0)) {
2168 tcp_set_state(sk, TCP_CLOSE); 2168 tcp_set_state(sk, TCP_CLOSE);
2169 tcp_send_active_reset(sk, GFP_ATOMIC); 2169 tcp_send_active_reset(sk, GFP_ATOMIC);
2170 NET_INC_STATS_BH(sock_net(sk), 2170 __NET_INC_STATS(sock_net(sk),
2171 LINUX_MIB_TCPABORTONMEMORY); 2171 LINUX_MIB_TCPABORTONMEMORY);
2172 } 2172 }
2173 } 2173 }
diff --git a/net/ipv4/tcp_cdg.c b/net/ipv4/tcp_cdg.c
index 167b6a3e1b98..3c00208c37f4 100644
--- a/net/ipv4/tcp_cdg.c
+++ b/net/ipv4/tcp_cdg.c
@@ -155,11 +155,11 @@ static void tcp_cdg_hystart_update(struct sock *sk)
155 155
156 ca->last_ack = now_us; 156 ca->last_ack = now_us;
157 if (after(now_us, ca->round_start + base_owd)) { 157 if (after(now_us, ca->round_start + base_owd)) {
158 NET_INC_STATS_BH(sock_net(sk), 158 __NET_INC_STATS(sock_net(sk),
159 LINUX_MIB_TCPHYSTARTTRAINDETECT); 159 LINUX_MIB_TCPHYSTARTTRAINDETECT);
160 NET_ADD_STATS_BH(sock_net(sk), 160 __NET_ADD_STATS(sock_net(sk),
161 LINUX_MIB_TCPHYSTARTTRAINCWND, 161 LINUX_MIB_TCPHYSTARTTRAINCWND,
162 tp->snd_cwnd); 162 tp->snd_cwnd);
163 tp->snd_ssthresh = tp->snd_cwnd; 163 tp->snd_ssthresh = tp->snd_cwnd;
164 return; 164 return;
165 } 165 }
@@ -174,11 +174,11 @@ static void tcp_cdg_hystart_update(struct sock *sk)
174 125U); 174 125U);
175 175
176 if (ca->rtt.min > thresh) { 176 if (ca->rtt.min > thresh) {
177 NET_INC_STATS_BH(sock_net(sk), 177 __NET_INC_STATS(sock_net(sk),
178 LINUX_MIB_TCPHYSTARTDELAYDETECT); 178 LINUX_MIB_TCPHYSTARTDELAYDETECT);
179 NET_ADD_STATS_BH(sock_net(sk), 179 __NET_ADD_STATS(sock_net(sk),
180 LINUX_MIB_TCPHYSTARTDELAYCWND, 180 LINUX_MIB_TCPHYSTARTDELAYCWND,
181 tp->snd_cwnd); 181 tp->snd_cwnd);
182 tp->snd_ssthresh = tp->snd_cwnd; 182 tp->snd_ssthresh = tp->snd_cwnd;
183 } 183 }
184 } 184 }
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 448c2615fece..59155af9de5d 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -402,11 +402,11 @@ static void hystart_update(struct sock *sk, u32 delay)
402 ca->last_ack = now; 402 ca->last_ack = now;
403 if ((s32)(now - ca->round_start) > ca->delay_min >> 4) { 403 if ((s32)(now - ca->round_start) > ca->delay_min >> 4) {
404 ca->found |= HYSTART_ACK_TRAIN; 404 ca->found |= HYSTART_ACK_TRAIN;
405 NET_INC_STATS_BH(sock_net(sk), 405 __NET_INC_STATS(sock_net(sk),
406 LINUX_MIB_TCPHYSTARTTRAINDETECT); 406 LINUX_MIB_TCPHYSTARTTRAINDETECT);
407 NET_ADD_STATS_BH(sock_net(sk), 407 __NET_ADD_STATS(sock_net(sk),
408 LINUX_MIB_TCPHYSTARTTRAINCWND, 408 LINUX_MIB_TCPHYSTARTTRAINCWND,
409 tp->snd_cwnd); 409 tp->snd_cwnd);
410 tp->snd_ssthresh = tp->snd_cwnd; 410 tp->snd_ssthresh = tp->snd_cwnd;
411 } 411 }
412 } 412 }
@@ -423,11 +423,11 @@ static void hystart_update(struct sock *sk, u32 delay)
423 if (ca->curr_rtt > ca->delay_min + 423 if (ca->curr_rtt > ca->delay_min +
424 HYSTART_DELAY_THRESH(ca->delay_min >> 3)) { 424 HYSTART_DELAY_THRESH(ca->delay_min >> 3)) {
425 ca->found |= HYSTART_DELAY; 425 ca->found |= HYSTART_DELAY;
426 NET_INC_STATS_BH(sock_net(sk), 426 __NET_INC_STATS(sock_net(sk),
427 LINUX_MIB_TCPHYSTARTDELAYDETECT); 427 LINUX_MIB_TCPHYSTARTDELAYDETECT);
428 NET_ADD_STATS_BH(sock_net(sk), 428 __NET_ADD_STATS(sock_net(sk),
429 LINUX_MIB_TCPHYSTARTDELAYCWND, 429 LINUX_MIB_TCPHYSTARTDELAYCWND,
430 tp->snd_cwnd); 430 tp->snd_cwnd);
431 tp->snd_ssthresh = tp->snd_cwnd; 431 tp->snd_ssthresh = tp->snd_cwnd;
432 } 432 }
433 } 433 }
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index cffd8f9ed1a9..a1498d507e42 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -256,8 +256,8 @@ static bool tcp_fastopen_queue_check(struct sock *sk)
256 req1 = fastopenq->rskq_rst_head; 256 req1 = fastopenq->rskq_rst_head;
257 if (!req1 || time_after(req1->rsk_timer.expires, jiffies)) { 257 if (!req1 || time_after(req1->rsk_timer.expires, jiffies)) {
258 spin_unlock(&fastopenq->lock); 258 spin_unlock(&fastopenq->lock);
259 NET_INC_STATS_BH(sock_net(sk), 259 __NET_INC_STATS(sock_net(sk),
260 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW); 260 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW);
261 return false; 261 return false;
262 } 262 }
263 fastopenq->rskq_rst_head = req1->dl_next; 263 fastopenq->rskq_rst_head = req1->dl_next;
@@ -282,7 +282,7 @@ struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
282 struct sock *child; 282 struct sock *child;
283 283
284 if (foc->len == 0) /* Client requests a cookie */ 284 if (foc->len == 0) /* Client requests a cookie */
285 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENCOOKIEREQD); 285 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENCOOKIEREQD);
286 286
287 if (!((sysctl_tcp_fastopen & TFO_SERVER_ENABLE) && 287 if (!((sysctl_tcp_fastopen & TFO_SERVER_ENABLE) &&
288 (syn_data || foc->len >= 0) && 288 (syn_data || foc->len >= 0) &&
@@ -311,13 +311,13 @@ fastopen:
311 child = tcp_fastopen_create_child(sk, skb, dst, req); 311 child = tcp_fastopen_create_child(sk, skb, dst, req);
312 if (child) { 312 if (child) {
313 foc->len = -1; 313 foc->len = -1;
314 NET_INC_STATS_BH(sock_net(sk), 314 __NET_INC_STATS(sock_net(sk),
315 LINUX_MIB_TCPFASTOPENPASSIVE); 315 LINUX_MIB_TCPFASTOPENPASSIVE);
316 return child; 316 return child;
317 } 317 }
318 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL); 318 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL);
319 } else if (foc->len > 0) /* Client presents an invalid cookie */ 319 } else if (foc->len > 0) /* Client presents an invalid cookie */
320 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL); 320 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL);
321 321
322 valid_foc.exp = foc->exp; 322 valid_foc.exp = foc->exp;
323 *foc = valid_foc; 323 *foc = valid_foc;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index dad8d93262ed..0d5239c283cb 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -869,7 +869,7 @@ static void tcp_update_reordering(struct sock *sk, const int metric,
869 else 869 else
870 mib_idx = LINUX_MIB_TCPSACKREORDER; 870 mib_idx = LINUX_MIB_TCPSACKREORDER;
871 871
872 NET_INC_STATS_BH(sock_net(sk), mib_idx); 872 __NET_INC_STATS(sock_net(sk), mib_idx);
873#if FASTRETRANS_DEBUG > 1 873#if FASTRETRANS_DEBUG > 1
874 pr_debug("Disorder%d %d %u f%u s%u rr%d\n", 874 pr_debug("Disorder%d %d %u f%u s%u rr%d\n",
875 tp->rx_opt.sack_ok, inet_csk(sk)->icsk_ca_state, 875 tp->rx_opt.sack_ok, inet_csk(sk)->icsk_ca_state,
@@ -1062,7 +1062,7 @@ static bool tcp_check_dsack(struct sock *sk, const struct sk_buff *ack_skb,
1062 if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) { 1062 if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) {
1063 dup_sack = true; 1063 dup_sack = true;
1064 tcp_dsack_seen(tp); 1064 tcp_dsack_seen(tp);
1065 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDSACKRECV); 1065 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPDSACKRECV);
1066 } else if (num_sacks > 1) { 1066 } else if (num_sacks > 1) {
1067 u32 end_seq_1 = get_unaligned_be32(&sp[1].end_seq); 1067 u32 end_seq_1 = get_unaligned_be32(&sp[1].end_seq);
1068 u32 start_seq_1 = get_unaligned_be32(&sp[1].start_seq); 1068 u32 start_seq_1 = get_unaligned_be32(&sp[1].start_seq);
@@ -1071,7 +1071,7 @@ static bool tcp_check_dsack(struct sock *sk, const struct sk_buff *ack_skb,
1071 !before(start_seq_0, start_seq_1)) { 1071 !before(start_seq_0, start_seq_1)) {
1072 dup_sack = true; 1072 dup_sack = true;
1073 tcp_dsack_seen(tp); 1073 tcp_dsack_seen(tp);
1074 NET_INC_STATS_BH(sock_net(sk), 1074 __NET_INC_STATS(sock_net(sk),
1075 LINUX_MIB_TCPDSACKOFORECV); 1075 LINUX_MIB_TCPDSACKOFORECV);
1076 } 1076 }
1077 } 1077 }
@@ -1289,7 +1289,7 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
1289 1289
1290 if (skb->len > 0) { 1290 if (skb->len > 0) {
1291 BUG_ON(!tcp_skb_pcount(skb)); 1291 BUG_ON(!tcp_skb_pcount(skb));
1292 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SACKSHIFTED); 1292 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SACKSHIFTED);
1293 return false; 1293 return false;
1294 } 1294 }
1295 1295
@@ -1313,7 +1313,7 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
1313 tcp_unlink_write_queue(skb, sk); 1313 tcp_unlink_write_queue(skb, sk);
1314 sk_wmem_free_skb(sk, skb); 1314 sk_wmem_free_skb(sk, skb);
1315 1315
1316 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SACKMERGED); 1316 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SACKMERGED);
1317 1317
1318 return true; 1318 return true;
1319} 1319}
@@ -1469,7 +1469,7 @@ noop:
1469 return skb; 1469 return skb;
1470 1470
1471fallback: 1471fallback:
1472 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SACKSHIFTFALLBACK); 1472 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SACKSHIFTFALLBACK);
1473 return NULL; 1473 return NULL;
1474} 1474}
1475 1475
@@ -1657,7 +1657,7 @@ tcp_sacktag_write_queue(struct sock *sk, const struct sk_buff *ack_skb,
1657 mib_idx = LINUX_MIB_TCPSACKDISCARD; 1657 mib_idx = LINUX_MIB_TCPSACKDISCARD;
1658 } 1658 }
1659 1659
1660 NET_INC_STATS_BH(sock_net(sk), mib_idx); 1660 __NET_INC_STATS(sock_net(sk), mib_idx);
1661 if (i == 0) 1661 if (i == 0)
1662 first_sack_index = -1; 1662 first_sack_index = -1;
1663 continue; 1663 continue;
@@ -1909,7 +1909,7 @@ void tcp_enter_loss(struct sock *sk)
1909 skb = tcp_write_queue_head(sk); 1909 skb = tcp_write_queue_head(sk);
1910 is_reneg = skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED); 1910 is_reneg = skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED);
1911 if (is_reneg) { 1911 if (is_reneg) {
1912 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSACKRENEGING); 1912 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSACKRENEGING);
1913 tp->sacked_out = 0; 1913 tp->sacked_out = 0;
1914 tp->fackets_out = 0; 1914 tp->fackets_out = 0;
1915 } 1915 }
@@ -2395,7 +2395,7 @@ static bool tcp_try_undo_recovery(struct sock *sk)
2395 else 2395 else
2396 mib_idx = LINUX_MIB_TCPFULLUNDO; 2396 mib_idx = LINUX_MIB_TCPFULLUNDO;
2397 2397
2398 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2398 __NET_INC_STATS(sock_net(sk), mib_idx);
2399 } 2399 }
2400 if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) { 2400 if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) {
2401 /* Hold old state until something *above* high_seq 2401 /* Hold old state until something *above* high_seq
@@ -2417,7 +2417,7 @@ static bool tcp_try_undo_dsack(struct sock *sk)
2417 if (tp->undo_marker && !tp->undo_retrans) { 2417 if (tp->undo_marker && !tp->undo_retrans) {
2418 DBGUNDO(sk, "D-SACK"); 2418 DBGUNDO(sk, "D-SACK");
2419 tcp_undo_cwnd_reduction(sk, false); 2419 tcp_undo_cwnd_reduction(sk, false);
2420 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDSACKUNDO); 2420 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPDSACKUNDO);
2421 return true; 2421 return true;
2422 } 2422 }
2423 return false; 2423 return false;
@@ -2432,10 +2432,10 @@ static bool tcp_try_undo_loss(struct sock *sk, bool frto_undo)
2432 tcp_undo_cwnd_reduction(sk, true); 2432 tcp_undo_cwnd_reduction(sk, true);
2433 2433
2434 DBGUNDO(sk, "partial loss"); 2434 DBGUNDO(sk, "partial loss");
2435 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPLOSSUNDO); 2435 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPLOSSUNDO);
2436 if (frto_undo) 2436 if (frto_undo)
2437 NET_INC_STATS_BH(sock_net(sk), 2437 __NET_INC_STATS(sock_net(sk),
2438 LINUX_MIB_TCPSPURIOUSRTOS); 2438 LINUX_MIB_TCPSPURIOUSRTOS);
2439 inet_csk(sk)->icsk_retransmits = 0; 2439 inet_csk(sk)->icsk_retransmits = 0;
2440 if (frto_undo || tcp_is_sack(tp)) 2440 if (frto_undo || tcp_is_sack(tp))
2441 tcp_set_ca_state(sk, TCP_CA_Open); 2441 tcp_set_ca_state(sk, TCP_CA_Open);
@@ -2559,7 +2559,7 @@ static void tcp_mtup_probe_failed(struct sock *sk)
2559 2559
2560 icsk->icsk_mtup.search_high = icsk->icsk_mtup.probe_size - 1; 2560 icsk->icsk_mtup.search_high = icsk->icsk_mtup.probe_size - 1;
2561 icsk->icsk_mtup.probe_size = 0; 2561 icsk->icsk_mtup.probe_size = 0;
2562 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMTUPFAIL); 2562 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMTUPFAIL);
2563} 2563}
2564 2564
2565static void tcp_mtup_probe_success(struct sock *sk) 2565static void tcp_mtup_probe_success(struct sock *sk)
@@ -2579,7 +2579,7 @@ static void tcp_mtup_probe_success(struct sock *sk)
2579 icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size; 2579 icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size;
2580 icsk->icsk_mtup.probe_size = 0; 2580 icsk->icsk_mtup.probe_size = 0;
2581 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); 2581 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
2582 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMTUPSUCCESS); 2582 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMTUPSUCCESS);
2583} 2583}
2584 2584
2585/* Do a simple retransmit without using the backoff mechanisms in 2585/* Do a simple retransmit without using the backoff mechanisms in
@@ -2643,7 +2643,7 @@ static void tcp_enter_recovery(struct sock *sk, bool ece_ack)
2643 else 2643 else
2644 mib_idx = LINUX_MIB_TCPSACKRECOVERY; 2644 mib_idx = LINUX_MIB_TCPSACKRECOVERY;
2645 2645
2646 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2646 __NET_INC_STATS(sock_net(sk), mib_idx);
2647 2647
2648 tp->prior_ssthresh = 0; 2648 tp->prior_ssthresh = 0;
2649 tcp_init_undo(tp); 2649 tcp_init_undo(tp);
@@ -2736,7 +2736,7 @@ static bool tcp_try_undo_partial(struct sock *sk, const int acked)
2736 2736
2737 DBGUNDO(sk, "partial recovery"); 2737 DBGUNDO(sk, "partial recovery");
2738 tcp_undo_cwnd_reduction(sk, true); 2738 tcp_undo_cwnd_reduction(sk, true);
2739 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPARTIALUNDO); 2739 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPPARTIALUNDO);
2740 tcp_try_keep_open(sk); 2740 tcp_try_keep_open(sk);
2741 return true; 2741 return true;
2742 } 2742 }
@@ -3431,7 +3431,7 @@ bool tcp_oow_rate_limited(struct net *net, const struct sk_buff *skb,
3431 s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time); 3431 s32 elapsed = (s32)(tcp_time_stamp - *last_oow_ack_time);
3432 3432
3433 if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) { 3433 if (0 <= elapsed && elapsed < sysctl_tcp_invalid_ratelimit) {
3434 NET_INC_STATS_BH(net, mib_idx); 3434 __NET_INC_STATS(net, mib_idx);
3435 return true; /* rate-limited: don't send yet! */ 3435 return true; /* rate-limited: don't send yet! */
3436 } 3436 }
3437 } 3437 }
@@ -3464,7 +3464,7 @@ static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb)
3464 challenge_count = 0; 3464 challenge_count = 0;
3465 } 3465 }
3466 if (++challenge_count <= sysctl_tcp_challenge_ack_limit) { 3466 if (++challenge_count <= sysctl_tcp_challenge_ack_limit) {
3467 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK); 3467 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK);
3468 tcp_send_ack(sk); 3468 tcp_send_ack(sk);
3469 } 3469 }
3470} 3470}
@@ -3513,8 +3513,8 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag)
3513 tcp_set_ca_state(sk, TCP_CA_CWR); 3513 tcp_set_ca_state(sk, TCP_CA_CWR);
3514 tcp_end_cwnd_reduction(sk); 3514 tcp_end_cwnd_reduction(sk);
3515 tcp_try_keep_open(sk); 3515 tcp_try_keep_open(sk);
3516 NET_INC_STATS_BH(sock_net(sk), 3516 __NET_INC_STATS(sock_net(sk),
3517 LINUX_MIB_TCPLOSSPROBERECOVERY); 3517 LINUX_MIB_TCPLOSSPROBERECOVERY);
3518 } else if (!(flag & (FLAG_SND_UNA_ADVANCED | 3518 } else if (!(flag & (FLAG_SND_UNA_ADVANCED |
3519 FLAG_NOT_DUP | FLAG_DATA_SACKED))) { 3519 FLAG_NOT_DUP | FLAG_DATA_SACKED))) {
3520 /* Pure dupack: original and TLP probe arrived; no loss */ 3520 /* Pure dupack: original and TLP probe arrived; no loss */
@@ -3618,14 +3618,14 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
3618 3618
3619 tcp_in_ack_event(sk, CA_ACK_WIN_UPDATE); 3619 tcp_in_ack_event(sk, CA_ACK_WIN_UPDATE);
3620 3620
3621 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPACKS); 3621 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPHPACKS);
3622 } else { 3622 } else {
3623 u32 ack_ev_flags = CA_ACK_SLOWPATH; 3623 u32 ack_ev_flags = CA_ACK_SLOWPATH;
3624 3624
3625 if (ack_seq != TCP_SKB_CB(skb)->end_seq) 3625 if (ack_seq != TCP_SKB_CB(skb)->end_seq)
3626 flag |= FLAG_DATA; 3626 flag |= FLAG_DATA;
3627 else 3627 else
3628 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPUREACKS); 3628 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPPUREACKS);
3629 3629
3630 flag |= tcp_ack_update_window(sk, skb, ack, ack_seq); 3630 flag |= tcp_ack_update_window(sk, skb, ack, ack_seq);
3631 3631
@@ -4128,7 +4128,7 @@ static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
4128 else 4128 else
4129 mib_idx = LINUX_MIB_TCPDSACKOFOSENT; 4129 mib_idx = LINUX_MIB_TCPDSACKOFOSENT;
4130 4130
4131 NET_INC_STATS_BH(sock_net(sk), mib_idx); 4131 __NET_INC_STATS(sock_net(sk), mib_idx);
4132 4132
4133 tp->rx_opt.dsack = 1; 4133 tp->rx_opt.dsack = 1;
4134 tp->duplicate_sack[0].start_seq = seq; 4134 tp->duplicate_sack[0].start_seq = seq;
@@ -4152,7 +4152,7 @@ static void tcp_send_dupack(struct sock *sk, const struct sk_buff *skb)
4152 4152
4153 if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && 4153 if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
4154 before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { 4154 before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
4155 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST); 4155 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
4156 tcp_enter_quickack_mode(sk); 4156 tcp_enter_quickack_mode(sk);
4157 4157
4158 if (tcp_is_sack(tp) && sysctl_tcp_dsack) { 4158 if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
@@ -4302,7 +4302,7 @@ static bool tcp_try_coalesce(struct sock *sk,
4302 4302
4303 atomic_add(delta, &sk->sk_rmem_alloc); 4303 atomic_add(delta, &sk->sk_rmem_alloc);
4304 sk_mem_charge(sk, delta); 4304 sk_mem_charge(sk, delta);
4305 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRCVCOALESCE); 4305 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVCOALESCE);
4306 TCP_SKB_CB(to)->end_seq = TCP_SKB_CB(from)->end_seq; 4306 TCP_SKB_CB(to)->end_seq = TCP_SKB_CB(from)->end_seq;
4307 TCP_SKB_CB(to)->ack_seq = TCP_SKB_CB(from)->ack_seq; 4307 TCP_SKB_CB(to)->ack_seq = TCP_SKB_CB(from)->ack_seq;
4308 TCP_SKB_CB(to)->tcp_flags |= TCP_SKB_CB(from)->tcp_flags; 4308 TCP_SKB_CB(to)->tcp_flags |= TCP_SKB_CB(from)->tcp_flags;
@@ -4390,7 +4390,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4390 tcp_ecn_check_ce(tp, skb); 4390 tcp_ecn_check_ce(tp, skb);
4391 4391
4392 if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) { 4392 if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
4393 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFODROP); 4393 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
4394 tcp_drop(sk, skb); 4394 tcp_drop(sk, skb);
4395 return; 4395 return;
4396 } 4396 }
@@ -4399,7 +4399,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4399 tp->pred_flags = 0; 4399 tp->pred_flags = 0;
4400 inet_csk_schedule_ack(sk); 4400 inet_csk_schedule_ack(sk);
4401 4401
4402 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOQUEUE); 4402 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOQUEUE);
4403 SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n", 4403 SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
4404 tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); 4404 tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
4405 4405
@@ -4454,7 +4454,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4454 if (skb1 && before(seq, TCP_SKB_CB(skb1)->end_seq)) { 4454 if (skb1 && before(seq, TCP_SKB_CB(skb1)->end_seq)) {
4455 if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) { 4455 if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) {
4456 /* All the bits are present. Drop. */ 4456 /* All the bits are present. Drop. */
4457 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOMERGE); 4457 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE);
4458 tcp_drop(sk, skb); 4458 tcp_drop(sk, skb);
4459 skb = NULL; 4459 skb = NULL;
4460 tcp_dsack_set(sk, seq, end_seq); 4460 tcp_dsack_set(sk, seq, end_seq);
@@ -4493,7 +4493,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4493 __skb_unlink(skb1, &tp->out_of_order_queue); 4493 __skb_unlink(skb1, &tp->out_of_order_queue);
4494 tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq, 4494 tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq,
4495 TCP_SKB_CB(skb1)->end_seq); 4495 TCP_SKB_CB(skb1)->end_seq);
4496 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOMERGE); 4496 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOMERGE);
4497 tcp_drop(sk, skb1); 4497 tcp_drop(sk, skb1);
4498 } 4498 }
4499 4499
@@ -4658,7 +4658,7 @@ queue_and_out:
4658 4658
4659 if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { 4659 if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
4660 /* A retransmit, 2nd most common case. Force an immediate ack. */ 4660 /* A retransmit, 2nd most common case. Force an immediate ack. */
4661 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST); 4661 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
4662 tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); 4662 tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
4663 4663
4664out_of_window: 4664out_of_window:
@@ -4704,7 +4704,7 @@ static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb,
4704 4704
4705 __skb_unlink(skb, list); 4705 __skb_unlink(skb, list);
4706 __kfree_skb(skb); 4706 __kfree_skb(skb);
4707 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRCVCOLLAPSED); 4707 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVCOLLAPSED);
4708 4708
4709 return next; 4709 return next;
4710} 4710}
@@ -4863,7 +4863,7 @@ static bool tcp_prune_ofo_queue(struct sock *sk)
4863 bool res = false; 4863 bool res = false;
4864 4864
4865 if (!skb_queue_empty(&tp->out_of_order_queue)) { 4865 if (!skb_queue_empty(&tp->out_of_order_queue)) {
4866 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_OFOPRUNED); 4866 __NET_INC_STATS(sock_net(sk), LINUX_MIB_OFOPRUNED);
4867 __skb_queue_purge(&tp->out_of_order_queue); 4867 __skb_queue_purge(&tp->out_of_order_queue);
4868 4868
4869 /* Reset SACK state. A conforming SACK implementation will 4869 /* Reset SACK state. A conforming SACK implementation will
@@ -4892,7 +4892,7 @@ static int tcp_prune_queue(struct sock *sk)
4892 4892
4893 SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq); 4893 SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq);
4894 4894
4895 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PRUNECALLED); 4895 __NET_INC_STATS(sock_net(sk), LINUX_MIB_PRUNECALLED);
4896 4896
4897 if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) 4897 if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
4898 tcp_clamp_window(sk); 4898 tcp_clamp_window(sk);
@@ -4922,7 +4922,7 @@ static int tcp_prune_queue(struct sock *sk)
4922 * drop receive data on the floor. It will get retransmitted 4922 * drop receive data on the floor. It will get retransmitted
4923 * and hopefully then we'll have sufficient space. 4923 * and hopefully then we'll have sufficient space.
4924 */ 4924 */
4925 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_RCVPRUNED); 4925 __NET_INC_STATS(sock_net(sk), LINUX_MIB_RCVPRUNED);
4926 4926
4927 /* Massive buffer overcommit. */ 4927 /* Massive buffer overcommit. */
4928 tp->pred_flags = 0; 4928 tp->pred_flags = 0;
@@ -5181,7 +5181,7 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
5181 if (tcp_fast_parse_options(skb, th, tp) && tp->rx_opt.saw_tstamp && 5181 if (tcp_fast_parse_options(skb, th, tp) && tp->rx_opt.saw_tstamp &&
5182 tcp_paws_discard(sk, skb)) { 5182 tcp_paws_discard(sk, skb)) {
5183 if (!th->rst) { 5183 if (!th->rst) {
5184 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED); 5184 __NET_INC_STATS(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED);
5185 if (!tcp_oow_rate_limited(sock_net(sk), skb, 5185 if (!tcp_oow_rate_limited(sock_net(sk), skb,
5186 LINUX_MIB_TCPACKSKIPPEDPAWS, 5186 LINUX_MIB_TCPACKSKIPPEDPAWS,
5187 &tp->last_oow_ack_time)) 5187 &tp->last_oow_ack_time))
@@ -5234,7 +5234,7 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
5234syn_challenge: 5234syn_challenge:
5235 if (syn_inerr) 5235 if (syn_inerr)
5236 __TCP_INC_STATS(sock_net(sk), TCP_MIB_INERRS); 5236 __TCP_INC_STATS(sock_net(sk), TCP_MIB_INERRS);
5237 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNCHALLENGE); 5237 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNCHALLENGE);
5238 tcp_send_challenge_ack(sk, skb); 5238 tcp_send_challenge_ack(sk, skb);
5239 goto discard; 5239 goto discard;
5240 } 5240 }
@@ -5377,7 +5377,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
5377 5377
5378 __skb_pull(skb, tcp_header_len); 5378 __skb_pull(skb, tcp_header_len);
5379 tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq); 5379 tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq);
5380 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITSTOUSER); 5380 __NET_INC_STATS(sock_net(sk),
5381 LINUX_MIB_TCPHPHITSTOUSER);
5381 eaten = 1; 5382 eaten = 1;
5382 } 5383 }
5383 } 5384 }
@@ -5399,7 +5400,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
5399 5400
5400 tcp_rcv_rtt_measure_ts(sk, skb); 5401 tcp_rcv_rtt_measure_ts(sk, skb);
5401 5402
5402 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITS); 5403 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPHPHITS);
5403 5404
5404 /* Bulk data transfer: receiver */ 5405 /* Bulk data transfer: receiver */
5405 eaten = tcp_queue_rcv(sk, skb, tcp_header_len, 5406 eaten = tcp_queue_rcv(sk, skb, tcp_header_len,
@@ -5549,12 +5550,14 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack,
5549 break; 5550 break;
5550 } 5551 }
5551 tcp_rearm_rto(sk); 5552 tcp_rearm_rto(sk);
5552 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVEFAIL); 5553 __NET_INC_STATS(sock_net(sk),
5554 LINUX_MIB_TCPFASTOPENACTIVEFAIL);
5553 return true; 5555 return true;
5554 } 5556 }
5555 tp->syn_data_acked = tp->syn_data; 5557 tp->syn_data_acked = tp->syn_data;
5556 if (tp->syn_data_acked) 5558 if (tp->syn_data_acked)
5557 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVE); 5559 __NET_INC_STATS(sock_net(sk),
5560 LINUX_MIB_TCPFASTOPENACTIVE);
5558 5561
5559 tcp_fastopen_add_skb(sk, synack); 5562 tcp_fastopen_add_skb(sk, synack);
5560 5563
@@ -5589,7 +5592,8 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
5589 if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && 5592 if (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
5590 !between(tp->rx_opt.rcv_tsecr, tp->retrans_stamp, 5593 !between(tp->rx_opt.rcv_tsecr, tp->retrans_stamp,
5591 tcp_time_stamp)) { 5594 tcp_time_stamp)) {
5592 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSACTIVEREJECTED); 5595 __NET_INC_STATS(sock_net(sk),
5596 LINUX_MIB_PAWSACTIVEREJECTED);
5593 goto reset_and_undo; 5597 goto reset_and_undo;
5594 } 5598 }
5595 5599
@@ -5958,7 +5962,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
5958 (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && 5962 (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
5959 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) { 5963 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) {
5960 tcp_done(sk); 5964 tcp_done(sk);
5961 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONDATA); 5965 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONDATA);
5962 return 1; 5966 return 1;
5963 } 5967 }
5964 5968
@@ -6015,7 +6019,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
6015 if (sk->sk_shutdown & RCV_SHUTDOWN) { 6019 if (sk->sk_shutdown & RCV_SHUTDOWN) {
6016 if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && 6020 if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
6017 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { 6021 after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) {
6018 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONDATA); 6022 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONDATA);
6019 tcp_reset(sk); 6023 tcp_reset(sk);
6020 return 1; 6024 return 1;
6021 } 6025 }
@@ -6153,10 +6157,10 @@ static bool tcp_syn_flood_action(const struct sock *sk,
6153 if (net->ipv4.sysctl_tcp_syncookies) { 6157 if (net->ipv4.sysctl_tcp_syncookies) {
6154 msg = "Sending cookies"; 6158 msg = "Sending cookies";
6155 want_cookie = true; 6159 want_cookie = true;
6156 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDOCOOKIES); 6160 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPREQQFULLDOCOOKIES);
6157 } else 6161 } else
6158#endif 6162#endif
6159 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP); 6163 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP);
6160 6164
6161 if (!queue->synflood_warned && 6165 if (!queue->synflood_warned &&
6162 net->ipv4.sysctl_tcp_syncookies != 2 && 6166 net->ipv4.sysctl_tcp_syncookies != 2 &&
@@ -6217,7 +6221,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
6217 * timeout. 6221 * timeout.
6218 */ 6222 */
6219 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) { 6223 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
6220 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); 6224 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
6221 goto drop; 6225 goto drop;
6222 } 6226 }
6223 6227
@@ -6264,7 +6268,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
6264 if (dst && strict && 6268 if (dst && strict &&
6265 !tcp_peer_is_proven(req, dst, true, 6269 !tcp_peer_is_proven(req, dst, true,
6266 tmp_opt.saw_tstamp)) { 6270 tmp_opt.saw_tstamp)) {
6267 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED); 6271 __NET_INC_STATS(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED);
6268 goto drop_and_release; 6272 goto drop_and_release;
6269 } 6273 }
6270 } 6274 }
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 378e92d41c6c..510f7a3c758b 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -320,7 +320,7 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort)
320 * an established socket here. 320 * an established socket here.
321 */ 321 */
322 if (seq != tcp_rsk(req)->snt_isn) { 322 if (seq != tcp_rsk(req)->snt_isn) {
323 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 323 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
324 } else if (abort) { 324 } else if (abort) {
325 /* 325 /*
326 * Still in SYN_RECV, just remove it silently. 326 * Still in SYN_RECV, just remove it silently.
@@ -396,13 +396,13 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
396 */ 396 */
397 if (sock_owned_by_user(sk)) { 397 if (sock_owned_by_user(sk)) {
398 if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)) 398 if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
399 NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); 399 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
400 } 400 }
401 if (sk->sk_state == TCP_CLOSE) 401 if (sk->sk_state == TCP_CLOSE)
402 goto out; 402 goto out;
403 403
404 if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) { 404 if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
405 NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); 405 __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP);
406 goto out; 406 goto out;
407 } 407 }
408 408
@@ -413,7 +413,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
413 snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una; 413 snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una;
414 if (sk->sk_state != TCP_LISTEN && 414 if (sk->sk_state != TCP_LISTEN &&
415 !between(seq, snd_una, tp->snd_nxt)) { 415 !between(seq, snd_una, tp->snd_nxt)) {
416 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 416 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
417 goto out; 417 goto out;
418 } 418 }
419 419
@@ -1151,12 +1151,12 @@ static bool tcp_v4_inbound_md5_hash(const struct sock *sk,
1151 return false; 1151 return false;
1152 1152
1153 if (hash_expected && !hash_location) { 1153 if (hash_expected && !hash_location) {
1154 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMD5NOTFOUND); 1154 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5NOTFOUND);
1155 return true; 1155 return true;
1156 } 1156 }
1157 1157
1158 if (!hash_expected && hash_location) { 1158 if (!hash_expected && hash_location) {
1159 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMD5UNEXPECTED); 1159 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5UNEXPECTED);
1160 return true; 1160 return true;
1161 } 1161 }
1162 1162
@@ -1342,7 +1342,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
1342 return newsk; 1342 return newsk;
1343 1343
1344exit_overflow: 1344exit_overflow:
1345 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); 1345 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
1346exit_nonewsk: 1346exit_nonewsk:
1347 dst_release(dst); 1347 dst_release(dst);
1348exit: 1348exit:
@@ -1513,8 +1513,8 @@ bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)
1513 1513
1514 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { 1514 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
1515 sk_backlog_rcv(sk, skb1); 1515 sk_backlog_rcv(sk, skb1);
1516 NET_INC_STATS_BH(sock_net(sk), 1516 __NET_INC_STATS(sock_net(sk),
1517 LINUX_MIB_TCPPREQUEUEDROPPED); 1517 LINUX_MIB_TCPPREQUEUEDROPPED);
1518 } 1518 }
1519 1519
1520 tp->ucopy.memory = 0; 1520 tp->ucopy.memory = 0;
@@ -1629,7 +1629,7 @@ process:
1629 } 1629 }
1630 } 1630 }
1631 if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) { 1631 if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
1632 NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); 1632 __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP);
1633 goto discard_and_relse; 1633 goto discard_and_relse;
1634 } 1634 }
1635 1635
@@ -1662,7 +1662,7 @@ process:
1662 } else if (unlikely(sk_add_backlog(sk, skb, 1662 } else if (unlikely(sk_add_backlog(sk, skb,
1663 sk->sk_rcvbuf + sk->sk_sndbuf))) { 1663 sk->sk_rcvbuf + sk->sk_sndbuf))) {
1664 bh_unlock_sock(sk); 1664 bh_unlock_sock(sk);
1665 NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP); 1665 __NET_INC_STATS(net, LINUX_MIB_TCPBACKLOGDROP);
1666 goto discard_and_relse; 1666 goto discard_and_relse;
1667 } 1667 }
1668 bh_unlock_sock(sk); 1668 bh_unlock_sock(sk);
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 0be6bfeab553..ffbfecdae471 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -235,7 +235,7 @@ kill:
235 } 235 }
236 236
237 if (paws_reject) 237 if (paws_reject)
238 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_PAWSESTABREJECTED); 238 __NET_INC_STATS(twsk_net(tw), LINUX_MIB_PAWSESTABREJECTED);
239 239
240 if (!th->rst) { 240 if (!th->rst) {
241 /* In this case we must reset the TIMEWAIT timer. 241 /* In this case we must reset the TIMEWAIT timer.
@@ -337,7 +337,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
337 * socket up. We've got bigger problems than 337 * socket up. We've got bigger problems than
338 * non-graceful socket closings. 338 * non-graceful socket closings.
339 */ 339 */
340 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW); 340 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW);
341 } 341 }
342 342
343 tcp_update_metrics(sk); 343 tcp_update_metrics(sk);
@@ -710,7 +710,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
710 &tcp_rsk(req)->last_oow_ack_time)) 710 &tcp_rsk(req)->last_oow_ack_time))
711 req->rsk_ops->send_ack(sk, skb, req); 711 req->rsk_ops->send_ack(sk, skb, req);
712 if (paws_reject) 712 if (paws_reject)
713 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED); 713 __NET_INC_STATS(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED);
714 return NULL; 714 return NULL;
715 } 715 }
716 716
@@ -752,7 +752,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
752 if (req->num_timeout < inet_csk(sk)->icsk_accept_queue.rskq_defer_accept && 752 if (req->num_timeout < inet_csk(sk)->icsk_accept_queue.rskq_defer_accept &&
753 TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) { 753 TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) {
754 inet_rsk(req)->acked = 1; 754 inet_rsk(req)->acked = 1;
755 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDEFERACCEPTDROP); 755 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPDEFERACCEPTDROP);
756 return NULL; 756 return NULL;
757 } 757 }
758 758
@@ -791,7 +791,7 @@ embryonic_reset:
791 } 791 }
792 if (!fastopen) { 792 if (!fastopen) {
793 inet_csk_reqsk_queue_drop(sk, req); 793 inet_csk_reqsk_queue_drop(sk, req);
794 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS); 794 __NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
795 } 795 }
796 return NULL; 796 return NULL;
797} 797}
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index c48baf734e8c..b1b2045ac3a9 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2212,8 +2212,8 @@ static bool skb_still_in_host_queue(const struct sock *sk,
2212 const struct sk_buff *skb) 2212 const struct sk_buff *skb)
2213{ 2213{
2214 if (unlikely(skb_fclone_busy(sk, skb))) { 2214 if (unlikely(skb_fclone_busy(sk, skb))) {
2215 NET_INC_STATS_BH(sock_net(sk), 2215 __NET_INC_STATS(sock_net(sk),
2216 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES); 2216 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES);
2217 return true; 2217 return true;
2218 } 2218 }
2219 return false; 2219 return false;
@@ -2275,7 +2275,7 @@ void tcp_send_loss_probe(struct sock *sk)
2275 tp->tlp_high_seq = tp->snd_nxt; 2275 tp->tlp_high_seq = tp->snd_nxt;
2276 2276
2277probe_sent: 2277probe_sent:
2278 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPLOSSPROBES); 2278 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPLOSSPROBES);
2279 /* Reset s.t. tcp_rearm_rto will restart timer from now */ 2279 /* Reset s.t. tcp_rearm_rto will restart timer from now */
2280 inet_csk(sk)->icsk_pending = 0; 2280 inet_csk(sk)->icsk_pending = 0;
2281rearm_timer: 2281rearm_timer:
@@ -2656,7 +2656,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
2656 /* Update global TCP statistics. */ 2656 /* Update global TCP statistics. */
2657 TCP_ADD_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS, segs); 2657 TCP_ADD_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS, segs);
2658 if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) 2658 if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)
2659 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); 2659 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS);
2660 tp->total_retrans += segs; 2660 tp->total_retrans += segs;
2661 } 2661 }
2662 return err; 2662 return err;
@@ -2681,7 +2681,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
2681 tp->retrans_stamp = tcp_skb_timestamp(skb); 2681 tp->retrans_stamp = tcp_skb_timestamp(skb);
2682 2682
2683 } else if (err != -EBUSY) { 2683 } else if (err != -EBUSY) {
2684 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL); 2684 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
2685 } 2685 }
2686 2686
2687 if (tp->undo_retrans < 0) 2687 if (tp->undo_retrans < 0)
@@ -2805,7 +2805,7 @@ begin_fwd:
2805 if (tcp_retransmit_skb(sk, skb, segs)) 2805 if (tcp_retransmit_skb(sk, skb, segs))
2806 return; 2806 return;
2807 2807
2808 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2808 __NET_INC_STATS(sock_net(sk), mib_idx);
2809 2809
2810 if (tcp_in_cwnd_reduction(sk)) 2810 if (tcp_in_cwnd_reduction(sk))
2811 tp->prr_out += tcp_skb_pcount(skb); 2811 tp->prr_out += tcp_skb_pcount(skb);
@@ -3541,7 +3541,7 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
3541 res = af_ops->send_synack(sk, NULL, &fl, req, NULL, TCP_SYNACK_NORMAL); 3541 res = af_ops->send_synack(sk, NULL, &fl, req, NULL, TCP_SYNACK_NORMAL);
3542 if (!res) { 3542 if (!res) {
3543 __TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS); 3543 __TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS);
3544 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); 3544 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSYNRETRANS);
3545 } 3545 }
3546 return res; 3546 return res;
3547} 3547}
diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c
index 5353085fd0b2..e0d0afaf15be 100644
--- a/net/ipv4/tcp_recovery.c
+++ b/net/ipv4/tcp_recovery.c
@@ -65,8 +65,8 @@ int tcp_rack_mark_lost(struct sock *sk)
65 if (scb->sacked & TCPCB_SACKED_RETRANS) { 65 if (scb->sacked & TCPCB_SACKED_RETRANS) {
66 scb->sacked &= ~TCPCB_SACKED_RETRANS; 66 scb->sacked &= ~TCPCB_SACKED_RETRANS;
67 tp->retrans_out -= tcp_skb_pcount(skb); 67 tp->retrans_out -= tcp_skb_pcount(skb);
68 NET_INC_STATS_BH(sock_net(sk), 68 __NET_INC_STATS(sock_net(sk),
69 LINUX_MIB_TCPLOSTRETRANSMIT); 69 LINUX_MIB_TCPLOSTRETRANSMIT);
70 } 70 }
71 } else if (!(scb->sacked & TCPCB_RETRANS)) { 71 } else if (!(scb->sacked & TCPCB_RETRANS)) {
72 /* Original data are sent sequentially so stop early 72 /* Original data are sent sequentially so stop early
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 373b03e78aaa..35f643d8ffbb 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -30,7 +30,7 @@ static void tcp_write_err(struct sock *sk)
30 sk->sk_error_report(sk); 30 sk->sk_error_report(sk);
31 31
32 tcp_done(sk); 32 tcp_done(sk);
33 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONTIMEOUT); 33 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONTIMEOUT);
34} 34}
35 35
36/* Do not allow orphaned sockets to eat all our resources. 36/* Do not allow orphaned sockets to eat all our resources.
@@ -68,7 +68,7 @@ static int tcp_out_of_resources(struct sock *sk, bool do_reset)
68 if (do_reset) 68 if (do_reset)
69 tcp_send_active_reset(sk, GFP_ATOMIC); 69 tcp_send_active_reset(sk, GFP_ATOMIC);
70 tcp_done(sk); 70 tcp_done(sk);
71 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); 71 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY);
72 return 1; 72 return 1;
73 } 73 }
74 return 0; 74 return 0;
@@ -162,8 +162,8 @@ static int tcp_write_timeout(struct sock *sk)
162 if (tp->syn_fastopen || tp->syn_data) 162 if (tp->syn_fastopen || tp->syn_data)
163 tcp_fastopen_cache_set(sk, 0, NULL, true, 0); 163 tcp_fastopen_cache_set(sk, 0, NULL, true, 0);
164 if (tp->syn_data && icsk->icsk_retransmits == 1) 164 if (tp->syn_data && icsk->icsk_retransmits == 1)
165 NET_INC_STATS_BH(sock_net(sk), 165 __NET_INC_STATS(sock_net(sk),
166 LINUX_MIB_TCPFASTOPENACTIVEFAIL); 166 LINUX_MIB_TCPFASTOPENACTIVEFAIL);
167 } 167 }
168 retry_until = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_syn_retries; 168 retry_until = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_syn_retries;
169 syn_set = true; 169 syn_set = true;
@@ -178,8 +178,8 @@ static int tcp_write_timeout(struct sock *sk)
178 tp->bytes_acked <= tp->rx_opt.mss_clamp) { 178 tp->bytes_acked <= tp->rx_opt.mss_clamp) {
179 tcp_fastopen_cache_set(sk, 0, NULL, true, 0); 179 tcp_fastopen_cache_set(sk, 0, NULL, true, 0);
180 if (icsk->icsk_retransmits == net->ipv4.sysctl_tcp_retries1) 180 if (icsk->icsk_retransmits == net->ipv4.sysctl_tcp_retries1)
181 NET_INC_STATS_BH(sock_net(sk), 181 __NET_INC_STATS(sock_net(sk),
182 LINUX_MIB_TCPFASTOPENACTIVEFAIL); 182 LINUX_MIB_TCPFASTOPENACTIVEFAIL);
183 } 183 }
184 /* Black hole detection */ 184 /* Black hole detection */
185 tcp_mtu_probing(icsk, sk); 185 tcp_mtu_probing(icsk, sk);
@@ -228,7 +228,7 @@ void tcp_delack_timer_handler(struct sock *sk)
228 if (!skb_queue_empty(&tp->ucopy.prequeue)) { 228 if (!skb_queue_empty(&tp->ucopy.prequeue)) {
229 struct sk_buff *skb; 229 struct sk_buff *skb;
230 230
231 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSCHEDULERFAILED); 231 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPSCHEDULERFAILED);
232 232
233 while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) 233 while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL)
234 sk_backlog_rcv(sk, skb); 234 sk_backlog_rcv(sk, skb);
@@ -248,7 +248,7 @@ void tcp_delack_timer_handler(struct sock *sk)
248 icsk->icsk_ack.ato = TCP_ATO_MIN; 248 icsk->icsk_ack.ato = TCP_ATO_MIN;
249 } 249 }
250 tcp_send_ack(sk); 250 tcp_send_ack(sk);
251 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKS); 251 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKS);
252 } 252 }
253 253
254out: 254out:
@@ -265,7 +265,7 @@ static void tcp_delack_timer(unsigned long data)
265 tcp_delack_timer_handler(sk); 265 tcp_delack_timer_handler(sk);
266 } else { 266 } else {
267 inet_csk(sk)->icsk_ack.blocked = 1; 267 inet_csk(sk)->icsk_ack.blocked = 1;
268 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED); 268 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
269 /* deleguate our work to tcp_release_cb() */ 269 /* deleguate our work to tcp_release_cb() */
270 if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags)) 270 if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags))
271 sock_hold(sk); 271 sock_hold(sk);
@@ -431,7 +431,7 @@ void tcp_retransmit_timer(struct sock *sk)
431 } else { 431 } else {
432 mib_idx = LINUX_MIB_TCPTIMEOUTS; 432 mib_idx = LINUX_MIB_TCPTIMEOUTS;
433 } 433 }
434 NET_INC_STATS_BH(sock_net(sk), mib_idx); 434 __NET_INC_STATS(sock_net(sk), mib_idx);
435 } 435 }
436 436
437 tcp_enter_loss(sk); 437 tcp_enter_loss(sk);
@@ -549,7 +549,7 @@ void tcp_syn_ack_timeout(const struct request_sock *req)
549{ 549{
550 struct net *net = read_pnet(&inet_rsk(req)->ireq_net); 550 struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
551 551
552 NET_INC_STATS_BH(net, LINUX_MIB_TCPTIMEOUTS); 552 __NET_INC_STATS(net, LINUX_MIB_TCPTIMEOUTS);
553} 553}
554EXPORT_SYMBOL(tcp_syn_ack_timeout); 554EXPORT_SYMBOL(tcp_syn_ack_timeout);
555 555
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index f1678388fb0d..00cf28ad4565 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -222,7 +222,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
222 __sk_nulls_add_node_rcu(sk, &head->chain); 222 __sk_nulls_add_node_rcu(sk, &head->chain);
223 if (tw) { 223 if (tw) {
224 sk_nulls_del_node_init_rcu((struct sock *)tw); 224 sk_nulls_del_node_init_rcu((struct sock *)tw);
225 NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED); 225 __NET_INC_STATS(net, LINUX_MIB_TIMEWAITRECYCLED);
226 } 226 }
227 spin_unlock(lock); 227 spin_unlock(lock);
228 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); 228 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index aab91fa86c5e..59c483937aec 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -155,11 +155,11 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
155 155
156 mss = __cookie_v6_check(ipv6_hdr(skb), th, cookie); 156 mss = __cookie_v6_check(ipv6_hdr(skb), th, cookie);
157 if (mss == 0) { 157 if (mss == 0) {
158 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED); 158 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED);
159 goto out; 159 goto out;
160 } 160 }
161 161
162 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV); 162 __NET_INC_STATS(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV);
163 163
164 /* check for timestamp cookie support */ 164 /* check for timestamp cookie support */
165 memset(&tcp_opt, 0, sizeof(tcp_opt)); 165 memset(&tcp_opt, 0, sizeof(tcp_opt));
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 78c45c027acc..52914714b923 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -352,13 +352,13 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
352 352
353 bh_lock_sock(sk); 353 bh_lock_sock(sk);
354 if (sock_owned_by_user(sk) && type != ICMPV6_PKT_TOOBIG) 354 if (sock_owned_by_user(sk) && type != ICMPV6_PKT_TOOBIG)
355 NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); 355 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
356 356
357 if (sk->sk_state == TCP_CLOSE) 357 if (sk->sk_state == TCP_CLOSE)
358 goto out; 358 goto out;
359 359
360 if (ipv6_hdr(skb)->hop_limit < inet6_sk(sk)->min_hopcount) { 360 if (ipv6_hdr(skb)->hop_limit < inet6_sk(sk)->min_hopcount) {
361 NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); 361 __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP);
362 goto out; 362 goto out;
363 } 363 }
364 364
@@ -368,7 +368,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
368 snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una; 368 snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una;
369 if (sk->sk_state != TCP_LISTEN && 369 if (sk->sk_state != TCP_LISTEN &&
370 !between(seq, snd_una, tp->snd_nxt)) { 370 !between(seq, snd_una, tp->snd_nxt)) {
371 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 371 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
372 goto out; 372 goto out;
373 } 373 }
374 374
@@ -649,12 +649,12 @@ static bool tcp_v6_inbound_md5_hash(const struct sock *sk,
649 return false; 649 return false;
650 650
651 if (hash_expected && !hash_location) { 651 if (hash_expected && !hash_location) {
652 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMD5NOTFOUND); 652 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5NOTFOUND);
653 return true; 653 return true;
654 } 654 }
655 655
656 if (!hash_expected && hash_location) { 656 if (!hash_expected && hash_location) {
657 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMD5UNEXPECTED); 657 __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5UNEXPECTED);
658 return true; 658 return true;
659 } 659 }
660 660
@@ -1165,7 +1165,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
1165 return newsk; 1165 return newsk;
1166 1166
1167out_overflow: 1167out_overflow:
1168 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); 1168 __NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
1169out_nonewsk: 1169out_nonewsk:
1170 dst_release(dst); 1170 dst_release(dst);
1171out: 1171out:
@@ -1421,7 +1421,7 @@ process:
1421 } 1421 }
1422 } 1422 }
1423 if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) { 1423 if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) {
1424 NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); 1424 __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP);
1425 goto discard_and_relse; 1425 goto discard_and_relse;
1426 } 1426 }
1427 1427
@@ -1454,7 +1454,7 @@ process:
1454 } else if (unlikely(sk_add_backlog(sk, skb, 1454 } else if (unlikely(sk_add_backlog(sk, skb,
1455 sk->sk_rcvbuf + sk->sk_sndbuf))) { 1455 sk->sk_rcvbuf + sk->sk_sndbuf))) {
1456 bh_unlock_sock(sk); 1456 bh_unlock_sock(sk);
1457 NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP); 1457 __NET_INC_STATS(net, LINUX_MIB_TCPBACKLOGDROP);
1458 goto discard_and_relse; 1458 goto discard_and_relse;
1459 } 1459 }
1460 bh_unlock_sock(sk); 1460 bh_unlock_sock(sk);
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 12332fc3eb44..a701527a9480 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -532,7 +532,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
532 * servers this needs to be solved differently. 532 * servers this needs to be solved differently.
533 */ 533 */
534 if (sock_owned_by_user(sk)) 534 if (sock_owned_by_user(sk))
535 NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); 535 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
536 536
537 *app = asoc; 537 *app = asoc;
538 *tpp = transport; 538 *tpp = transport;