/* Default values of the Veno variables, in fixed-point representation *withV_PARAM_SHIFTbitstotherightofthebinarypoint.
*/ #define V_PARAM_SHIFT 1 staticconstint beta = 3 << V_PARAM_SHIFT;
/* Veno variables */ struct veno {
u8 doing_veno_now; /* if true, do veno for this rtt */
u16 cntrtt; /* # of rtts measured within last rtt */
u32 minrtt; /* min of rtts measured within last rtt (in usec) */
u32 basertt; /* the min of all Veno rtt measurements seen (in usec) */
u32 inc; /* decide whether to increase cwnd */
u32 diff; /* calculate the diff rate */
};
/* There are several situations when we must "re-start" Veno: * *owhenaconnectionisestablished *oafteranRTO *oafterfastrecovery *owhenwesendapacketandthereisnooutstanding *unacknowledgeddata(restartinganidleconnection) *
*/ staticinlinevoid veno_enable(struct sock *sk)
{ struct veno *veno = inet_csk_ca(sk);
if (!veno->doing_veno_now) {
tcp_reno_cong_avoid(sk, ack, acked); return;
}
/* limited by applications */ if (!tcp_is_cwnd_limited(sk)) return;
/* We do the Veno calculations only if we got enough rtt samples */ if (veno->cntrtt <= 2) { /* We don't have enough rtt samples to do the Veno *calculation,sowe'llbehavelikeReno.
*/
tcp_reno_cong_avoid(sk, ack, acked);
} else {
u64 target_cwnd;
u32 rtt;
/* We have enough rtt samples, so, using the Veno *algorithm,wedeterminethestateofthenetwork.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.