From efda40565de69c3b144d78b77c32d8d7d2833211 Mon Sep 17 00:00:00 2001 From: Ervin Fenyak Date: Sun, 20 Mar 2005 14:32:06 +0000 Subject: [PATCH] afsd-rxpck-switch-20050320 FIXES 17837 add rxpck switch to afsd to allow overrding maxpackets --- src/afs/afs_call.c | 6 ++++++ src/afsd/afsd.c | 16 ++++++++++++++++ src/config/afs_args.h | 1 + 3 files changed, 23 insertions(+) diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index c165afd38..6262ebfd6 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -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; diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 4c2eca128..bfc60b6b8 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -79,6 +79,7 @@ RCSID #include #include + #ifdef HAVE_SYS_PARAM_H #include #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 , 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)); } diff --git a/src/config/afs_args.h b/src/config/afs_args.h index 7f19687bb..0c8b26383 100644 --- a/src/config/afs_args.h +++ b/src/config/afs_args.h @@ -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 -- 2.39.5