|
@@ -1752,9 +1752,11 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
|
|
static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
|
static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
|
bool *is_cwnd_limited, u32 max_segs)
|
|
bool *is_cwnd_limited, u32 max_segs)
|
|
{
|
|
{
|
|
- struct tcp_sock *tp = tcp_sk(sk);
|
|
|
|
const struct inet_connection_sock *icsk = inet_csk(sk);
|
|
const struct inet_connection_sock *icsk = inet_csk(sk);
|
|
- u32 send_win, cong_win, limit, in_flight;
|
|
|
|
|
|
+ u32 age, send_win, cong_win, limit, in_flight;
|
|
|
|
+ struct tcp_sock *tp = tcp_sk(sk);
|
|
|
|
+ struct skb_mstamp now;
|
|
|
|
+ struct sk_buff *head;
|
|
int win_divisor;
|
|
int win_divisor;
|
|
|
|
|
|
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
|
|
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
|
|
@@ -1808,6 +1810,13 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
|
goto send_now;
|
|
goto send_now;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ head = tcp_write_queue_head(sk);
|
|
|
|
+ skb_mstamp_get(&now);
|
|
|
|
+ age = skb_mstamp_us_delta(&now, &head->skb_mstamp);
|
|
|
|
+ /* If next ACK is likely to come too late (half srtt), do not defer */
|
|
|
|
+ if (age < (tp->srtt_us >> 4))
|
|
|
|
+ goto send_now;
|
|
|
|
+
|
|
/* Ok, it looks like it is advisable to defer. */
|
|
/* Ok, it looks like it is advisable to defer. */
|
|
|
|
|
|
if (cong_win < send_win && cong_win < skb->len)
|
|
if (cong_win < send_win && cong_win < skb->len)
|