/* Slow start is used when congestion window is less than slow start threshold. This version implements the basic RFC2581 version and optionally supports: RFC3742 Limited Slow Start - growth limited to max_ssthresh RFC3465 Appropriate Byte Counting - growth limited by bytes acknowledged  */
void tcp_slow_start(struct tcp_sock *tp)
/* Slow start is used when congestion window is less than slow start threshold. This version implements the basic RFC2581 version and optionally supports: RFC3742 Limited Slow Start - growth limited to max_ssthresh RFC3465 Appropriate Byte Counting - growth limited by bytes acknowledged  */
void tcp_slow_start(struct tcp_sock *tp)
{
	int cnt;
	if (sysctl_tcp_abc && tp->bytes_acked < tp->mss_cache)
		return;
	if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh)
		cnt = sysctl_tcp_max_ssthresh >> 1;
	else
		cnt = tp->snd_cwnd;
	if (sysctl_tcp_abc > 1 && tp->bytes_acked >= 2*tp->mss_cache)
		cnt <<= 1;
	tp->bytes_acked = 0;
	tp->snd_cwnd_cnt += cnt;
	while (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
		tp->snd_cwnd_cnt -= tp->snd_cwnd;
		if (tp->snd_cwnd < tp->snd_cwnd_clamp)
			tp->snd_cwnd++;
	}
}