Commit 05a6b5eb authored by David S. Miller's avatar David S. Miller

[TCP]: Add total num retransmits accounting.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e42d291d
......@@ -186,6 +186,8 @@ struct tcp_info
__u32 tcpi_rcv_rtt;
__u32 tcpi_rcv_space;
__u32 tcpi_total_retrans;
};
#ifdef __KERNEL__
......@@ -364,6 +366,8 @@ struct tcp_opt {
__u8 urg_mode; /* In urgent mode */
__u32 snd_up; /* Urgent pointer */
__u32 total_retrans; /* Total retransmits for entire connection */
/* The syn_wait_lock is necessary only to avoid proc interface having
* to grab the main lock sock while browsing the listening hash
* (otherwise it's deadlock prone).
......
......@@ -105,6 +105,8 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
info->tcpi_rcv_rtt = jiffies_to_usecs(tp->rcv_rtt_est.rtt)>>3;
info->tcpi_rcv_space = tp->rcvq_space.space;
info->tcpi_total_retrans = tp->total_retrans;
}
static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
......
......@@ -1106,6 +1106,8 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
/* Update global TCP statistics. */
TCP_INC_STATS(TCP_MIB_RETRANSSEGS);
tp->total_retrans++;
#if FASTRETRANS_DEBUG > 0
if (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS) {
if (net_ratelimit())
......
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