aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-10-23 14:54:16 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-23 22:42:44 -0400
commit3f80e08f40cdb308589a49077c87632fa4508b21 (patch)
tree236cff8470641456fb68472d2e17045ee1aafa62 /net/ipv4/tcp_output.c
parent68203a67a7024c5d0b8e545d3d370b1fec971551 (diff)
tcp: add tcp_reset_xmit_timer() helper
With EDT model, SRTT no longer is inflated by pacing delays. This means that RTO and some other xmit timers might be setup incorrectly. This is particularly visible with either : - Very small enforced pacing rates (SO_MAX_PACING_RATE) - Reduced rto (from the default 200 ms) This can lead to TCP flows aborts in the worst case, or spurious retransmits in other cases. For example, this session gets far more throughput than the requested 80kbit : $ netperf -H 127.0.0.2 -l 100 -- -q 10000 MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 127.0.0.2 () port 0 AF_INET Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 540000 262144 262144 104.00 2.66 With the fix : $ netperf -H 127.0.0.2 -l 100 -- -q 10000 MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 127.0.0.2 () port 0 AF_INET Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 540000 262144 262144 104.00 0.12 EDT allows for better control of rtx timers, since TCP has a better idea of the earliest departure time of each skb in the rtx queue. We only have to eventually add to the timer the difference of the EDT time with current time. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index c07990a35ff3..9c34b97d365d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2455,8 +2455,8 @@ bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto)
2455 if (rto_delta_us > 0) 2455 if (rto_delta_us > 0)
2456 timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us)); 2456 timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us));
2457 2457
2458 inet_csk_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout, 2458 tcp_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout,
2459 TCP_RTO_MAX); 2459 TCP_RTO_MAX, NULL);
2460 return true; 2460 return true;
2461} 2461}
2462 2462
@@ -3020,9 +3020,10 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
3020 3020
3021 if (skb == rtx_head && 3021 if (skb == rtx_head &&
3022 icsk->icsk_pending != ICSK_TIME_REO_TIMEOUT) 3022 icsk->icsk_pending != ICSK_TIME_REO_TIMEOUT)
3023 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, 3023 tcp_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
3024 inet_csk(sk)->icsk_rto, 3024 inet_csk(sk)->icsk_rto,
3025 TCP_RTO_MAX); 3025 TCP_RTO_MAX,
3026 skb);
3026 } 3027 }
3027} 3028}
3028 3029
@@ -3752,9 +3753,10 @@ void tcp_send_probe0(struct sock *sk)
3752 icsk->icsk_probes_out = 1; 3753 icsk->icsk_probes_out = 1;
3753 probe_max = TCP_RESOURCE_PROBE_INTERVAL; 3754 probe_max = TCP_RESOURCE_PROBE_INTERVAL;
3754 } 3755 }
3755 inet_csk_reset_xmit_timer(sk, ICSK_TIME_PROBE0, 3756 tcp_reset_xmit_timer(sk, ICSK_TIME_PROBE0,
3756 tcp_probe0_when(sk, probe_max), 3757 tcp_probe0_when(sk, probe_max),
3757 TCP_RTO_MAX); 3758 TCP_RTO_MAX,
3759 NULL);
3758} 3760}
3759 3761
3760int tcp_rtx_synack(const struct sock *sk, struct request_sock *req) 3762int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)