diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-12-03 11:44:00 +0100 | 
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-12-03 11:44:00 +0100 | 
| commit | 989a4222c13a3e148772730d362fceb0727852f5 (patch) | |
| tree | c66538440a53713e8d3fc52db62e174c6966f831 /net/ipv4/tcp_timer.c | |
| parent | e8da8794a7fd9eef1ec9a07f0d4897c68581c72b (diff) | |
| parent | 2595646791c319cadfdbf271563aac97d0843dc7 (diff) | |
Merge tag 'v4.20-rc5' into irq/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
| -rw-r--r-- | net/ipv4/tcp_timer.c | 12 | 
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 676020663ce8..091c53925e4d 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -40,15 +40,17 @@ static u32 tcp_clamp_rto_to_user_timeout(const struct sock *sk)  {  	struct inet_connection_sock *icsk = inet_csk(sk);  	u32 elapsed, start_ts; +	s32 remaining;  	start_ts = tcp_retransmit_stamp(sk);  	if (!icsk->icsk_user_timeout || !start_ts)  		return icsk->icsk_rto;  	elapsed = tcp_time_stamp(tcp_sk(sk)) - start_ts; -	if (elapsed >= icsk->icsk_user_timeout) +	remaining = icsk->icsk_user_timeout - elapsed; +	if (remaining <= 0)  		return 1; /* user timeout has passed; fire ASAP */ -	else -		return min_t(u32, icsk->icsk_rto, msecs_to_jiffies(icsk->icsk_user_timeout - elapsed)); + +	return min_t(u32, icsk->icsk_rto, msecs_to_jiffies(remaining));  }  /** @@ -209,7 +211,7 @@ static bool retransmits_timed_out(struct sock *sk,  				(boundary - linear_backoff_thresh) * TCP_RTO_MAX;  		timeout = jiffies_to_msecs(timeout);  	} -	return (tcp_time_stamp(tcp_sk(sk)) - start_ts) >= timeout; +	return (s32)(tcp_time_stamp(tcp_sk(sk)) - start_ts - timeout) >= 0;  }  /* A write timeout has occurred. Process the after effects. */ @@ -740,7 +742,7 @@ static enum hrtimer_restart tcp_compressed_ack_kick(struct hrtimer *timer)  	bh_lock_sock(sk);  	if (!sock_owned_by_user(sk)) { -		if (tp->compressed_ack) +		if (tp->compressed_ack > TCP_FASTRETRANS_THRESH)  			tcp_send_ack(sk);  	} else {  		if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED,  | 
