diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2011-02-24 22:58:15 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2011-02-24 22:58:15 +0000 |
commit | 0191fb6de27ff6721cffc17d04e7e3a9d4e17143 (patch) | |
tree | fd5ccbabd7a23a3899955a2d0ec8c2cf0aa13c55 /sys/netinet/sctp_cc_functions.c | |
parent | be1d917696898eef2701c33a70f818c4430b2f2c (diff) | |
download | src-0191fb6de27ff6721cffc17d04e7e3a9d4e17143.tar.gz src-0191fb6de27ff6721cffc17d04e7e3a9d4e17143.zip |
* Fix several bugs where the scaled versions of srtt and rttvar
where used incorrectly.
* Use appropriate variable names for RTO instead of RTT.
MFC after: 3 months.
Notes
Notes:
svn path=/head/; revision=219014
Diffstat (limited to 'sys/netinet/sctp_cc_functions.c')
-rw-r--r-- | sys/netinet/sctp_cc_functions.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c index ffa4c792d944..ca191e47a022 100644 --- a/sys/netinet/sctp_cc_functions.c +++ b/sys/netinet/sctp_cc_functions.c @@ -428,7 +428,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } @@ -518,8 +518,8 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT for this calc */ - rtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + /* need real RTT in msd for this calc */ + rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1079,7 +1079,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } @@ -1146,7 +1146,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, struct sctp_nets *net) static inline void measure_rtt(struct sctp_tcb *stcb, struct sctp_nets *net) { - uint32_t srtt = net->lastsa >> 3; + uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; /* keep track of minimum RTT seen so far, minRTT is zero at first */ if (net->htcp_ca.minRTT > srtt || !net->htcp_ca.minRTT) @@ -1532,7 +1532,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } |