diff options
author | Eric Dumazet <edumazet@google.com> | 2017-05-18 12:15:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-18 13:20:31 -0400 |
commit | b17b8a20c5cd4a264601eacf1fda29008047d05a (patch) | |
tree | 07baefa636220a256a0db4f9ff8f2f2d7384a6db /net/ipv4/tcp_input.c | |
parent | 4454e8661ffcb707ce1c405b6e112255629562da (diff) |
tcp: fix tcp_rearm_rto()
skbs in (re)transmit queue no longer have a copy of jiffies
at the time of the transmit : skb->skb_mstamp is now in usec unit,
with no correlation to tcp_jiffies32.
We have to convert rto from jiffies to usec, compute a time difference
in usec, then convert the delta to HZ units.
Fixes: 9a568de4818d ("tcp: switch TCP TS option (RFC 7323) to 1ms clock")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 9a5a9e8eda89..aa1eef150dc4 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3002,14 +3002,14 @@ void tcp_rearm_rto(struct sock *sk) | |||
3002 | if (icsk->icsk_pending == ICSK_TIME_REO_TIMEOUT || | 3002 | if (icsk->icsk_pending == ICSK_TIME_REO_TIMEOUT || |
3003 | icsk->icsk_pending == ICSK_TIME_LOSS_PROBE) { | 3003 | icsk->icsk_pending == ICSK_TIME_LOSS_PROBE) { |
3004 | struct sk_buff *skb = tcp_write_queue_head(sk); | 3004 | struct sk_buff *skb = tcp_write_queue_head(sk); |
3005 | const u32 rto_time_stamp = | 3005 | u64 rto_time_stamp = skb->skb_mstamp + |
3006 | tcp_skb_timestamp(skb) + rto; | 3006 | jiffies_to_usecs(rto); |
3007 | s32 delta = (s32)(rto_time_stamp - tcp_jiffies32); | 3007 | s64 delta_us = rto_time_stamp - tp->tcp_mstamp; |
3008 | /* delta may not be positive if the socket is locked | 3008 | /* delta_us may not be positive if the socket is locked |
3009 | * when the retrans timer fires and is rescheduled. | 3009 | * when the retrans timer fires and is rescheduled. |
3010 | */ | 3010 | */ |
3011 | if (delta > 0) | 3011 | if (delta_us > 0) |
3012 | rto = delta; | 3012 | rto = usecs_to_jiffies(delta_us); |
3013 | } | 3013 | } |
3014 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto, | 3014 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto, |
3015 | TCP_RTO_MAX); | 3015 | TCP_RTO_MAX); |