tcp: add LINUX_MIB_TCPRETRANSFAIL counter
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 25 Jan 2012 04:44:20 +0000 (04:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Jan 2012 18:51:00 +0000 (13:51 -0500)
It might be useful to get a counter of failed tcp_retransmit_skb()
calls.

Reported-by: Satoru Moriya <satoru.moriya@hds.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/snmp.h
net/ipv4/proc.c
net/ipv4/tcp_output.c

index c1241c428179c78bce7c8a774cbaeea9b38da35a..8ee8af4e6da966c661123b0bcd2a26fbb1ceb1d8 100644 (file)
@@ -232,6 +232,7 @@ enum
        LINUX_MIB_TCPTIMEWAITOVERFLOW,          /* TCPTimeWaitOverflow */
        LINUX_MIB_TCPREQQFULLDOCOOKIES,         /* TCPReqQFullDoCookies */
        LINUX_MIB_TCPREQQFULLDROP,              /* TCPReqQFullDrop */
+       LINUX_MIB_TCPRETRANSFAIL,               /* TCPRetransFail */
        __LINUX_MIB_MAX
 };
 
index 6afc807ee2ad66991f0e41d5a46602c4f3729310..02d61079f08b0c7639b5c1864fd126f4e5658a03 100644 (file)
@@ -256,6 +256,7 @@ static const struct snmp_mib snmp4_net_list[] = {
        SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW),
        SNMP_MIB_ITEM("TCPReqQFullDoCookies", LINUX_MIB_TCPREQQFULLDOCOOKIES),
        SNMP_MIB_ITEM("TCPReqQFullDrop", LINUX_MIB_TCPREQQFULLDROP),
+       SNMP_MIB_ITEM("TCPRetransFail", LINUX_MIB_TCPRETRANSFAIL),
        SNMP_MIB_SENTINEL
 };
 
index 8c8de2780c7a7add9e91805300824e7182d40f28..561550ab3c30e79480d91e964ccd37b2cff7cdde 100644 (file)
@@ -2308,8 +2308,10 @@ begin_fwd:
                if (sacked & (TCPCB_SACKED_ACKED|TCPCB_SACKED_RETRANS))
                        continue;
 
-               if (tcp_retransmit_skb(sk, skb))
+               if (tcp_retransmit_skb(sk, skb)) {
+                       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
                        return;
+               }
                NET_INC_STATS_BH(sock_net(sk), mib_idx);
 
                if (inet_csk(sk)->icsk_ca_state == TCP_CA_Recovery)