afsd-rxpck-switch-20050320
authorErvin Fenyak <efenyak@gamax.hu>
Sun, 20 Mar 2005 14:32:06 +0000 (14:32 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 20 Mar 2005 14:32:06 +0000 (14:32 +0000)
FIXES 17837

add rxpck switch to afsd to allow overrding maxpackets

src/afs/afs_call.c
src/afsd/afsd.c
src/config/afs_args.h

index c165afd..6262ebf 100644 (file)
@@ -100,6 +100,8 @@ afs_int32 afs_rx_harddead = AFS_HARDDEADTIME;
 static int
   Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval);
 
+static int afscall_set_rxpck_received = 0;
+
 #if defined(AFS_HPUX_ENV)
 extern int afs_vfs_mount();
 #endif /* defined(AFS_HPUX_ENV) */
@@ -128,6 +130,7 @@ afs_InitSetup(int preallocs)
     memset(afs_zeros, 0, AFS_ZEROS);
 
     /* start RX */
+    if(!afscall_set_rxpck_received)
     rx_extraPackets = AFS_NRXPACKETS;  /* smaller # of packets */
     code = rx_InitHost(rx_bindhost, htons(7001));
     if (code) {
@@ -901,6 +904,9 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
        code = 0;
     } else if (parm == AFSOP_SET_BACKUPTREE) {
        afs_bkvolpref = parm2;
+    } else if (parm == AFSOP_SET_RXPCK) {
+       rx_extraPackets = parm2;
+       afscall_set_rxpck_received = 1;
     } else
        code = EINVAL;
 
index 4c2eca1..bfc60b6 100644 (file)
@@ -79,6 +79,7 @@ RCSID
 #include <sys/time.h>
 #include <dirent.h>
 
+
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
@@ -177,9 +178,11 @@ kern_return_t DiskArbDiskAppearedWithMountpointPing_auto(char *, unsigned int,
 #endif
 #endif
 
+
 #undef VIRTUE
 #undef VICE
 
+
 #define CACHEINFOFILE   "cacheinfo"
 #define        AFSLOGFILE      "AFSLog"
 #define        DCACHEFILE      "CacheItems"
@@ -192,6 +195,7 @@ char LclCellName[64];
 
 #define MAX_CACHE_LOOPS 4
 
+
 /*
  * Internet address (old style... should be updated).  This was pulled out of the old 4.2
  * version of <netinet/in.h>, since it's still useful.
@@ -1507,6 +1511,17 @@ mainproc(as, arock)
        cacheSetTime = TRUE;
     }
 
+    /* set rx_extraPackets */
+    if (as->parms[33].items) {
+       /* -rxpck */
+       int rxpck = atoi(as->parms[33].items->data);
+       printf("afsd: set rxpck = %d\n",rxpck);
+       code = call_syscall(AFSOP_SET_RXPCK, rxpck);
+       if (code) {
+       printf("afsd: failed to set rxpck\n");
+       exit(1);
+       }
+    }
     
     /*
      * Pull out all the configuration info for the workstation's AFS cache and
@@ -2186,6 +2201,7 @@ main(argc, argv)
     cmd_AddParm(ts, "-rxbind", CMD_FLAG, CMD_OPTIONAL, "Bind the Rx socket (one interface only)");
     cmd_AddParm(ts, "-settime", CMD_FLAG, CMD_OPTIONAL,
                "don't set the time");
+    cmd_AddParm(ts, "-rxpck", CMD_SINGLE, CMD_OPTIONAL, "set rx_extraPackets to this value");
     return (cmd_Dispatch(argc, argv));
 }
 
index 7f19687..0c8b263 100644 (file)
@@ -46,6 +46,7 @@
 #define        AFSOP_SET_THISCELL       35     /* set the primary cell */
 #define AFSOP_BASIC_INIT        36     /* used to be part of START_AFS */
 #define AFSOP_SET_BACKUPTREE    37     /* enable backup tree support */
+#define AFSOP_SET_RXPCK                 38     /*set rx_extraPackets*/
 
 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
 #define        AFSCALL_PIOCTL          20