[TCP]: Fixes IW > 2 cases when TCP is application limited
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Fri, 4 Aug 2006 23:57:42 +0000 (16:57 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 5 Aug 2006 05:59:52 +0000 (22:59 -0700)
Whenever a transfer is application limited, we are allowed at least
initial window worth of data per window unless cwnd is previously
less than that.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c

index 738dad9f7d498d40538aa77c3161900353470c7a..104af5d5bcbcb75f84ffaee403f830743fc0a982 100644 (file)
@@ -3541,7 +3541,8 @@ void tcp_cwnd_application_limited(struct sock *sk)
        if (inet_csk(sk)->icsk_ca_state == TCP_CA_Open &&
            sk->sk_socket && !test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
                /* Limited by application or receiver window. */
-               u32 win_used = max(tp->snd_cwnd_used, 2U);
+               u32 init_win = tcp_init_cwnd(tp, __sk_dst_get(sk));
+               u32 win_used = max(tp->snd_cwnd_used, init_win);
                if (win_used < tp->snd_cwnd) {
                        tp->snd_ssthresh = tcp_current_ssthresh(sk);
                        tp->snd_cwnd = (tp->snd_cwnd + win_used) >> 1;