]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
RX: Adjust all timeouts for RTT
authorAndrew Deason <adeason@sinenomine.net>
Wed, 6 Oct 2010 22:24:02 +0000 (17:24 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 26 Oct 2010 00:48:53 +0000 (17:48 -0700)
Previously only the deadTime RX network timeout was getting adjusted
for the peer's rtt and rtt_dev values. Do this for the idle and hard
timeouts as well, since a higher RTT is going to make everything
potentially take longer.

Reviewed-on: http://gerrit.openafs.org/2967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 48aca4a605fa46b677a50687d6ea911fbe7d2032)
Change-Id: I1496e5bff75deeb1210eac6fba8a9a7fe70c6e5f
Reviewed-on: http://gerrit.openafs.org/3064
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx.c

index 6a47370965732ef5314e5c4dfbee6ca2bb65fd69..529353cc1ad689d3532f852799e2ada2096c045d 100644 (file)
@@ -5897,7 +5897,8 @@ rxi_CheckCall(struct rx_call *call)
 {
     struct rx_connection *conn = call->conn;
     afs_uint32 now;
-    afs_uint32 deadTime;
+    afs_uint32 deadTime, idleDeadTime = 0, hardDeadTime = 0;
+    afs_uint32 fudgeFactor;
     int cerror = 0;
     int newmtu = 0;
 
@@ -5909,11 +5910,11 @@ rxi_CheckCall(struct rx_call *call)
        return 0;
     }
 #endif
-    /* dead time + RTT + 8*MDEV, rounded up to next second. */
-    deadTime =
-       (((afs_uint32) conn->secondsUntilDead << 10) +
-        ((afs_uint32) conn->peer->rtt >> 3) +
-        ((afs_uint32) conn->peer->rtt_dev << 1) + 1023) >> 10;
+    /* RTT + 8*MDEV, rounded up to the next second. */
+    fudgeFactor = (((afs_uint32) conn->peer->rtt >> 3) +
+                   ((afs_uint32) conn->peer->rtt_dev << 1) + 1023) >> 10;
+
+    deadTime = conn->secondsUntilDead + fudgeFactor;
     now = clock_Sec();
     /* These are computed to the second (+- 1 second).  But that's
      * good enough for these values, which should be a significant
@@ -5971,25 +5972,35 @@ rxi_CheckCall(struct rx_call *call)
         * to pings; active calls are simply flagged in error, so the
         * attached process can die reasonably gracefully. */
     }
+
+    if (conn->idleDeadTime) {
+       idleDeadTime = conn->idleDeadTime + fudgeFactor;
+    }
+
     /* see if we have a non-activity timeout */
-    if (call->startWait && conn->idleDeadTime
-       && ((call->startWait + conn->idleDeadTime) < now) &&
+    if (call->startWait && idleDeadTime
+       && ((call->startWait + idleDeadTime) < now) &&
        (call->flags & RX_CALL_READER_WAIT)) {
        if (call->state == RX_STATE_ACTIVE) {
            cerror = RX_CALL_TIMEOUT;
            goto mtuout;
        }
     }
-    if (call->lastSendData && conn->idleDeadTime && (conn->idleDeadErr != 0)
-        && ((call->lastSendData + conn->idleDeadTime) < now)) {
+    if (call->lastSendData && idleDeadTime && (conn->idleDeadErr != 0)
+        && ((call->lastSendData + idleDeadTime) < now)) {
        if (call->state == RX_STATE_ACTIVE) {
            cerror = conn->idleDeadErr;
            goto mtuout;
        }
     }
+
+    if (hardDeadTime) {
+       hardDeadTime = conn->hardDeadTime + fudgeFactor;
+    }
+
     /* see if we have a hard timeout */
-    if (conn->hardDeadTime
-       && (now > (conn->hardDeadTime + call->startTime.sec))) {
+    if (hardDeadTime
+       && (now > (hardDeadTime + call->startTime.sec))) {
        if (call->state == RX_STATE_ACTIVE)
            rxi_CallError(call, RX_CALL_TIMEOUT);
        return -1;