summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_cc_functions.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2011-02-24 22:58:15 +0000
committertuexen <tuexen@FreeBSD.org>2011-02-24 22:58:15 +0000
commit2919b412182c98499bc02b1139d916a43f69c857 (patch)
treefd5ccbabd7a23a3899955a2d0ec8c2cf0aa13c55 /sys/netinet/sctp_cc_functions.c
parentd11e62523e24822c1b131d8bfce4b6362986eddb (diff)
downloadFreeBSD-src-2919b412182c98499bc02b1139d916a43f69c857.zip
FreeBSD-src-2919b412182c98499bc02b1139d916a43f69c857.tar.gz
* 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.
Diffstat (limited to 'sys/netinet/sctp_cc_functions.c')
-rw-r--r--sys/netinet/sctp_cc_functions.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c
index ffa4c79..ca191e4 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;
}
OpenPOWER on IntegriCloud