diff options
author | Eric Dumazet <edumazet@google.com> | 2014-04-29 01:00:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-30 16:12:22 -0400 |
commit | fc9f35010641ea85dd19d144b86cdd93156f1a1e (patch) | |
tree | 37c597211df463cb893b84d14ae4008d177d6004 /net | |
parent | 3dc638d13aced7baad40517a3d70b3b43bf6b90f (diff) |
tcp: increment retransmit counters in tlp and fast open
Both TLP and Fast Open call __tcp_retransmit_skb() instead of
tcp_retransmit_skb() to avoid changing tp->retrans_out.
This has the side effect of missing SNMP counters increments as well
as tcp_info tcpi_total_retrans updates.
Fix this by moving the stats increments of into __tcp_retransmit_skb()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Nandita Dukkipati <nanditad@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_output.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 025e25093984..12d6016bdd9a 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2441,8 +2441,14 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
2441 | err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); | 2441 | err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); |
2442 | } | 2442 | } |
2443 | 2443 | ||
2444 | if (likely(!err)) | 2444 | if (likely(!err)) { |
2445 | TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS; | 2445 | TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS; |
2446 | /* Update global TCP statistics. */ | ||
2447 | TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS); | ||
2448 | if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) | ||
2449 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); | ||
2450 | tp->total_retrans++; | ||
2451 | } | ||
2446 | return err; | 2452 | return err; |
2447 | } | 2453 | } |
2448 | 2454 | ||
@@ -2452,12 +2458,6 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
2452 | int err = __tcp_retransmit_skb(sk, skb); | 2458 | int err = __tcp_retransmit_skb(sk, skb); |
2453 | 2459 | ||
2454 | if (err == 0) { | 2460 | if (err == 0) { |
2455 | /* Update global TCP statistics. */ | ||
2456 | TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS); | ||
2457 | if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) | ||
2458 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSYNRETRANS); | ||
2459 | tp->total_retrans++; | ||
2460 | |||
2461 | #if FASTRETRANS_DEBUG > 0 | 2461 | #if FASTRETRANS_DEBUG > 0 |
2462 | if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) { | 2462 | if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) { |
2463 | net_dbg_ratelimited("retrans_out leaked\n"); | 2463 | net_dbg_ratelimited("retrans_out leaked\n"); |