aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-16 23:22:25 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-16 23:22:25 -0400
commit63231bddf6514778792d3784f63822473d250fc0 (patch)
treed380f9ca00fa0ca2cd74142c5b51b97717ef1e9a
parent81cc8a75d944fa39fc333c2c329c8e8b3c62cada (diff)
mib: add net to TCP_INC_STATS_BH
Same as before - the sock is always there to get the net from, but there are also some places with the net already saved on the stack. 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.c2
-rw-r--r--net/ipv4/tcp_input.c6
-rw-r--r--net/ipv4/tcp_ipv4.c14
-rw-r--r--net/ipv4/tcp_minisocks.c4
-rw-r--r--net/ipv6/tcp_ipv6.c14
6 files changed, 21 insertions, 21 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 15065157afc9..8a2cd076be82 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -267,7 +267,7 @@ extern 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(net, field) do { (void)net; SNMP_INC_STATS(tcp_statistics, field); } while (0) 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(net, field) do { (void)net; SNMP_INC_STATS_BH(tcp_statistics, field); } while (0)
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)
273 273
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index aa79198fb02e..f742f84026b5 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2663,7 +2663,7 @@ EXPORT_SYMBOL(__tcp_put_md5sig_pool);
2663void tcp_done(struct sock *sk) 2663void tcp_done(struct sock *sk)
2664{ 2664{
2665 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) 2665 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
2666 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS); 2666 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS);
2667 2667
2668 tcp_set_state(sk, TCP_CLOSE); 2668 tcp_set_state(sk, TCP_CLOSE);
2669 tcp_clear_xmit_timers(sk); 2669 tcp_clear_xmit_timers(sk);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d6ea970a1513..01e8004911b4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4795,7 +4795,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
4795 tcp_data_snd_check(sk); 4795 tcp_data_snd_check(sk);
4796 return 0; 4796 return 0;
4797 } else { /* Header too small */ 4797 } else { /* Header too small */
4798 TCP_INC_STATS_BH(TCP_MIB_INERRS); 4798 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
4799 goto discard; 4799 goto discard;
4800 } 4800 }
4801 } else { 4801 } else {
@@ -4934,7 +4934,7 @@ slow_path:
4934 tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); 4934 tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
4935 4935
4936 if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { 4936 if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
4937 TCP_INC_STATS_BH(TCP_MIB_INERRS); 4937 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
4938 NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN); 4938 NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN);
4939 tcp_reset(sk); 4939 tcp_reset(sk);
4940 return 1; 4940 return 1;
@@ -4957,7 +4957,7 @@ step5:
4957 return 0; 4957 return 0;
4958 4958
4959csum_error: 4959csum_error:
4960 TCP_INC_STATS_BH(TCP_MIB_INERRS); 4960 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
4961 4961
4962discard: 4962discard:
4963 __kfree_skb(skb); 4963 __kfree_skb(skb);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index db3bf9be076f..e876312b950a 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -599,8 +599,8 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
599 ip_send_reply(net->ipv4.tcp_sock, skb, 599 ip_send_reply(net->ipv4.tcp_sock, skb,
600 &arg, arg.iov[0].iov_len); 600 &arg, arg.iov[0].iov_len);
601 601
602 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 602 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
603 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); 603 TCP_INC_STATS_BH(net, TCP_MIB_OUTRSTS);
604} 604}
605 605
606/* The code following below sending ACKs in SYN-RECV and TIME-WAIT states 606/* The code following below sending ACKs in SYN-RECV and TIME-WAIT states
@@ -674,7 +674,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
674 ip_send_reply(net->ipv4.tcp_sock, skb, 674 ip_send_reply(net->ipv4.tcp_sock, skb,
675 &arg, arg.iov[0].iov_len); 675 &arg, arg.iov[0].iov_len);
676 676
677 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 677 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
678} 678}
679 679
680static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) 680static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb)
@@ -1494,7 +1494,7 @@ discard:
1494 return 0; 1494 return 0;
1495 1495
1496csum_err: 1496csum_err:
1497 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1497 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
1498 goto discard; 1498 goto discard;
1499} 1499}
1500 1500
@@ -1514,7 +1514,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
1514 goto discard_it; 1514 goto discard_it;
1515 1515
1516 /* Count it even if it's bad */ 1516 /* Count it even if it's bad */
1517 TCP_INC_STATS_BH(TCP_MIB_INSEGS); 1517 TCP_INC_STATS_BH(net, TCP_MIB_INSEGS);
1518 1518
1519 if (!pskb_may_pull(skb, sizeof(struct tcphdr))) 1519 if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
1520 goto discard_it; 1520 goto discard_it;
@@ -1590,7 +1590,7 @@ no_tcp_socket:
1590 1590
1591 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { 1591 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
1592bad_packet: 1592bad_packet:
1593 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1593 TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
1594 } else { 1594 } else {
1595 tcp_v4_send_reset(NULL, skb); 1595 tcp_v4_send_reset(NULL, skb);
1596 } 1596 }
@@ -1611,7 +1611,7 @@ do_time_wait:
1611 } 1611 }
1612 1612
1613 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { 1613 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
1614 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1614 TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
1615 inet_twsk_put(inet_twsk(sk)); 1615 inet_twsk_put(inet_twsk(sk));
1616 goto discard_it; 1616 goto discard_it;
1617 } 1617 }
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index ea68a478fad6..8b02b1039968 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -480,7 +480,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
480 newtp->rx_opt.mss_clamp = req->mss; 480 newtp->rx_opt.mss_clamp = req->mss;
481 TCP_ECN_openreq_child(newtp, req); 481 TCP_ECN_openreq_child(newtp, req);
482 482
483 TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS); 483 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_PASSIVEOPENS);
484 } 484 }
485 return newsk; 485 return newsk;
486} 486}
@@ -630,7 +630,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
630 * "fourth, check the SYN bit" 630 * "fourth, check the SYN bit"
631 */ 631 */
632 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) { 632 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {
633 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS); 633 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS);
634 goto embryonic_reset; 634 goto embryonic_reset;
635 } 635 }
636 636
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index fc5f7166208a..3895d91ea9fa 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1004,8 +1004,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
1004 1004
1005 if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { 1005 if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) {
1006 ip6_xmit(ctl_sk, buff, &fl, NULL, 0); 1006 ip6_xmit(ctl_sk, buff, &fl, NULL, 0);
1007 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 1007 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
1008 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); 1008 TCP_INC_STATS_BH(net, TCP_MIB_OUTRSTS);
1009 return; 1009 return;
1010 } 1010 }
1011 } 1011 }
@@ -1089,7 +1089,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
1089 if (!ip6_dst_lookup(ctl_sk, &buff->dst, &fl)) { 1089 if (!ip6_dst_lookup(ctl_sk, &buff->dst, &fl)) {
1090 if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { 1090 if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) {
1091 ip6_xmit(ctl_sk, buff, &fl, NULL, 0); 1091 ip6_xmit(ctl_sk, buff, &fl, NULL, 0);
1092 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 1092 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
1093 return; 1093 return;
1094 } 1094 }
1095 } 1095 }
@@ -1579,7 +1579,7 @@ discard:
1579 kfree_skb(skb); 1579 kfree_skb(skb);
1580 return 0; 1580 return 0;
1581csum_err: 1581csum_err:
1582 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1582 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
1583 goto discard; 1583 goto discard;
1584 1584
1585 1585
@@ -1625,7 +1625,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
1625 /* 1625 /*
1626 * Count it even if it's bad. 1626 * Count it even if it's bad.
1627 */ 1627 */
1628 TCP_INC_STATS_BH(TCP_MIB_INSEGS); 1628 TCP_INC_STATS_BH(net, TCP_MIB_INSEGS);
1629 1629
1630 if (!pskb_may_pull(skb, sizeof(struct tcphdr))) 1630 if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
1631 goto discard_it; 1631 goto discard_it;
@@ -1697,7 +1697,7 @@ no_tcp_socket:
1697 1697
1698 if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) { 1698 if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
1699bad_packet: 1699bad_packet:
1700 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1700 TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
1701 } else { 1701 } else {
1702 tcp_v6_send_reset(NULL, skb); 1702 tcp_v6_send_reset(NULL, skb);
1703 } 1703 }
@@ -1722,7 +1722,7 @@ do_time_wait:
1722 } 1722 }
1723 1723
1724 if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) { 1724 if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
1725 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1725 TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
1726 inet_twsk_put(inet_twsk(sk)); 1726 inet_twsk_put(inet_twsk(sk));
1727 goto discard_it; 1727 goto discard_it;
1728 } 1728 }