/* not yet record reference time
* go away!! record it before come back!! */ if (lp->remote_ref_time == 0 || lp->local_ref_time == 0) goto out;
/* we can't calc remote HZ with no different!! */ if (tp->rx_opt.rcv_tsval == lp->remote_ref_time ||
tp->rx_opt.rcv_tsecr == lp->local_ref_time) goto out;
m = TCP_TS_HZ *
(tp->rx_opt.rcv_tsval - lp->remote_ref_time) /
(tp->rx_opt.rcv_tsecr - lp->local_ref_time); if (m < 0)
m = -m;
if (rhz > 0) {
m -= rhz >> 6; /* m is now error in remote HZ est */
rhz += m; /* 63/64 old + 1/64 new */
} else
rhz = m << 6;
out: /* record time for successful remote HZ calc */ if ((rhz >> 6) > 0)
lp->flag |= LP_VALID_RHZ; else
lp->flag &= ~LP_VALID_RHZ;
/* record reference time stamp */
lp->remote_ref_time = tp->rx_opt.rcv_tsval;
lp->local_ref_time = tp->rx_opt.rcv_tsecr;
/* sorry that we don't have valid data */ if (!(lp->flag & LP_VALID_RHZ) || !(lp->flag & LP_VALID_OWD)) return;
/* record the next min owd */ if (mowd < lp->owd_min)
lp->owd_min = mowd;
/* always forget the max of the max
* we just set owd_max as one below it */ if (mowd > lp->owd_max) { if (mowd > lp->owd_max_rsv) { if (lp->owd_max_rsv == 0)
lp->owd_max = mowd; else
lp->owd_max = lp->owd_max_rsv;
lp->owd_max_rsv = mowd;
} else
lp->owd_max = mowd;
}
/* calc for smoothed owd */ if (lp->sowd != 0) {
mowd -= lp->sowd >> 3; /* m is now error in owd est */
lp->sowd += mowd; /* owd = 7/8 owd + 1/8 new */
} else
lp->sowd = mowd << 3; /* take the measured time be owd */
}
/* FIXME: try to reset owd_min and owd_max here *sodecreasethechancethemin/maxisnolongersuitable
* and will usually within threshold when within inference */
lp->owd_min = lp->sowd >> 3;
lp->owd_max = lp->sowd >> 2;
lp->owd_max_rsv = lp->sowd >> 2;
/* happened within inference
* drop snd_cwnd into 1 */ if (lp->flag & LP_WITHIN_INF)
tcp_snd_cwnd_set(tp, 1U);
/* happened after inference
* cut snd_cwnd into half */ else
tcp_snd_cwnd_set(tp, max(tcp_snd_cwnd(tp) >> 1U, 1U));
/* record this drop time */
lp->last_drop = now;
}
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.