|
@@ -1763,9 +1763,10 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
|
|
if (icsk->icsk_ca_state != TCP_CA_Open)
|
|
|
goto send_now;
|
|
|
|
|
|
- /* Defer for less than two clock ticks. */
|
|
|
- if (tp->tso_deferred &&
|
|
|
- (((u32)jiffies << 1) >> 1) - (tp->tso_deferred >> 1) > 1)
|
|
|
+ /* Avoid bursty behavior by allowing defer
|
|
|
+ * only if the last write was recent.
|
|
|
+ */
|
|
|
+ if ((s32)(tcp_time_stamp - tp->lsndtime) > 0)
|
|
|
goto send_now;
|
|
|
|
|
|
in_flight = tcp_packets_in_flight(tp);
|
|
@@ -1807,11 +1808,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
|
|
goto send_now;
|
|
|
}
|
|
|
|
|
|
- /* Ok, it looks like it is advisable to defer.
|
|
|
- * Do not rearm the timer if already set to not break TCP ACK clocking.
|
|
|
- */
|
|
|
- if (!tp->tso_deferred)
|
|
|
- tp->tso_deferred = 1 | (jiffies << 1);
|
|
|
+ /* Ok, it looks like it is advisable to defer. */
|
|
|
|
|
|
if (cong_win < send_win && cong_win < skb->len)
|
|
|
*is_cwnd_limited = true;
|
|
@@ -1819,7 +1816,6 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
|
|
return true;
|
|
|
|
|
|
send_now:
|
|
|
- tp->tso_deferred = 0;
|
|
|
return false;
|
|
|
}
|
|
|
|