Commit 800a6661 authored by Menglong Dong's avatar Menglong Dong Committed by David S. Miller

net: tcp: allow zero-window ACK update the window

Fow now, an ACK can update the window in following case, according to
the tcp_may_update_window():

1. the ACK acknowledged new data
2. the ACK has new data
3. the ACK expand the window and the seq of it is valid

Now, we allow the ACK update the window if the window is 0, and the
seq/ack of it is valid. This is for the case that the receiver replies
an zero-window ACK when it is under memory stress and can't queue the new
data.
Signed-off-by: default avatarMenglong Dong <imagedong@tencent.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2142825
...@@ -3525,7 +3525,7 @@ static inline bool tcp_may_update_window(const struct tcp_sock *tp, ...@@ -3525,7 +3525,7 @@ static inline bool tcp_may_update_window(const struct tcp_sock *tp,
{ {
return after(ack, tp->snd_una) || return after(ack, tp->snd_una) ||
after(ack_seq, tp->snd_wl1) || after(ack_seq, tp->snd_wl1) ||
(ack_seq == tp->snd_wl1 && nwin > tp->snd_wnd); (ack_seq == tp->snd_wl1 && (nwin > tp->snd_wnd || !nwin));
} }
/* If we update tp->snd_una, also update tp->bytes_acked */ /* If we update tp->snd_una, also update tp->bytes_acked */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment