mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 10:33:27 +00:00
tcp: fix for zero packets_in_flight was too broad
There are transients during normal FRTO procedure during which the packets_in_flight can go to zero between write_queue state updates and firing the resulting segments out. As FRTO processing occurs during that window the check must be more precise to not match "spuriously" :-). More specificly, e.g., when packets_in_flight is zero but FLAG_DATA_ACKED is true the problematic branch that set cwnd into zero would not be taken and new segments might be sent out later. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Tested-by: Eric Dumazet <edumazet@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b6ec447df9
commit
6731d2095b
1 changed files with 6 additions and 2 deletions
|
@ -3484,8 +3484,7 @@ static bool tcp_process_frto(struct sock *sk, int flag)
|
||||||
((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED)))
|
((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED)))
|
||||||
tp->undo_marker = 0;
|
tp->undo_marker = 0;
|
||||||
|
|
||||||
if (!before(tp->snd_una, tp->frto_highmark) ||
|
if (!before(tp->snd_una, tp->frto_highmark)) {
|
||||||
!tcp_packets_in_flight(tp)) {
|
|
||||||
tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3), flag);
|
tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3), flag);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3505,6 +3504,11 @@ static bool tcp_process_frto(struct sock *sk, int flag)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) {
|
if (!(flag & FLAG_DATA_ACKED) && (tp->frto_counter == 1)) {
|
||||||
|
if (!tcp_packets_in_flight(tp)) {
|
||||||
|
tcp_enter_frto_loss(sk, 2, flag);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Prevent sending of new data. */
|
/* Prevent sending of new data. */
|
||||||
tp->snd_cwnd = min(tp->snd_cwnd,
|
tp->snd_cwnd = min(tp->snd_cwnd,
|
||||||
tcp_packets_in_flight(tp));
|
tcp_packets_in_flight(tp));
|
||||||
|
|
Loading…
Reference in a new issue