diff options
| author | Neal Cardwell <ncardwell@google.com> | 2017-07-27 10:01:20 -0400 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-11-06 15:17:44 +0100 |
| commit | 9de2da5fe959a00373414eada75c94cdd9a3af55 (patch) | |
| tree | 370419661874f7c2e5855f4019f0d80c5ac5debb /include | |
| parent | bc9e63491196b3a972e9b7eaacec167c5945121f (diff) | |
tcp: introduce tcp_rto_delta_us() helper for xmit timer fix
commit e1a10ef7fa876f8510aaec36ea5c0cf34baba410 upstream.
Pure refactor. This helper will be required in the xmit timer fix
later in the patch series. (Because the TLP logic will want to make
this calculation.)
[This version of the commit was compiled and briefly tested
based on top of v3.10.107.]
Change-Id: I1ccfba0b00465454bf5ce22e6fef5f7b5dd94d15
Fixes: 6ba8a3b19e76 ("tcp: Tail loss probe (TLP)")
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/tcp.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index d6a45e2cd..60a984d70 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1600,4 +1600,14 @@ struct tcp_request_sock_ops { extern void tcp_v4_init(void); extern void tcp_init(void); +/* At how many jiffies into the future should the RTO fire? */ +static inline s32 tcp_rto_delta(const struct sock *sk) +{ + const struct sk_buff *skb = tcp_write_queue_head(sk); + const u32 rto = inet_csk(sk)->icsk_rto; + const u32 rto_time_stamp = TCP_SKB_CB(skb)->when + rto; + + return (s32)(rto_time_stamp - tcp_time_stamp); +} + #endif /* _TCP_H */ |
