diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index e2d2ca2509be..0248c181a92c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1261,28 +1261,6 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu | |||
1261 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ | 1261 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ |
1262 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) | 1262 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) |
1263 | 1263 | ||
1264 | /* This function calculates a "timeout" which is equivalent to the timeout of a | ||
1265 | * TCP connection after "boundary" unsucessful, exponentially backed-off | ||
1266 | * retransmissions with an initial RTO of TCP_RTO_MIN. | ||
1267 | */ | ||
1268 | static inline bool retransmits_timed_out(const struct sock *sk, | ||
1269 | unsigned int boundary) | ||
1270 | { | ||
1271 | unsigned int timeout, linear_backoff_thresh; | ||
1272 | |||
1273 | if (!inet_csk(sk)->icsk_retransmits) | ||
1274 | return false; | ||
1275 | |||
1276 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); | ||
1277 | |||
1278 | if (boundary <= linear_backoff_thresh) | ||
1279 | timeout = ((2 << boundary) - 1) * TCP_RTO_MIN; | ||
1280 | else | ||
1281 | timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + | ||
1282 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; | ||
1283 | |||
1284 | return (tcp_time_stamp - tcp_sk(sk)->retrans_stamp) >= timeout; | ||
1285 | } | ||
1286 | 1264 | ||
1287 | static inline struct sk_buff *tcp_send_head(struct sock *sk) | 1265 | static inline struct sk_buff *tcp_send_head(struct sock *sk) |
1288 | { | 1266 | { |