FreeBSD/sys/netinet/cc/cc_vegas.c
/*
 * If congestion has been triggered triggered by the Vegas measured rates, it is
 * handled here, otherwise it falls back to newreno's congestion handling.
 */
If congestion has been triggered triggered by the Vegas measured rates, it is
handled here, otherwise it falls back to newreno's congestion handling.
If congestion has been triggered triggered by the Vegas measured rates it is handled here otherwise it falls back to newreno ' s congestion handling .
static void
vegas_cong_signal(struct cc_var *ccv, uint32_t signal_type)
{
	struct vegas *vegas_data;
	int presignalrecov;
	vegas_data = ccv->cc_data;
	if (IN_RECOVERY(CCV(ccv, t_flags)))
		presignalrecov = 1;
	else
		presignalrecov = 0;
	switch(signal_type) {
	case CC_VEGAS_RATE:
		if (!IN_RECOVERY(CCV(ccv, t_flags))) {
			CCV(ccv, snd_cwnd) = max(2 * CCV(ccv, t_maxseg),
			    CCV(ccv, snd_cwnd) - CCV(ccv, t_maxseg));
			if (CCV(ccv, snd_cwnd) < CCV(ccv, snd_ssthresh))
				CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd);
		}
		break;
	default:
		newreno_cc_algo.cong_signal(ccv, signal_type);
	}
	if (IN_RECOVERY(CCV(ccv, t_flags)) && !presignalrecov)
		vegas_data->slow_start_toggle =
		    (CCV(ccv, snd_cwnd) < CCV(ccv, snd_ssthresh)) ? 1 : 0;
}
static void vegas_cong_signal ( struct cc_var * ccv , uint32_t signal_type ) { struct vegas * vegas_data ; int presignalrecov ; vegas_data = ccv -> cc_data ; if ( IN_RECOVERY ( CCV ( ccv , t_flags ) ) ) presignalrecov = 1 ; else presignalrecov = 0 ; switch ( signal_type ) { case CC_VEGAS_RATE : if ( ! IN_RECOVERY ( CCV ( ccv , t_flags ) ) ) { CCV ( ccv , snd_cwnd ) = max ( 2 * CCV ( ccv , t_maxseg ) , CCV ( ccv , snd_cwnd ) - CCV ( ccv , t_maxseg ) ) ; if ( CCV ( ccv , snd_cwnd ) < CCV ( ccv , snd_ssthresh ) ) CCV ( ccv , snd_ssthresh ) = CCV ( ccv , snd_cwnd ) ; } break ; default : newreno_cc_algo . cong_signal ( ccv , signal_type ) ; } if ( IN_RECOVERY ( CCV ( ccv , t_flags ) ) && ! presignalrecov ) vegas_data -> slow_start_toggle = ( CCV ( ccv , snd_cwnd ) < CCV ( ccv , snd_ssthresh ) ) ? 1 : 0 ; }
If congestion has been triggered triggered by the Vegas measured rates, it is
 handled here, otherwise it falls back to newreno's congestion handling.
If congestion has been triggered triggered by the Vegas measured rates it is handled here otherwise it falls back to newreno ' s congestion handling .
/* Exit slow start. */