tcp: account all retransmit failures
authorYuchung Cheng <ycheng@google.com>
Fri, 12 Jul 2013 18:33:04 +0000 (11:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Jul 2013 23:15:56 +0000 (16:15 -0700)
Change snmp RETRANSFAILS stat to include timeout retransmit failures
in addition to other loss recoveries.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index 3d609490f118e753ff791b0ac1fb79cbcb6a7fa6..92fde8d1aa821c38b59ba467fe386eb3306c2dfe 100644 (file)
@@ -2407,6 +2407,8 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
                 * see tcp_input.c tcp_sacktag_write_queue().
                 */
                TCP_SKB_CB(skb)->ack_seq = tp->snd_nxt;
+       } else {
+               NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
        }
        return err;
 }
@@ -2528,10 +2530,9 @@ begin_fwd:
                if (sacked & (TCPCB_SACKED_ACKED|TCPCB_SACKED_RETRANS))
                        continue;
 
-               if (tcp_retransmit_skb(sk, skb)) {
-                       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
+               if (tcp_retransmit_skb(sk, skb))
                        return;
-               }
+
                NET_INC_STATS_BH(sock_net(sk), mib_idx);
 
                if (tcp_in_cwnd_reduction(sk))