From: Jeffrey Altman Date: Mon, 20 Sep 2010 02:48:57 +0000 (-0700) Subject: Rx: Only backoff the peer timeout once X-Git-Tag: openafs-devel-1_5_78~134 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e1f1286dc264e186bf3c9ced5b41d7298ed954ad;p=packages%2Fo%2Fopenafs.git Rx: Only backoff the peer timeout once If a packet is missing, the peer timeout is backed off to provide a new starting point for timeout computation. The backoff state must be stored in the peer object to ensure that multiple failures do not result in more than one backoff before a successfully received packet is available for recomputation. Change-Id: I6794b3a020801ff421e4ed776afb581962b111a9 Reviewed-on: http://gerrit.openafs.org/2787 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 3b4cad3b78ec5df7253067c70e19c066552d7145) Reviewed-on: http://gerrit.openafs.org/2808 --- diff --git a/src/rx/rx.c b/src/rx/rx.c index 923d9b8fc..46b9383c0 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -3825,7 +3825,6 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, afs_uint32 skew = 0; int nbytes; int missing; - int backedOff = 0; int acked; int nNacked = 0; int newAckCount = 0; @@ -4058,14 +4057,14 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, * timeout value for future packets until a successful response * is received for an initial transmission. */ - if (missing && !backedOff) { + if (missing && !peer->backedOff) { struct clock c = peer->timeout; struct clock max_to = {3, 0}; clock_Add(&peer->timeout, &c); if (clock_Gt(&peer->timeout, &max_to)) peer->timeout = max_to; - backedOff = 1; + peer->backedOff = 1; } /* If packet isn't yet acked, and it has been transmitted at least @@ -6486,6 +6485,9 @@ rxi_ComputeRoundTripTime(struct rx_packet *p, clock_Zero(&(peer->timeout)); clock_Addmsec(&(peer->timeout), rtt_timeout); + /* Reset the backedOff flag since we just computed a new timeout value */ + peer->backedOff = 0; + dpf(("rxi_ComputeRoundTripTime(call=%d packet=%"AFS_PTR_FMT" rtt=%d ms, srtt=%d ms, rtt_dev=%d ms, timeout=%d.%06d sec)\n", p->header.callNumber, p, MSEC(rttp), peer->rtt >> 3, peer->rtt_dev >> 2, (peer->timeout.sec), (peer->timeout.usec))); } diff --git a/src/rx/rx.h b/src/rx/rx.h index f75103037..e7c10e88d 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -401,6 +401,7 @@ struct rx_peer { int rtt; /* Smoothed round trip time, measured in milliseconds/8 */ int rtt_dev; /* Smoothed rtt mean difference, in milliseconds/4 */ struct clock timeout; /* Current retransmission delay */ + int backedOff; /* Has the timeout been backed off due to a missing packet? */ int nSent; /* Total number of distinct data packets sent, not including retransmissions */ int reSends; /* Total number of retransmissions for this peer, since this structure was created */