Commit 9b2156fa authored by David S. Miller's avatar David S. Miller

Merge branch 'tcp-fixes-in-timeout-and-retransmission-accounting'

Yuchung Cheng says:

====================
tcp: fixes in timeout and retransmission accounting

This patch set has assorted fixes of minor accounting issues in
timeout, window probe, and retransmission stats.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c0f53771 e1561fe2
...@@ -2920,7 +2920,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) ...@@ -2920,7 +2920,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs)
TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS; TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS;
trace_tcp_retransmit_skb(sk, skb); trace_tcp_retransmit_skb(sk, skb);
} else if (err != -EBUSY) { } else if (err != -EBUSY) {
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL); NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL, segs);
} }
return err; return err;
} }
......
...@@ -378,7 +378,7 @@ static void tcp_probe_timer(struct sock *sk) ...@@ -378,7 +378,7 @@ static void tcp_probe_timer(struct sock *sk)
return; return;
} }
if (icsk->icsk_probes_out > max_probes) { if (icsk->icsk_probes_out >= max_probes) {
abort: tcp_write_err(sk); abort: tcp_write_err(sk);
} else { } else {
/* Only send another probe if we didn't close things up. */ /* Only send another probe if we didn't close things up. */
...@@ -484,11 +484,12 @@ void tcp_retransmit_timer(struct sock *sk) ...@@ -484,11 +484,12 @@ void tcp_retransmit_timer(struct sock *sk)
goto out_reset_timer; goto out_reset_timer;
} }
__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEOUTS);
if (tcp_write_timeout(sk)) if (tcp_write_timeout(sk))
goto out; goto out;
if (icsk->icsk_retransmits == 0) { if (icsk->icsk_retransmits == 0) {
int mib_idx; int mib_idx = 0;
if (icsk->icsk_ca_state == TCP_CA_Recovery) { if (icsk->icsk_ca_state == TCP_CA_Recovery) {
if (tcp_is_sack(tp)) if (tcp_is_sack(tp))
...@@ -503,9 +504,8 @@ void tcp_retransmit_timer(struct sock *sk) ...@@ -503,9 +504,8 @@ void tcp_retransmit_timer(struct sock *sk)
mib_idx = LINUX_MIB_TCPSACKFAILURES; mib_idx = LINUX_MIB_TCPSACKFAILURES;
else else
mib_idx = LINUX_MIB_TCPRENOFAILURES; mib_idx = LINUX_MIB_TCPRENOFAILURES;
} else {
mib_idx = LINUX_MIB_TCPTIMEOUTS;
} }
if (mib_idx)
__NET_INC_STATS(sock_net(sk), mib_idx); __NET_INC_STATS(sock_net(sk), mib_idx);
} }
......
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