Commit de0744af authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

mib: add net to NET_INC_STATS_BH

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e673444
...@@ -162,7 +162,7 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics); ...@@ -162,7 +162,7 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics);
#define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val) #define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val)
DECLARE_SNMP_STAT(struct linux_mib, net_statistics); DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
#define NET_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(net_statistics, field); } while (0) #define NET_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(net_statistics, field); } while (0)
#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) #define NET_INC_STATS_BH(net, field) do { (void)net; SNMP_INC_STATS_BH(net_statistics, field); } while (0)
#define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field) #define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field)
#define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd) #define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd)
#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd) #define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd)
......
...@@ -894,7 +894,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) ...@@ -894,7 +894,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
sk->sk_backlog_rcv(sk, skb1); sk->sk_backlog_rcv(sk, skb1);
NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED);
} }
tp->ucopy.memory = 0; tp->ucopy.memory = 0;
......
...@@ -230,7 +230,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) ...@@ -230,7 +230,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
* servers this needs to be solved differently. * servers this needs to be solved differently.
*/ */
if (sock_owned_by_user(sk)) if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS); NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
if (sk->sk_state == DCCP_CLOSED) if (sk->sk_state == DCCP_CLOSED)
goto out; goto out;
...@@ -239,7 +239,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) ...@@ -239,7 +239,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
seq = dccp_hdr_seq(dh); seq = dccp_hdr_seq(dh);
if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) &&
!between48(seq, dp->dccps_swl, dp->dccps_swh)) { !between48(seq, dp->dccps_swl, dp->dccps_swh)) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
...@@ -286,7 +286,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) ...@@ -286,7 +286,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
BUG_TRAP(!req->sk); BUG_TRAP(!req->sk);
if (seq != dccp_rsk(req)->dreq_iss) { if (seq != dccp_rsk(req)->dreq_iss) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
/* /*
...@@ -409,9 +409,9 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -409,9 +409,9 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
return newsk; return newsk;
exit_overflow: exit_overflow:
NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
exit: exit:
NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
dst_release(dst); dst_release(dst);
return NULL; return NULL;
} }
......
...@@ -111,7 +111,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -111,7 +111,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
bh_lock_sock(sk); bh_lock_sock(sk);
if (sock_owned_by_user(sk)) if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS); NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
if (sk->sk_state == DCCP_CLOSED) if (sk->sk_state == DCCP_CLOSED)
goto out; goto out;
...@@ -189,7 +189,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -189,7 +189,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
BUG_TRAP(req->sk == NULL); BUG_TRAP(req->sk == NULL);
if (seq != dccp_rsk(req)->dreq_iss) { if (seq != dccp_rsk(req)->dreq_iss) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
...@@ -630,9 +630,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, ...@@ -630,9 +630,9 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
return newsk; return newsk;
out_overflow: out_overflow:
NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
out: out:
NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
if (opt != NULL && opt != np->opt) if (opt != NULL && opt != np->opt)
sock_kfree_s(sk, opt, opt->tot_len); sock_kfree_s(sk, opt, opt->tot_len);
dst_release(dst); dst_release(dst);
......
...@@ -224,7 +224,7 @@ static void dccp_delack_timer(unsigned long data) ...@@ -224,7 +224,7 @@ static void dccp_delack_timer(unsigned long data)
if (sock_owned_by_user(sk)) { if (sock_owned_by_user(sk)) {
/* Try again later. */ /* Try again later. */
icsk->icsk_ack.blocked = 1; icsk->icsk_ack.blocked = 1;
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOCKED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
sk_reset_timer(sk, &icsk->icsk_delack_timer, sk_reset_timer(sk, &icsk->icsk_delack_timer,
jiffies + TCP_DELACK_MIN); jiffies + TCP_DELACK_MIN);
goto out; goto out;
...@@ -254,7 +254,7 @@ static void dccp_delack_timer(unsigned long data) ...@@ -254,7 +254,7 @@ static void dccp_delack_timer(unsigned long data)
icsk->icsk_ack.ato = TCP_ATO_MIN; icsk->icsk_ack.ato = TCP_ATO_MIN;
} }
dccp_send_ack(sk); dccp_send_ack(sk);
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKS);
} }
out: out:
bh_unlock_sock(sk); bh_unlock_sock(sk);
......
...@@ -426,7 +426,7 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev) ...@@ -426,7 +426,7 @@ static int arp_filter(__be32 sip, __be32 tip, struct net_device *dev)
if (ip_route_output_key(net, &rt, &fl) < 0) if (ip_route_output_key(net, &rt, &fl) < 0)
return 1; return 1;
if (rt->u.dst.dev != dev) { if (rt->u.dst.dev != dev) {
NET_INC_STATS_BH(LINUX_MIB_ARPFILTER); NET_INC_STATS_BH(net, LINUX_MIB_ARPFILTER);
flag = 1; flag = 1;
} }
ip_rt_put(rt); ip_rt_put(rt);
......
...@@ -312,11 +312,11 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row, ...@@ -312,11 +312,11 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row,
if (twp) { if (twp) {
*twp = tw; *twp = tw;
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
} else if (tw) { } else if (tw) {
/* Silly. Should hash-dance instead... */ /* Silly. Should hash-dance instead... */
inet_twsk_deschedule(tw, death_row); inet_twsk_deschedule(tw, death_row);
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
inet_twsk_put(tw); inet_twsk_put(tw);
} }
......
...@@ -173,7 +173,7 @@ __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp) ...@@ -173,7 +173,7 @@ __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)
; ;
*mssp = msstab[mssind] + 1; *mssp = msstab[mssind] + 1;
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESSENT); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT);
return secure_tcp_syn_cookie(iph->saddr, iph->daddr, return secure_tcp_syn_cookie(iph->saddr, iph->daddr,
th->source, th->dest, ntohl(th->seq), th->source, th->dest, ntohl(th->seq),
...@@ -269,11 +269,11 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, ...@@ -269,11 +269,11 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) || if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) ||
(mss = cookie_check(skb, cookie)) == 0) { (mss = cookie_check(skb, cookie)) == 0) {
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESFAILED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED);
goto out; goto out;
} }
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV);
/* check for timestamp cookie support */ /* check for timestamp cookie support */
memset(&tcp_opt, 0, sizeof(tcp_opt)); memset(&tcp_opt, 0, sizeof(tcp_opt));
......
...@@ -1871,7 +1871,8 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1871,7 +1871,8 @@ void tcp_close(struct sock *sk, long timeout)
if (tp->linger2 < 0) { if (tp->linger2 < 0) {
tcp_set_state(sk, TCP_CLOSE); tcp_set_state(sk, TCP_CLOSE);
tcp_send_active_reset(sk, GFP_ATOMIC); tcp_send_active_reset(sk, GFP_ATOMIC);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONLINGER); NET_INC_STATS_BH(sock_net(sk),
LINUX_MIB_TCPABORTONLINGER);
} else { } else {
const int tmo = tcp_fin_time(sk); const int tmo = tcp_fin_time(sk);
...@@ -1893,7 +1894,8 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1893,7 +1894,8 @@ void tcp_close(struct sock *sk, long timeout)
"sockets\n"); "sockets\n");
tcp_set_state(sk, TCP_CLOSE); tcp_set_state(sk, TCP_CLOSE);
tcp_send_active_reset(sk, GFP_ATOMIC); tcp_send_active_reset(sk, GFP_ATOMIC);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY); NET_INC_STATS_BH(sock_net(sk),
LINUX_MIB_TCPABORTONMEMORY);
} }
} }
......
This diff is collapsed.
...@@ -366,7 +366,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) ...@@ -366,7 +366,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
* servers this needs to be solved differently. * servers this needs to be solved differently.
*/ */
if (sock_owned_by_user(sk)) if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS); NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
if (sk->sk_state == TCP_CLOSE) if (sk->sk_state == TCP_CLOSE)
goto out; goto out;
...@@ -375,7 +375,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) ...@@ -375,7 +375,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
seq = ntohl(th->seq); seq = ntohl(th->seq);
if (sk->sk_state != TCP_LISTEN && if (sk->sk_state != TCP_LISTEN &&
!between(seq, tp->snd_una, tp->snd_nxt)) { !between(seq, tp->snd_una, tp->snd_nxt)) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
...@@ -422,7 +422,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) ...@@ -422,7 +422,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
BUG_TRAP(!req->sk); BUG_TRAP(!req->sk);
if (seq != tcp_rsk(req)->snt_isn) { if (seq != tcp_rsk(req)->snt_isn) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
...@@ -1251,7 +1251,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ...@@ -1251,7 +1251,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
if (get_seconds() < peer->tcp_ts_stamp + TCP_PAWS_MSL && if (get_seconds() < peer->tcp_ts_stamp + TCP_PAWS_MSL &&
(s32)(peer->tcp_ts - req->ts_recent) > (s32)(peer->tcp_ts - req->ts_recent) >
TCP_PAWS_WINDOW) { TCP_PAWS_WINDOW) {
NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED);
goto drop_and_release; goto drop_and_release;
} }
} }
...@@ -1365,9 +1365,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1365,9 +1365,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
return newsk; return newsk;
exit_overflow: exit_overflow:
NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
exit: exit:
NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
dst_release(dst); dst_release(dst);
return NULL; return NULL;
} }
......
...@@ -244,7 +244,7 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb, ...@@ -244,7 +244,7 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
} }
if (paws_reject) if (paws_reject)
NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED); NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_PAWSESTABREJECTED);
if (!th->rst) { if (!th->rst) {
/* In this case we must reset the TIMEWAIT timer. /* In this case we must reset the TIMEWAIT timer.
...@@ -611,7 +611,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, ...@@ -611,7 +611,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
if (!(flg & TCP_FLAG_RST)) if (!(flg & TCP_FLAG_RST))
req->rsk_ops->send_ack(skb, req); req->rsk_ops->send_ack(skb, req);
if (paws_reject) if (paws_reject)
NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED);
return NULL; return NULL;
} }
...@@ -695,7 +695,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, ...@@ -695,7 +695,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
} }
embryonic_reset: embryonic_reset:
NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
if (!(flg & TCP_FLAG_RST)) if (!(flg & TCP_FLAG_RST))
req->rsk_ops->send_reset(sk, skb); req->rsk_ops->send_reset(sk, skb);
......
...@@ -1995,7 +1995,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk) ...@@ -1995,7 +1995,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
mib_idx = LINUX_MIB_TCPFASTRETRANS; mib_idx = LINUX_MIB_TCPFASTRETRANS;
else else
mib_idx = LINUX_MIB_TCPSLOWSTARTRETRANS; mib_idx = LINUX_MIB_TCPSLOWSTARTRETRANS;
NET_INC_STATS_BH(mib_idx); NET_INC_STATS_BH(sock_net(sk), mib_idx);
if (skb == tcp_write_queue_head(sk)) if (skb == tcp_write_queue_head(sk))
inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
...@@ -2065,7 +2065,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk) ...@@ -2065,7 +2065,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
inet_csk(sk)->icsk_rto, inet_csk(sk)->icsk_rto,
TCP_RTO_MAX); TCP_RTO_MAX);
NET_INC_STATS_BH(LINUX_MIB_TCPFORWARDRETRANS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFORWARDRETRANS);
} }
} }
......
...@@ -48,7 +48,7 @@ static void tcp_write_err(struct sock *sk) ...@@ -48,7 +48,7 @@ static void tcp_write_err(struct sock *sk)
sk->sk_error_report(sk); sk->sk_error_report(sk);
tcp_done(sk); tcp_done(sk);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONTIMEOUT); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONTIMEOUT);
} }
/* Do not allow orphaned sockets to eat all our resources. /* Do not allow orphaned sockets to eat all our resources.
...@@ -89,7 +89,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset) ...@@ -89,7 +89,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
if (do_reset) if (do_reset)
tcp_send_active_reset(sk, GFP_ATOMIC); tcp_send_active_reset(sk, GFP_ATOMIC);
tcp_done(sk); tcp_done(sk);
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY);
return 1; return 1;
} }
return 0; return 0;
...@@ -179,7 +179,7 @@ static void tcp_delack_timer(unsigned long data) ...@@ -179,7 +179,7 @@ static void tcp_delack_timer(unsigned long data)
if (sock_owned_by_user(sk)) { if (sock_owned_by_user(sk)) {
/* Try again later. */ /* Try again later. */
icsk->icsk_ack.blocked = 1; icsk->icsk_ack.blocked = 1;
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOCKED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
sk_reset_timer(sk, &icsk->icsk_delack_timer, jiffies + TCP_DELACK_MIN); sk_reset_timer(sk, &icsk->icsk_delack_timer, jiffies + TCP_DELACK_MIN);
goto out_unlock; goto out_unlock;
} }
...@@ -198,7 +198,7 @@ static void tcp_delack_timer(unsigned long data) ...@@ -198,7 +198,7 @@ static void tcp_delack_timer(unsigned long data)
if (!skb_queue_empty(&tp->ucopy.prequeue)) { if (!skb_queue_empty(&tp->ucopy.prequeue)) {
struct sk_buff *skb; struct sk_buff *skb;
NET_INC_STATS_BH(LINUX_MIB_TCPSCHEDULERFAILED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSCHEDULERFAILED);
while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL)
sk->sk_backlog_rcv(sk, skb); sk->sk_backlog_rcv(sk, skb);
...@@ -218,7 +218,7 @@ static void tcp_delack_timer(unsigned long data) ...@@ -218,7 +218,7 @@ static void tcp_delack_timer(unsigned long data)
icsk->icsk_ack.ato = TCP_ATO_MIN; icsk->icsk_ack.ato = TCP_ATO_MIN;
} }
tcp_send_ack(sk); tcp_send_ack(sk);
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKS);
} }
TCP_CHECK_TIMER(sk); TCP_CHECK_TIMER(sk);
...@@ -346,7 +346,7 @@ static void tcp_retransmit_timer(struct sock *sk) ...@@ -346,7 +346,7 @@ static void tcp_retransmit_timer(struct sock *sk)
} else { } else {
mib_idx = LINUX_MIB_TCPTIMEOUTS; mib_idx = LINUX_MIB_TCPTIMEOUTS;
} }
NET_INC_STATS_BH(mib_idx); NET_INC_STATS_BH(sock_net(sk), mib_idx);
} }
if (tcp_use_frto(sk)) { if (tcp_use_frto(sk)) {
......
...@@ -210,11 +210,11 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row, ...@@ -210,11 +210,11 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
if (twp != NULL) { if (twp != NULL) {
*twp = tw; *twp = tw;
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
} else if (tw != NULL) { } else if (tw != NULL) {
/* Silly. Should hash-dance instead... */ /* Silly. Should hash-dance instead... */
inet_twsk_deschedule(tw, death_row); inet_twsk_deschedule(tw, death_row);
NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
inet_twsk_put(tw); inet_twsk_put(tw);
} }
......
...@@ -137,7 +137,7 @@ __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp) ...@@ -137,7 +137,7 @@ __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)
; ;
*mssp = msstab[mssind] + 1; *mssp = msstab[mssind] + 1;
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESSENT); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT);
return secure_tcp_syn_cookie(&iph->saddr, &iph->daddr, th->source, return secure_tcp_syn_cookie(&iph->saddr, &iph->daddr, th->source,
th->dest, ntohl(th->seq), th->dest, ntohl(th->seq),
...@@ -177,11 +177,11 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) ...@@ -177,11 +177,11 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) || if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) ||
(mss = cookie_check(skb, cookie)) == 0) { (mss = cookie_check(skb, cookie)) == 0) {
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESFAILED); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED);
goto out; goto out;
} }
NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESRECV);
/* check for timestamp cookie support */ /* check for timestamp cookie support */
memset(&tcp_opt, 0, sizeof(tcp_opt)); memset(&tcp_opt, 0, sizeof(tcp_opt));
......
...@@ -340,7 +340,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -340,7 +340,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
bh_lock_sock(sk); bh_lock_sock(sk);
if (sock_owned_by_user(sk)) if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS); NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
if (sk->sk_state == TCP_CLOSE) if (sk->sk_state == TCP_CLOSE)
goto out; goto out;
...@@ -349,7 +349,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -349,7 +349,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
seq = ntohl(th->seq); seq = ntohl(th->seq);
if (sk->sk_state != TCP_LISTEN && if (sk->sk_state != TCP_LISTEN &&
!between(seq, tp->snd_una, tp->snd_nxt)) { !between(seq, tp->snd_una, tp->snd_nxt)) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
...@@ -424,7 +424,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -424,7 +424,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
BUG_TRAP(req->sk == NULL); BUG_TRAP(req->sk == NULL);
if (seq != tcp_rsk(req)->snt_isn) { if (seq != tcp_rsk(req)->snt_isn) {
NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS); NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
goto out; goto out;
} }
...@@ -1449,9 +1449,9 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ...@@ -1449,9 +1449,9 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
return newsk; return newsk;
out_overflow: out_overflow:
NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
out: out:
NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
if (opt && opt != np->opt) if (opt && opt != np->opt)
sock_kfree_s(sk, opt, opt->tot_len); sock_kfree_s(sk, opt, opt->tot_len);
dst_release(dst); dst_release(dst);
......
...@@ -486,7 +486,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, ...@@ -486,7 +486,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
* servers this needs to be solved differently. * servers this needs to be solved differently.
*/ */
if (sock_owned_by_user(sk)) if (sock_owned_by_user(sk))
NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS); NET_INC_STATS_BH(&init_net, LINUX_MIB_LOCKDROPPEDICMPS);
*app = asoc; *app = asoc;
*tpp = transport; *tpp = transport;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment