]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced-make-send-buffersize-tunable-20021122
authorDerrick Brashear <shadow@dementia.org>
Sat, 23 Nov 2002 01:51:43 +0000 (01:51 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 23 Nov 2002 01:51:43 +0000 (01:51 +0000)
idea from chas williams. arguably should be made larger than 16k also.

src/viced/afsfileprocs.c
src/viced/callback.c
src/viced/viced.c
src/viced/viced_prototypes.h

index 37fcde59e95587b1c2831bd93dfdb8dc6ce92d21..7865c96a3e9fd7f9ccd22dcab5336f6377011451 100644 (file)
@@ -1874,8 +1874,6 @@ afs_int32 SRXAFS_ResidencyCmd (struct rx_call *acall, struct AFSFid *Fid,
     return EINVAL;
 }
 
-#define        AFSV_BUFFERSIZE 16384 
-
 static struct afs_buffer {
     struct afs_buffer *next;
 } *freeBufferList = 0;
@@ -1901,7 +1899,7 @@ static char *AllocSendBuffer()
     afs_buffersAlloced++;
     if (!freeBufferList) {
        FS_UNLOCK
-       return malloc(AFSV_BUFFERSIZE);
+       return malloc(sendBufSize);
     }
     tp = freeBufferList;
     freeBufferList = tp->next;
@@ -6521,7 +6519,7 @@ FetchData_RXStyle(Volume *volptr,
     ihP = targetptr->handle;
     fdP = IH_OPEN(ihP);
     if (fdP == NULL) return EIO;
-    optSize = AFSV_BUFFERSIZE;
+    optSize = sendBufSize;
     tlen = FDH_SIZE(fdP);
     if (tlen < 0) {
        FDH_CLOSE(fdP);
@@ -6799,7 +6797,7 @@ StoreData_RXStyle(Volume *volptr,
 
     TM_GetTimeOfDay(&StartTime, 0);
 
-    optSize = AFSV_BUFFERSIZE;
+    optSize = sendBufSize;
 
     /* truncate the file iff it needs it (ftruncate is slow even when its a noop) */
     if (FileLength < DataLength) FDH_TRUNC(fdP, FileLength);
index e70682546acd5fe634f725250a487d49f2f617c6..5ce38169ef2051ea289f66051d0167d84545b358 100644 (file)
@@ -163,7 +163,7 @@ struct CallBack {
     unsigned short  spare;              /* make it a multiple of 32 bits. */
 } *CB; /* Don't use CB[0] */
 
-/* status bits for status field of CallBack structure */
+/* status values for status field of CallBack structure */
 #define CB_NORMAL   1  /* Normal call back */
 #define CB_DELAYED  2  /* Delayed call back due to rpc problems.
                        The call back entry will be added back to the
index e66c114a463d19da11b207ec7b9726ec7ae53f05..d390c4b8e1cc977968bea0980056db9700c70ce8 100644 (file)
@@ -165,6 +165,7 @@ int     buffs = 90;         /* 70 */
 int    novbc = 0;              /* Enable Volume Break calls */
 int     busy_threshold = 600;
 int    udpBufSize = 0;         /* UDP buffer size for receive*/
+int    sendBufSize = 16384;    /* send buffer size */
 
 struct timeval  tp;
 
@@ -581,6 +582,7 @@ static void FlagMsg()
     strcat(buffer, "[-k <stack size>] ");
     strcat(buffer, "[-realm <Kerberos realm name>] ");
     strcat(buffer, "[-udpsize <size of socket buffer in bytes>] ");
+    strcat(buffer, "[-sendsize <size of send buffer in bytes>] ");
 /*   strcat(buffer, "[-enable_peer_stats] "); */
 /*   strcat(buffer, "[-enable_process_stats] "); */
     strcat(buffer, "[-help]\n");
@@ -833,6 +835,19 @@ static int ParseArgs(int argc, char *argv[])
                else
                    udpBufSize = bufSize;
            }
+       else
+           if ( !strcmp(argv[i], "-sendsize")) {
+               if ( (i+1) >= argc ) {
+                   printf("You have to specify -sendsize <integer value>\n");
+                   return -1;
+               }
+               bufSize = atoi(argv[++i]);
+               if ( bufSize < 16384 )
+                   printf("Warning:sendsize %d is less than minimum %d; ignoring\n",
+                               bufSize, 16384);
+               else
+                   sendBufSize = bufSize;
+           }
        else
            if (!strcmp(argv[i], "-enable_peer_stats")) {
                rx_enablePeerRPCStats();
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c444754786f78f4795f2bcf21a887c30584bf058 100644 (file)
@@ -0,0 +1 @@
+extern int sendBufSize;