From 12c8abc69030d3368194b148c692215c61b5da9c Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 25 Aug 2008 02:14:39 +0000 Subject: [PATCH] server-argument-consistency-and-jumbograms-off-20080824 LICENSE IPL10 FIXES 108703 go through and make servers able to take debug log level on command line; add -jumbo; default to -nojumbo --- doc/man-pages/pod8/fileserver.pod | 11 ++++++++++- doc/man-pages/pod8/ptserver.pod | 9 ++++++++- doc/man-pages/pod8/vlserver.pod | 19 +++++++++++++++---- doc/man-pages/pod8/volserver.pod | 21 +++++++++++++++++++++ src/ptserver/ptserver.c | 16 ++++++++++++---- src/viced/viced.c | 6 +++++- src/vlserver/vlserver.c | 19 +++++++++++++------ src/volser/volmain.c | 20 +++++++++++++++----- 8 files changed, 99 insertions(+), 22 deletions(-) diff --git a/doc/man-pages/pod8/fileserver.pod b/doc/man-pages/pod8/fileserver.pod index 0b8c26a7f0..d4dd558444 100644 --- a/doc/man-pages/pod8/fileserver.pod +++ b/doc/man-pages/pod8/fileserver.pod @@ -30,6 +30,7 @@ B S<<< [B<-auditlog> >] >>> S<<< [B<-rxdbge>] >>> S<<< [B<-rxmaxmtu> >] >>> S<<< [B<-nojumbo> >>> + S<<< [B<-jumbo> >>> S<<< [B<-rxbind> >>> S<<< [B<-allow-dotted-principals>] >>> S<<< [B<-L>] >>> @@ -384,9 +385,17 @@ retransmissions) to the file F. Defines the maximum size of an MTU. The value must be between the minimum and maximum packet data sizes for Rx. +=item B<-jumbo> + +Allows the server to send and receive jumbograms. A jumbogram is +a large-size packet composed of 2 to 4 normal Rx data packets that share +the same header. The fileserver does not use jumbograms by default, as some +routers are not capable of properly breaking the jumbogram into smaller +packets and reassembling them. + =item B<-nojumbo> -Do not send, and do not accept, jumbograms. +Deprecated; jumbograms are disabled by default. =item B<-rxbind> diff --git a/doc/man-pages/pod8/ptserver.pod b/doc/man-pages/pod8/ptserver.pod index 454ae926ce..aff50f9e01 100644 --- a/doc/man-pages/pod8/ptserver.pod +++ b/doc/man-pages/pod8/ptserver.pod @@ -7,7 +7,7 @@ ptserver - Initializes the Protection Server =for html
-B S<<< [B<-database> | B<-db> >] >>> S<<< [B<-p> >] >>> +B S<<< [B<-database> | B<-db> >] >>> S<<< [B<-p> >] >>> S<<< [B<-d> >] >>> [B<-rebuildDB>] S<<< [B<-groupdepth> >] >>> S<<< [B<-default_access> > >] >>> [B<-restricted>] [B<-enable_peer_stats>] @@ -68,6 +68,13 @@ suites. Provide the command name and all option names in full. =over 4 +=item B<-d> > + +Sets the detail level for the debugging trace written to the +F file. Provide one of the following values, each +of which produces an increasingly detailed trace: C<0>, C<1>, C<5>, C<25>, +and C<125>. + =item B<-database> >, B<-db> > Specifies the pathname of an alternate directory in which the Protection diff --git a/doc/man-pages/pod8/vlserver.pod b/doc/man-pages/pod8/vlserver.pod index 60978e56c6..efc08a2b21 100644 --- a/doc/man-pages/pod8/vlserver.pod +++ b/doc/man-pages/pod8/vlserver.pod @@ -7,7 +7,7 @@ vlserver - Initializes the Volume Location Server =for html
-B S<<< [B<-p> >] >>> [B<-nojumbo>] [B<-rxbind>] +B S<<< [B<-p> >] >>> [B<-nojumbo>] [B<-jumbo>] [B<-rxbind>] S<<< [B<-d> >] >>> [B<-allow-dotted-principal>] [B<-enable_peer_stats>] [B<-enable_process_stats>] [B<-help>] @@ -55,19 +55,30 @@ suites. Provide the command name and all option names in full. =over 4 +=item B<-d> > + +Sets the detail level for the debugging trace written to the +F file. Provide one of the following values, each +of which produces an increasingly detailed trace: C<0>, C<1>, C<5>, C<25>, +and C<125>. + =item B<-p> > Sets the number of server lightweight processes (LWPs or pthreads) to run. Provide an integer between C<3> and C<16>. The default is C<9>. -=item B<-nojumbo> +=item B<-jumbo> -Prohibits the server from sending or receiving jumbograms. A jumbogram is +Allows the server to send and receive jumbograms. A jumbogram is a large-size packet composed of 2 to 4 normal Rx data packets that share -the same header. The VL Server uses jumbograms by default, but some +the same header. The VL Server does not use jumbograms by default, as some routers are not capable of properly breaking the jumbogram into smaller packets and reassembling them. +=item B<-nojumbo> + +Deprecated; Jumbograms are disabled by default. + =item B<-enable_peer_stats> Activates the collection of Rx statistics and allocates memory for their diff --git a/doc/man-pages/pod8/volserver.pod b/doc/man-pages/pod8/volserver.pod index 0fe4885126..7b447ca7a3 100644 --- a/doc/man-pages/pod8/volserver.pod +++ b/doc/man-pages/pod8/volserver.pod @@ -9,6 +9,8 @@ volserver - Initializes the Volume Server component of the fs process B [B<-log>] S<<< [B<-p> >] >>> S<<< [B<-udpsize> >] >>> + S<<< [B<-d> >] >>> + [B<-nojumbo>] [B<-jumbo>] [B<-enable_peer_stats>] [B<-enable_process_stats>] [B<-allow-dotted-principal>] [B<-help>] @@ -45,6 +47,13 @@ suites. Provide the command name and all option names in full. =over 4 +=item B<-d> > + +Sets the detail level for the debugging trace written to the +F file. Provide one of the following values, each +of which produces an increasingly detailed trace: C<0>, C<1>, C<5>, C<25>, +and C<125>. + =item B<-log> Records in the /usr/afs/logs/VolserLog file the names of all users who @@ -62,6 +71,18 @@ integer between C<4> and C<16>. The default is C<9>. Sets the size of the UDP buffer in bytes, which is 64 KB by default. Provide a positive integer, preferably larger than the default. +=item B<-jumbo> + +Allows the server to send and receive jumbograms. A jumbogram is +a large-size packet composed of 2 to 4 normal Rx data packets that share +the same header. The volserver does not use jumbograms by default, as some +routers are not capable of properly breaking the jumbogram into smaller +packets and reassembling them. + +=item B<-nojumbo> + +Deprecated; jumbograms are disabled by default. + =item B<-enable_peer_stats> Activates the collection of Rx statistics and allocates memory for their diff --git a/src/ptserver/ptserver.c b/src/ptserver/ptserver.c index bda4e05f10..215cfe81f2 100644 --- a/src/ptserver/ptserver.c +++ b/src/ptserver/ptserver.c @@ -160,6 +160,7 @@ extern int afsconf_CheckAuth(); int pr_realmNameLen; char *pr_realmName; +int debuglevel = 0; int restricted = 0; int rxMaxMTU = -1; int rxBind = 0; @@ -280,6 +281,13 @@ main(int argc, char **argv) if ((strncmp(arg, "-database", alen) == 0) || (strncmp(arg, "-db", alen) == 0)) { pr_dbaseName = argv[++a]; /* specify a database */ + } else if (strcmp(argv[a], "-d") == 0) { + if ((a + 1) >= argc) { + fprintf(stderr, "missing argument for -d\n"); + return -1; + } + debuglevel = atoi(argv[++a]); + LogLevel = debuglevel; } else if (strncmp(arg, "-p", alen) == 0) { lwps = atoi(argv[++a]); if (lwps > 16) { /* maximum of 16 */ @@ -378,7 +386,7 @@ main(int argc, char **argv) #ifndef AFS_NT40_ENV printf("Usage: ptserver [-database ] " "[-auditlog ] " - "[-syslog[=FACILITY]] " + "[-syslog[=FACILITY]] [-d ] " "[-p ] [-rebuild] " "[-groupdepth ] " "[-restricted] [-rxmaxmtu ] [-rxbind] " @@ -388,7 +396,7 @@ main(int argc, char **argv) "[-help]\n"); #else /* AFS_NT40_ENV */ printf("Usage: ptserver [-database ] " - "[-auditlog ] " + "[-auditlog ] [-d ] " "[-p ] [-rebuild] [-rxbind] " "[-allow-dotted-principals] " "[-default_access default_user_access default_group_access] " @@ -398,7 +406,7 @@ main(int argc, char **argv) #else #ifndef AFS_NT40_ENV printf("Usage: ptserver [-database ] " - "[-auditlog ] " + "[-auditlog ] [-d ] " "[-syslog[=FACILITY]] " "[-p ] [-rebuild] " "[-enable_peer_stats] [-enable_process_stats] " @@ -408,7 +416,7 @@ main(int argc, char **argv) "[-help]\n"); #else /* AFS_NT40_ENV */ printf("Usage: ptserver [-database ] " - "[-auditlog ] " + "[-auditlog ] [-d ] " "[-default_access default_user_access default_group_access] " "[-restricted] [-rxmaxmtu ] [-rxbind] " "[-allow-dotted-principals] " diff --git a/src/viced/viced.c b/src/viced/viced.c index d3fd3c022d..9a7d039f9c 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -162,7 +162,7 @@ int SawSpare; int SawPctSpare; int debuglevel = 0; int printBanner = 0; -int rxJumbograms = 1; /* default is to send and receive jumbograms. */ +int rxJumbograms = 0; /* default is to not send and receive jumbograms. */ int rxBind = 0; /* don't bind */ int rxkadDisableDotCheck = 0; /* disable check for dot in principal name */ int rxMaxMTU = -1; @@ -922,6 +922,8 @@ FlagMsg() fputs("[-udpsize ] ", stdout); fputs("[-sendsize ] ", stdout); fputs("[-abortthreshold ] ", stdout); + fputs("[-nojumbo (disable jumbogram network packets - deprecated)] ", stdout); + fputs("[-jumbo (enable jumbogram network packets)] ", stdout); /* fputs("[-enable_peer_stats] ", stdout); */ /* fputs("[-enable_process_stats] ", stdout); */ fputs("[-help]\n", stdout); @@ -1272,6 +1274,8 @@ ParseArgs(int argc, char *argv[]) #endif else if (!strcmp(argv[i], "-nojumbo")) { rxJumbograms = 0; + } else if (!strcmp(argv[i], "-jumbo")) { + rxJumbograms = 1; } else if (!strcmp(argv[i], "-rxbind")) { rxBind = 1; } else if (!strcmp(argv[i], "-allow-dotted-principals")) { diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index af7453fcbc..dcc25e8c5c 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -63,10 +63,11 @@ extern int afsconf_ServerAuth(); static void *CheckSignal(void*); int LogLevel = 0; int smallMem = 0; -int rxJumbograms = 1; /* default is to send and receive jumbo grams */ +int rxJumbograms = 0; /* default is to not send and receive jumbo grams */ int rxMaxMTU = -1; afs_int32 rxBind = 0; int rxkadDisableDotCheck = 0; +int debuglevel = 0; #define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */ afs_uint32 SHostAddrs[ADDRSPERSITE]; @@ -170,7 +171,6 @@ main(argc, argv) for (index = 1; index < argc; index++) { if (strcmp(argv[index], "-noauth") == 0) { noAuth = 1; - } else if (strcmp(argv[index], "-p") == 0) { lwps = atoi(argv[++index]); if (lwps > MAXLWP) { @@ -178,10 +178,17 @@ main(argc, argv) lwps, MAXLWP); lwps = MAXLWP; } - + } else if (strcmp(argv[index], "-d") == 0) { + if ((index + 1) >= argc) { + fprintf(stderr, "missing argument for -d\n"); + return -1; + } + debuglevel = atoi(argv[++index]); + LogLevel = debuglevel; } else if (strcmp(argv[index], "-nojumbo") == 0) { rxJumbograms = 0; - + } else if (strcmp(argv[index], "-jumbo") == 0) { + rxJumbograms = 1; } else if (strcmp(argv[index], "-rxbind") == 0) { rxBind = 1; } else if (strcmp(argv[index], "-allow-dotted-principals") == 0) { @@ -253,14 +260,14 @@ main(argc, argv) #ifndef AFS_NT40_ENV printf("Usage: vlserver [-p ] [-nojumbo] " "[-rxmaxmtu ] [-rxbind] [-allow-dotted-principals] " - "[-auditlog ] " + "[-auditlog ] [-jumbo] [-d ] " "[-syslog[=FACILITY]] " "[-enable_peer_stats] [-enable_process_stats] " "[-help]\n"); #else printf("Usage: vlserver [-p ] [-nojumbo] " "[-rxmaxmtu ] [-rxbind] [-allow-dotted-principals] " - "[-auditlog ] " + "[-auditlog ] [-jumbo] [-d ] " "[-enable_peer_stats] [-enable_process_stats] " "[-help]\n"); #endif diff --git a/src/volser/volmain.c b/src/volser/volmain.c index f788466fdd..240f7451ac 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -84,6 +84,7 @@ extern void RXSTATS_ExecuteRequest(); struct afsconf_dir *tdir; static afs_int32 runningCalls = 0; int DoLogging = 0; +int debuglevel = 0; #define MAXLWP 128 int lwps = 9; int udpBufSize = 0; /* UDP buffer size for receive */ @@ -242,7 +243,7 @@ main(int argc, char **argv) int rxpackets = 100; char commandLine[150]; int i; - int rxJumbograms = 1; /* default is to send and receive jumbograms. */ + int rxJumbograms = 0; /* default is to send and receive jumbograms. */ int rxMaxMTU = -1; int bufSize = 0; /* temp variable to read in udp socket buf size */ afs_uint32 host = ntohl(INADDR_ANY); @@ -294,6 +295,13 @@ main(int argc, char **argv) rxBind = 1; } else if (strcmp(argv[code], "-allow-dotted-principals") == 0) { rxkadDisableDotCheck = 1; + } else if (strcmp(argv[code], "-d") == 0) { + if ((code + 1) >= argc) { + fprintf(stderr, "missing argument for -d\n"); + return -1; + } + debuglevel = atoi(argv[++code]); + LogLevel = debuglevel; } else if (strcmp(argv[code], "-p") == 0) { lwps = atoi(argv[++code]); if (lwps > MAXLWP) { @@ -333,6 +341,8 @@ main(int argc, char **argv) printf("Warning: auditlog %s not writable, ignored.\n", fileName); } else if (strcmp(argv[code], "-nojumbo") == 0) { rxJumbograms = 0; + } else if (strcmp(argv[code], "-jumbo") == 0) { + rxJumbograms = 1; } else if (!strcmp(argv[code], "-rxmaxmtu")) { if ((code + 1) >= argc) { fprintf(stderr, "missing argument for -rxmaxmtu\n"); @@ -384,16 +394,16 @@ main(int argc, char **argv) usage: #ifndef AFS_NT40_ENV printf("Usage: volserver [-log] [-p ] " - "[-auditlog ] " - "[-nojumbo] [-rxmaxmtu ] [-rxbind] [-allow-dotted-principals] " + "[-auditlog ] [-d ] " + "[-nojumbo] [-jumbo] [-rxmaxmtu ] [-rxbind] [-allow-dotted-principals] " "[-udpsize ] " "[-syslog[=FACILITY]] " "[-enable_peer_stats] [-enable_process_stats] " "[-help]\n"); #else printf("Usage: volserver [-log] [-p ] " - "[-auditlog ] " - "[-nojumbo] [-rxmaxmtu ] [-rxbind] [-allow-dotted-principals] " + "[-auditlog ] [-d ] " + "[-nojumbo] [-jumbo] [-rxmaxmtu ] [-rxbind] [-allow-dotted-principals] " "[-udpsize ] " "[-enable_peer_stats] [-enable_process_stats] " "[-help]\n");