diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 54f212ce8aaf..e5319495f15e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1252,6 +1252,24 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu | |||
1252 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ | 1252 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ |
1253 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) | 1253 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) |
1254 | 1254 | ||
1255 | static inline bool retransmits_timed_out(const struct sock *sk, | ||
1256 | unsigned int boundary) | ||
1257 | { | ||
1258 | int limit, K; | ||
1259 | if (!inet_csk(sk)->icsk_retransmits) | ||
1260 | return false; | ||
1261 | |||
1262 | K = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); | ||
1263 | |||
1264 | if (boundary <= K) | ||
1265 | limit = ((2 << boundary) - 1) * TCP_RTO_MIN; | ||
1266 | else | ||
1267 | limit = ((2 << K) - 1) * TCP_RTO_MIN + | ||
1268 | (boundary - K) * TCP_RTO_MAX; | ||
1269 | |||
1270 | return (tcp_time_stamp - tcp_sk(sk)->retrans_stamp) >= limit; | ||
1271 | } | ||
1272 | |||
1255 | static inline struct sk_buff *tcp_send_head(struct sock *sk) | 1273 | static inline struct sk_buff *tcp_send_head(struct sock *sk) |
1256 | { | 1274 | { |
1257 | return sk->sk_send_head; | 1275 | return sk->sk_send_head; |