コード例 #1
0
ファイル: tcp_cubic.c プロジェクト: Andromeda-OS/Kernel
/*
 * Initialize the congestion window at the beginning of a connection or 
 * after idle time
 */
static void tcp_cubic_cwnd_init_or_reset(struct tcpcb *tp)
{
	VERIFY(tp->t_ccstate != NULL);	

	tcp_cubic_clear_state(tp);
	tcp_cc_cwnd_init_or_reset(tp);
	tp->t_pipeack = 0;
	tcp_clear_pipeack_state(tp);

	/* Start counting bytes for RFC 3465 again */
	tp->t_bytes_acked = 0;

	/*
	 * slow start threshold could get initialized to a lower value
	 * when there is a cached value in the route metrics. In this case,
	 * the connection can enter congestion avoidance without any packet
	 * loss and Cubic will enter steady-state too early. It is better
	 * to always probe to find the initial slow-start threshold.
	 */
	if (tp->t_inpcb->inp_stat->txbytes <= TCP_CC_CWND_INIT_BYTES
	    && tp->snd_ssthresh < (TCP_MAXWIN << TCP_MAX_WINSHIFT))
		tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;

	/* Initialize cubic last max to be same as ssthresh */
	tp->t_ccstate->cub_last_max = tp->snd_ssthresh;
}
コード例 #2
0
ファイル: tcp_newreno.c プロジェクト: Apple-FOSS-Mirror/xnu
/* Initialize the congestion window for a connection or
 * handles connections that have been idle for
 * some time. In this state, no acks are
 * expected to clock out any data we send --
 * slow start to get ack "clock" running again.
 *
 * Set the slow-start flight size depending on whether
 * this is a local network or not.
 */
void
tcp_newreno_cwnd_init_or_reset(struct tcpcb *tp) {
	tcp_cc_cwnd_init_or_reset(tp);

	/* If stretch ack was auto disabled, re-evaluate the situation */
	tcp_cc_after_idle_stretchack(tp);
}
コード例 #3
0
ファイル: tcp_newreno.c プロジェクト: aglab2/darwin-xnu
/* Initialize the congestion window for a connection or
 * handles connections that have been idle for
 * some time. In this state, no acks are
 * expected to clock out any data we send --
 * slow start to get ack "clock" running again.
 *
 * Set the slow-start flight size depending on whether
 * this is a local network or not.
 */
void
tcp_newreno_cwnd_init_or_reset(struct tcpcb *tp) {
	tcp_cc_cwnd_init_or_reset(tp);
}