aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-16 23:22:04 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-16 23:22:04 -0400
commit81cc8a75d944fa39fc333c2c329c8e8b3c62cada (patch)
tree40d93df3f13d96e8cf66d154d2b865c35df18ec7
parenta9c19329eccdb145a08a4a2e969d7b40c54c9bcc (diff)
mib: add net to TCP_INC_STATS
Fortunately (almost) all the TCP code has a sock to get the net from :) Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/tcp.h2
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/tcp_output.c10
3 files changed, 8 insertions, 8 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index b9d0ba618b6b..15065157afc9 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -266,7 +266,7 @@ static inline int tcp_too_many_orphans(struct sock *sk, int num)
266extern struct proto tcp_prot; 266extern struct proto tcp_prot;
267 267
268DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics); 268DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics);
269#define TCP_INC_STATS(field) SNMP_INC_STATS(tcp_statistics, field) 269#define TCP_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(tcp_statistics, field); } while (0)
270#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field) 270#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field)
271#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field) 271#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field)
272#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val) 272#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 631133ebb20a..aa79198fb02e 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1668,12 +1668,12 @@ void tcp_set_state(struct sock *sk, int state)
1668 switch (state) { 1668 switch (state) {
1669 case TCP_ESTABLISHED: 1669 case TCP_ESTABLISHED:
1670 if (oldstate != TCP_ESTABLISHED) 1670 if (oldstate != TCP_ESTABLISHED)
1671 TCP_INC_STATS(TCP_MIB_CURRESTAB); 1671 TCP_INC_STATS(sock_net(sk), TCP_MIB_CURRESTAB);
1672 break; 1672 break;
1673 1673
1674 case TCP_CLOSE: 1674 case TCP_CLOSE:
1675 if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED) 1675 if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
1676 TCP_INC_STATS(TCP_MIB_ESTABRESETS); 1676 TCP_INC_STATS(sock_net(sk), TCP_MIB_ESTABRESETS);
1677 1677
1678 sk->sk_prot->unhash(sk); 1678 sk->sk_prot->unhash(sk);
1679 if (inet_csk(sk)->icsk_bind_hash && 1679 if (inet_csk(sk)->icsk_bind_hash &&
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index edef2afe905e..c3b0da826980 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -618,7 +618,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
618 tcp_event_data_sent(tp, skb, sk); 618 tcp_event_data_sent(tp, skb, sk);
619 619
620 if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq) 620 if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq)
621 TCP_INC_STATS(TCP_MIB_OUTSEGS); 621 TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS);
622 622
623 err = icsk->icsk_af_ops->queue_xmit(skb, 0); 623 err = icsk->icsk_af_ops->queue_xmit(skb, 0);
624 if (likely(err <= 0)) 624 if (likely(err <= 0))
@@ -1910,7 +1910,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
1910 1910
1911 if (err == 0) { 1911 if (err == 0) {
1912 /* Update global TCP statistics. */ 1912 /* Update global TCP statistics. */
1913 TCP_INC_STATS(TCP_MIB_RETRANSSEGS); 1913 TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS);
1914 1914
1915 tp->total_retrans++; 1915 tp->total_retrans++;
1916 1916
@@ -2132,7 +2132,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority)
2132 if (tcp_transmit_skb(sk, skb, 0, priority)) 2132 if (tcp_transmit_skb(sk, skb, 0, priority))
2133 NET_INC_STATS(LINUX_MIB_TCPABORTFAILED); 2133 NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
2134 2134
2135 TCP_INC_STATS(TCP_MIB_OUTRSTS); 2135 TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTRSTS);
2136} 2136}
2137 2137
2138/* WARNING: This routine must only be called when we have already sent 2138/* WARNING: This routine must only be called when we have already sent
@@ -2258,7 +2258,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2258 ); 2258 );
2259 2259
2260 th->doff = (tcp_header_size >> 2); 2260 th->doff = (tcp_header_size >> 2);
2261 TCP_INC_STATS(TCP_MIB_OUTSEGS); 2261 TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS);
2262 2262
2263#ifdef CONFIG_TCP_MD5SIG 2263#ifdef CONFIG_TCP_MD5SIG
2264 /* Okay, we have all we need - do the md5 hash if needed */ 2264 /* Okay, we have all we need - do the md5 hash if needed */
@@ -2367,7 +2367,7 @@ int tcp_connect(struct sock *sk)
2367 */ 2367 */
2368 tp->snd_nxt = tp->write_seq; 2368 tp->snd_nxt = tp->write_seq;
2369 tp->pushed_seq = tp->write_seq; 2369 tp->pushed_seq = tp->write_seq;
2370 TCP_INC_STATS(TCP_MIB_ACTIVEOPENS); 2370 TCP_INC_STATS(sock_net(sk), TCP_MIB_ACTIVEOPENS);
2371 2371
2372 /* Timer for repeating the SYN until an answer. */ 2372 /* Timer for repeating the SYN until an answer. */
2373 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, 2373 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,