From f1174887c3bda7d1d5fa4a305e27db493fa15720 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 17 Jun 2011 19:12:09 +0100 Subject: [PATCH] rx: Make rx_softAckDelay & rx_lastAckDelay private The values of these two parameters directly affect the modifiers that are needed in the peer's RTT calculations, and so can not arbitrarily be changed by applications. lastAckDelay has been 400ms since the first OpenAFS release, and that value is used as a modifier when computing the timeout of the last packet. It is likely that any change which made this value longer than 400ms would have detrimental effects on deployed clients softAckDelay has been 100ms for a similar time period. We have chopped and changed the value of minPeerTimeout, so it is unclear what the maximal value for this parameter is. For much of OpenAFS's life, minPeerTimeout was a 350ms padding value, which suggests that copying TCP, and setting the maximal value at 200ms would be a safe option. For now, however, leave it at 100ms to avoid unexpected side effects. hardAckDelay is not addressed by this patch set, as all ACK packets sent from the application thread are marked as delayed, and so currently have no part in computing RTT times. It is likely, however, that any changes to the hard ACK timeout should be very carefully considered. Reviewed-on: http://gerrit.openafs.org/4858 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit c0cfbc40c8ef3de65f144560918cbd2a5bf187ec) Change-Id: I7976d8d11007c0f597ede707db7cbb617956bd29 Reviewed-on: http://gerrit.openafs.org/4909 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/rx.c | 23 +++++++++++++++++++---- src/rx/rx_globals.h | 8 -------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 13b2243db..d04670b6f 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -140,6 +140,25 @@ struct rx_tq_debug { } rx_tq_debug; #endif /* AFS_GLOBAL_RXLOCK_KERNEL */ +/* Constant delay time before sending an acknowledge of the last packet + * received. This is to avoid sending an extra acknowledge when the + * client is about to make another call, anyway, or the server is + * about to respond. + * + * The lastAckDelay may not exceeed 400ms without causing peers to + * unecessarily timeout. + */ +struct clock rx_lastAckDelay = {0, 400000}; + +/* Constant delay time before sending a soft ack when none was requested. + * This is to make sure we send soft acks before the sender times out, + * Normally we wait and send a hard ack when the receiver consumes the packet + * + * This value has been 100ms in all shipping versions of OpenAFS. Changing it + * will require changes to the peer's RTT calculations. + */ +struct clock rx_softAckDelay = {0, 100000}; + /* * rxi_rpc_peer_stat_cnt counts the total number of peer stat structures * currently allocated within rx. This number is used to allocate the @@ -587,12 +606,8 @@ rx_InitHost(u_int host, u_int port) rx_connHashTable = (struct rx_connection **)htable; rx_peerHashTable = (struct rx_peer **)ptable; - rx_lastAckDelay.sec = 0; - rx_lastAckDelay.usec = 400000; /* 400 milliseconds */ rx_hardAckDelay.sec = 0; rx_hardAckDelay.usec = 100000; /* 100 milliseconds */ - rx_softAckDelay.sec = 0; - rx_softAckDelay.usec = 100000; /* 100 milliseconds */ rxevent_Init(20, rxi_ReScheduleEvents); diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index 1069eb582..c4c829964 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -49,9 +49,6 @@ EXT struct rx_queue rx_incomingCallQueue; /* Server processes wait on this queue when there are no appropriate calls to process */ EXT struct rx_queue rx_idleServerQueue; -/* Constant delay time before sending an acknowledge of the last packet received. This is to avoid sending an extra acknowledge when the client is about to make another call, anyway, or the server is about to respond. */ -EXT struct clock rx_lastAckDelay; - /* Constant delay time before sending a hard ack if the receiver consumes * a packet while no delayed ack event is scheduled. Ensures that the * sender is able to advance its window when the receiver consumes a packet @@ -59,11 +56,6 @@ EXT struct clock rx_lastAckDelay; */ EXT struct clock rx_hardAckDelay; -/* Constant delay time before sending a soft ack when none was requested. - * This is to make sure we send soft acks before the sender times out, - * Normally we wait and send a hard ack when the receiver consumes the packet */ -EXT struct clock rx_softAckDelay; - #if defined(RXDEBUG) || defined(AFS_NT40_ENV) /* Variable to allow introduction of network unreliability; exported from libafsrpc */ EXT int rx_intentionallyDroppedPacketsPer100 GLOBALSINIT(0); /* Dropped on Send */ -- 2.39.5