From 310cec9933d1ff3a74bcbe716dba5ade9cc28d15 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 29 Sep 2009 05:34:30 -0400 Subject: [PATCH] rx window size increase window size was previously pushed to 64; push to 128. as this increases memory use, anything further should be arguably tied to rx-using-program's resource allocation preferences, e.g. fileserver -LL should be willing to up this Reviewed-on: http://gerrit.openafs.org/549 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/libafsrpc/afsrpc.def | 4 ++++ src/rx/rx_globals.c | 26 ++++++++++++++++++++++++++ src/rx/rx_globals.h | 7 +++---- src/rx/rx_prototypes.h | 5 ++++- src/shlibafsrpc/libafsrpc.map | 4 ++++ 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index d721b3a8b..35fa38075 100755 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -249,6 +249,10 @@ EXPORTS rxi_CallError @254 rx_GetLocalPeers @255 xdr_alloc @256 + rx_GetMaxReceiveWindow @257 + rx_GetMaxSendWindow @258 + rx_SetMaxReceiveWindow @259 + rx_SetMaxSendWindow @260 ; for performance testing rx_TSFPQGlobSize @2001 DATA diff --git a/src/rx/rx_globals.c b/src/rx/rx_globals.c index 5f26af51e..1cad13cf9 100644 --- a/src/rx/rx_globals.c +++ b/src/rx/rx_globals.c @@ -46,6 +46,32 @@ #include "rx_globals.h" +void rx_SetMaxReceiveWindow(int packets) +{ + if (packets > rx_maxWindow) + packets = rx_maxWindow; + + rx_maxReceiveWindow = packets; +} + +int rx_GetMaxReceiveWindow(void) +{ + return rx_maxReceiveWindow; +} + +void rx_SetMaxSendWindow(int packets) +{ + if (packets > rx_maxWindow) + packets = rx_maxWindow; + + rx_maxSendWindow = packets; +} + +int rx_GetMaxSendWindow(void) +{ + return rx_maxSendWindow; +} + #ifdef AFS_NT40_ENV void rx_SetRxDeadTime(int seconds) diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index ab0ff589d..a7557da75 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -125,10 +125,11 @@ EXT int rx_BusyError GLOBALSINIT(-1); * other packet. */ EXT int rx_minWindow GLOBALSINIT(1); +EXT int rx_maxWindow GLOBALSINIT(65535); /* twind is u_short */ EXT int rx_initReceiveWindow GLOBALSINIT(16); /* how much to accept */ -EXT int rx_maxReceiveWindow GLOBALSINIT(64); /* how much to accept */ +EXT int rx_maxReceiveWindow GLOBALSINIT(128); /* how much to accept */ EXT int rx_initSendWindow GLOBALSINIT(16); -EXT int rx_maxSendWindow GLOBALSINIT(64); +EXT int rx_maxSendWindow GLOBALSINIT(128); EXT int rx_nackThreshold GLOBALSINIT(3); /* Number NACKS to trigger congestion recovery */ EXT int rx_nDgramThreshold GLOBALSINIT(4); /* Number of packets before increasing * packets per datagram */ @@ -148,8 +149,6 @@ EXT int rxi_SoftAckRate GLOBALSINIT(RX_FAST_ACK_RATE); send a soft ack, immediately followed by a hard ack. */ EXT int rxi_HardAckRate GLOBALSINIT(RX_FAST_ACK_RATE + 1); -/* EXT int rx_maxWindow GLOBALSINIT(15); Temporary HACK: transmit/receive window */ - /* If window sizes become very variable (in terms of #packets), be * sure that the sender can get back a hard acks without having to wait for * some kind of timer event first (like a keep-alive, for instance). diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h index 94009be0a..dce96d452 100755 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -346,7 +346,10 @@ extern int rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], int maxSize); /* rx_globals.c */ - +extern int rx_GetMaxReceiveWindow(void); +extern int rx_GetMaxSendWindow(void); +extern void rx_SetMaxReceiveWindow(int packets); +extern void rx_SetMaxSendWindow(int packets); /* rx_kcommon.c */ struct socket; diff --git a/src/shlibafsrpc/libafsrpc.map b/src/shlibafsrpc/libafsrpc.map index 57266e0c6..c38f7b30a 100755 --- a/src/shlibafsrpc/libafsrpc.map +++ b/src/shlibafsrpc/libafsrpc.map @@ -121,6 +121,10 @@ lcstring; AssertionFailed; rx_GetLocalPeers; + rx_GetMaxReceiveWindow; + rx_GetMaxSendWindow; + rx_SetMaxReceiveWindow; + rx_SetMaxSendWindow; local: *; -- 2.39.5