tcp: make tcp_cwnd_application_limited() static
[cascardo/linux.git] / net / ipv4 / tcp_input.c
index e1661f4..6efed13 100644 (file)
@@ -4413,7 +4413,7 @@ queue_and_out:
                if (eaten > 0)
                        kfree_skb_partial(skb, fragstolen);
                if (!sock_flag(sk, SOCK_DEAD))
-                       sk->sk_data_ready(sk, 0);
+                       sk->sk_data_ready(sk);
                return;
        }
 
@@ -4703,28 +4703,6 @@ static int tcp_prune_queue(struct sock *sk)
        return -1;
 }
 
-/* RFC2861, slow part. Adjust cwnd, after it was not full during one rto.
- * As additional protections, we do not touch cwnd in retransmission phases,
- * and if application hit its sndbuf limit recently.
- */
-void tcp_cwnd_application_limited(struct sock *sk)
-{
-       struct tcp_sock *tp = tcp_sk(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 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;
-               }
-               tp->snd_cwnd_used = 0;
-       }
-       tp->snd_cwnd_stamp = tcp_time_stamp;
-}
-
 static bool tcp_should_expand_sndbuf(const struct sock *sk)
 {
        const struct tcp_sock *tp = tcp_sk(sk);
@@ -4914,7 +4892,7 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t
                                BUG();
                        tp->urg_data = TCP_URG_VALID | tmp;
                        if (!sock_flag(sk, SOCK_DEAD))
-                               sk->sk_data_ready(sk, 0);
+                               sk->sk_data_ready(sk);
                }
        }
 }
@@ -5000,11 +4978,11 @@ static bool tcp_dma_try_early_copy(struct sock *sk, struct sk_buff *skb,
                    (tcp_flag_word(tcp_hdr(skb)) & TCP_FLAG_PSH) ||
                    (atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1))) {
                        tp->ucopy.wakeup = 1;
-                       sk->sk_data_ready(sk, 0);
+                       sk->sk_data_ready(sk);
                }
        } else if (chunk > 0) {
                tp->ucopy.wakeup = 1;
-               sk->sk_data_ready(sk, 0);
+               sk->sk_data_ready(sk);
        }
 out:
        return copied_early;
@@ -5275,7 +5253,7 @@ no_ack:
 #endif
                        if (eaten)
                                kfree_skb_partial(skb, fragstolen);
-                       sk->sk_data_ready(sk, 0);
+                       sk->sk_data_ready(sk);
                        return;
                }
        }