mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
Rx: Permit ADAPT_WINDOW code to build
Add missing fields to rx data structures. Update variable references. Reviewed-on: http://gerrit.openafs.org/2783 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org> (cherry picked from commit be91260047627fb4fffeeed73c7f24c80448c673) Change-Id: I2f5db5cc88919e61d09d5d1dbbb2679c0b9d1415 Reviewed-on: http://gerrit.openafs.org/3101
This commit is contained in:
parent
8d2dbb7a96
commit
b740896e82
29
src/rx/rx.c
29
src/rx/rx.c
@ -5622,8 +5622,9 @@ rxi_Start(struct rxevent *event,
|
|||||||
* recent additions.
|
* recent additions.
|
||||||
* Do a dance to avoid blocking after setting now. */
|
* Do a dance to avoid blocking after setting now. */
|
||||||
MUTEX_ENTER(&peer->peer_lock);
|
MUTEX_ENTER(&peer->peer_lock);
|
||||||
retryTime = peer->timeout;
|
retryTime = peer->timeout;
|
||||||
MUTEX_EXIT(&peer->peer_lock);
|
MUTEX_EXIT(&peer->peer_lock);
|
||||||
|
|
||||||
clock_GetTime(&now);
|
clock_GetTime(&now);
|
||||||
clock_Add(&retryTime, &now);
|
clock_Add(&retryTime, &now);
|
||||||
usenow = now;
|
usenow = now;
|
||||||
@ -6833,7 +6834,7 @@ rxi_ComputeRate(struct rx_peer *peer, struct rx_call *call,
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
xferSize = rx_AckDataSize(rx_Window) + RX_HEADER_SIZE;
|
xferSize = rx_AckDataSize(rx_maxSendWindow) + RX_HEADER_SIZE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -6888,9 +6889,9 @@ rxi_ComputeRate(struct rx_peer *peer, struct rx_call *call,
|
|||||||
* one packet exchange */
|
* one packet exchange */
|
||||||
if (clock_Gt(&newTO, &peer->timeout)) {
|
if (clock_Gt(&newTO, &peer->timeout)) {
|
||||||
|
|
||||||
dpf(("CONG peer %lx/%u: timeout %d.%06d ==> %ld.%06d (rtt %u, ps %u)",
|
dpf(("CONG peer %lx/%u: timeout %d.%06d ==> %ld.%06d (rtt %u)",
|
||||||
ntohl(peer->host), ntohs(peer->port), peer->timeout.sec, peer->timeout.usec,
|
ntohl(peer->host), ntohs(peer->port), peer->timeout.sec, peer->timeout.usec,
|
||||||
newTO.sec, newTO.usec, peer->smRtt, peer->packetSize));
|
newTO.sec, newTO.usec, peer->smRtt));
|
||||||
|
|
||||||
peer->timeout = newTO;
|
peer->timeout = newTO;
|
||||||
}
|
}
|
||||||
@ -6900,18 +6901,18 @@ rxi_ComputeRate(struct rx_peer *peer, struct rx_call *call,
|
|||||||
/* Now, convert to the number of full packets that could fit in a
|
/* Now, convert to the number of full packets that could fit in a
|
||||||
* reasonable fraction of that interval */
|
* reasonable fraction of that interval */
|
||||||
minTime /= (peer->smRtt << 1);
|
minTime /= (peer->smRtt << 1);
|
||||||
|
minTime = MAX(minTime, rx_minPeerTimeout);
|
||||||
xferSize = minTime; /* (make a copy) */
|
xferSize = minTime; /* (make a copy) */
|
||||||
|
|
||||||
/* Now clamp the size to reasonable bounds. */
|
/* Now clamp the size to reasonable bounds. */
|
||||||
if (minTime <= 1)
|
if (minTime <= 1)
|
||||||
minTime = 1;
|
minTime = 1;
|
||||||
else if (minTime > rx_Window)
|
else if (minTime > rx_maxSendWindow)
|
||||||
minTime = rx_Window;
|
minTime = rx_maxSendWindow;
|
||||||
/* if (minTime != peer->maxWindow) {
|
/* if (minTime != peer->maxWindow) {
|
||||||
dpf(("CONG peer %lx/%u: windowsize %lu ==> %lu (to %lu.%06lu, rtt %u, ps %u)",
|
dpf(("CONG peer %lx/%u: windowsize %lu ==> %lu (to %lu.%06lu, rtt %u)",
|
||||||
ntohl(peer->host), ntohs(peer->port), peer->maxWindow, minTime,
|
ntohl(peer->host), ntohs(peer->port), peer->maxWindow, minTime,
|
||||||
peer->timeout.sec, peer->timeout.usec, peer->smRtt,
|
peer->timeout.sec, peer->timeout.usec, peer->smRtt));
|
||||||
peer->packetSize));
|
|
||||||
peer->maxWindow = minTime;
|
peer->maxWindow = minTime;
|
||||||
elide... call->twind = minTime;
|
elide... call->twind = minTime;
|
||||||
}
|
}
|
||||||
@ -6920,13 +6921,13 @@ rxi_ComputeRate(struct rx_peer *peer, struct rx_call *call,
|
|||||||
/* Cut back on the peer timeout if it had earlier grown unreasonably.
|
/* Cut back on the peer timeout if it had earlier grown unreasonably.
|
||||||
* Discern this by calculating the timeout necessary for rx_Window
|
* Discern this by calculating the timeout necessary for rx_Window
|
||||||
* packets. */
|
* packets. */
|
||||||
if ((xferSize > rx_Window) && (peer->timeout.sec >= 3)) {
|
if ((xferSize > rx_maxSendWindow) && (peer->timeout.sec >= 3)) {
|
||||||
/* calculate estimate for transmission interval in milliseconds */
|
/* calculate estimate for transmission interval in milliseconds */
|
||||||
minTime = rx_Window * peer->smRtt;
|
minTime = rx_maxSendWindow * peer->smRtt;
|
||||||
if (minTime < 1000) {
|
if (minTime < 1000) {
|
||||||
dpf(("CONG peer %lx/%u: cut TO %d.%06d by 0.5 (rtt %u, ps %u)",
|
dpf(("CONG peer %lx/%u: cut TO %d.%06d by 0.5 (rtt %u)",
|
||||||
ntohl(peer->host), ntohs(peer->port), peer->timeout.sec,
|
ntohl(peer->host), ntohs(peer->port), peer->timeout.sec,
|
||||||
peer->timeout.usec, peer->smRtt, peer->packetSize));
|
peer->timeout.usec, peer->smRtt));
|
||||||
|
|
||||||
newTO.sec = 0; /* cut back on timeout by half a second */
|
newTO.sec = 0; /* cut back on timeout by half a second */
|
||||||
newTO.usec = 500000;
|
newTO.usec = 500000;
|
||||||
@ -7129,7 +7130,7 @@ void
|
|||||||
rx_PrintPeerStats(FILE * file, struct rx_peer *peer)
|
rx_PrintPeerStats(FILE * file, struct rx_peer *peer)
|
||||||
{
|
{
|
||||||
fprintf(file, "Peer %x.%d. " "Burst size %d, " "burst wait %d.%06d.\n",
|
fprintf(file, "Peer %x.%d. " "Burst size %d, " "burst wait %d.%06d.\n",
|
||||||
ntohl(peer->host), (int)peer->port, (int)peer->burstSize,
|
ntohl(peer->host), (int)ntohs(peer->port), (int)peer->burstSize,
|
||||||
(int)peer->burstWait.sec, (int)peer->burstWait.usec);
|
(int)peer->burstWait.sec, (int)peer->burstWait.usec);
|
||||||
|
|
||||||
fprintf(file,
|
fprintf(file,
|
||||||
|
@ -436,6 +436,11 @@ struct rx_peer {
|
|||||||
struct rx_queue rpcStats; /* rpc statistic list */
|
struct rx_queue rpcStats; /* rpc statistic list */
|
||||||
int lastReachTime; /* Last time we verified reachability */
|
int lastReachTime; /* Last time we verified reachability */
|
||||||
afs_int32 maxPacketSize; /* peer packetsize hint */
|
afs_int32 maxPacketSize; /* peer packetsize hint */
|
||||||
|
|
||||||
|
#ifdef ADAPT_WINDOW
|
||||||
|
afs_int32 smRtt;
|
||||||
|
afs_int32 countDown;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef KDUMP_RX_LOCK
|
#ifndef KDUMP_RX_LOCK
|
||||||
@ -578,6 +583,9 @@ struct rx_call {
|
|||||||
afs_hyper_t bytesRcvd; /* Number bytes received */
|
afs_hyper_t bytesRcvd; /* Number bytes received */
|
||||||
u_short tqWaiters;
|
u_short tqWaiters;
|
||||||
|
|
||||||
|
#ifdef ADAPT_WINDOW
|
||||||
|
struct clock pingRequestTime;
|
||||||
|
#endif
|
||||||
#ifdef RXDEBUG_PACKET
|
#ifdef RXDEBUG_PACKET
|
||||||
u_short tqc; /* packet count in tq */
|
u_short tqc; /* packet count in tq */
|
||||||
u_short rqc; /* packet count in rq */
|
u_short rqc; /* packet count in rq */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user