diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 2f1588bf73da..cd8e257492c4 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2377,8 +2377,8 @@ bool tcp_schedule_loss_probe(struct sock *sk) | |||
2377 | { | 2377 | { |
2378 | struct inet_connection_sock *icsk = inet_csk(sk); | 2378 | struct inet_connection_sock *icsk = inet_csk(sk); |
2379 | struct tcp_sock *tp = tcp_sk(sk); | 2379 | struct tcp_sock *tp = tcp_sk(sk); |
2380 | u32 timeout, tlp_time_stamp, rto_time_stamp; | ||
2381 | u32 rtt = usecs_to_jiffies(tp->srtt_us >> 3); | 2380 | u32 rtt = usecs_to_jiffies(tp->srtt_us >> 3); |
2381 | u32 timeout, rto_delta_us; | ||
2382 | 2382 | ||
2383 | /* No consecutive loss probes. */ | 2383 | /* No consecutive loss probes. */ |
2384 | if (WARN_ON(icsk->icsk_pending == ICSK_TIME_LOSS_PROBE)) { | 2384 | if (WARN_ON(icsk->icsk_pending == ICSK_TIME_LOSS_PROBE)) { |
@@ -2417,14 +2417,10 @@ bool tcp_schedule_loss_probe(struct sock *sk) | |||
2417 | (rtt + (rtt >> 1) + TCP_DELACK_MAX)); | 2417 | (rtt + (rtt >> 1) + TCP_DELACK_MAX)); |
2418 | timeout = max_t(u32, timeout, msecs_to_jiffies(10)); | 2418 | timeout = max_t(u32, timeout, msecs_to_jiffies(10)); |
2419 | 2419 | ||
2420 | /* If RTO is shorter, just schedule TLP in its place. */ | 2420 | /* If the RTO formula yields an earlier time, then use that time. */ |
2421 | tlp_time_stamp = tcp_jiffies32 + timeout; | 2421 | rto_delta_us = tcp_rto_delta_us(sk); /* How far in future is RTO? */ |
2422 | rto_time_stamp = (u32)inet_csk(sk)->icsk_timeout; | 2422 | if (rto_delta_us > 0) |
2423 | if ((s32)(tlp_time_stamp - rto_time_stamp) > 0) { | 2423 | timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us)); |
2424 | s32 delta = rto_time_stamp - tcp_jiffies32; | ||
2425 | if (delta > 0) | ||
2426 | timeout = delta; | ||
2427 | } | ||
2428 | 2424 | ||
2429 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout, | 2425 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_LOSS_PROBE, timeout, |
2430 | TCP_RTO_MAX); | 2426 | TCP_RTO_MAX); |