|
@@ -2377,7 +2377,6 @@ bool tcp_schedule_loss_probe(struct sock *sk)
|
|
struct inet_connection_sock *icsk = inet_csk(sk);
|
|
struct inet_connection_sock *icsk = inet_csk(sk);
|
|
struct tcp_sock *tp = tcp_sk(sk);
|
|
struct tcp_sock *tp = tcp_sk(sk);
|
|
u32 timeout, tlp_time_stamp, rto_time_stamp;
|
|
u32 timeout, tlp_time_stamp, rto_time_stamp;
|
|
- u32 rtt = usecs_to_jiffies(tp->srtt_us >> 3);
|
|
|
|
|
|
|
|
/* No consecutive loss probes. */
|
|
/* No consecutive loss probes. */
|
|
if (WARN_ON(icsk->icsk_pending == ICSK_TIME_LOSS_PROBE)) {
|
|
if (WARN_ON(icsk->icsk_pending == ICSK_TIME_LOSS_PROBE)) {
|
|
@@ -2406,15 +2405,19 @@ bool tcp_schedule_loss_probe(struct sock *sk)
|
|
tcp_send_head(sk))
|
|
tcp_send_head(sk))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- /* Probe timeout is at least 1.5*rtt + TCP_DELACK_MAX to account
|
|
|
|
|
|
+ /* Probe timeout is 2*rtt. Add minimum RTO to account
|
|
* for delayed ack when there's one outstanding packet. If no RTT
|
|
* for delayed ack when there's one outstanding packet. If no RTT
|
|
* sample is available then probe after TCP_TIMEOUT_INIT.
|
|
* sample is available then probe after TCP_TIMEOUT_INIT.
|
|
*/
|
|
*/
|
|
- timeout = rtt << 1 ? : TCP_TIMEOUT_INIT;
|
|
|
|
- if (tp->packets_out == 1)
|
|
|
|
- timeout = max_t(u32, timeout,
|
|
|
|
- (rtt + (rtt >> 1) + TCP_DELACK_MAX));
|
|
|
|
- timeout = max_t(u32, timeout, msecs_to_jiffies(10));
|
|
|
|
|
|
+ if (tp->srtt_us) {
|
|
|
|
+ timeout = usecs_to_jiffies(tp->srtt_us >> 2);
|
|
|
|
+ if (tp->packets_out == 1)
|
|
|
|
+ timeout += TCP_RTO_MIN;
|
|
|
|
+ else
|
|
|
|
+ timeout += TCP_TIMEOUT_MIN;
|
|
|
|
+ } else {
|
|
|
|
+ timeout = TCP_TIMEOUT_INIT;
|
|
|
|
+ }
|
|
|
|
|
|
/* If RTO is shorter, just schedule TLP in its place. */
|
|
/* If RTO is shorter, just schedule TLP in its place. */
|
|
tlp_time_stamp = tcp_jiffies32 + timeout;
|
|
tlp_time_stamp = tcp_jiffies32 + timeout;
|