]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-afsd-allow-maxmtu-override-20090530
authorDouglas Engert <deengert@anl.gov>
Sun, 31 May 2009 02:23:11 +0000 (02:23 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 31 May 2009 02:23:11 +0000 (02:23 +0000)
LICENSE IPL10
FIXES 124880

rxi_Findcbi, rxi_FIndIfnet, rxi_FindIfMTU "failure" end up returning
the RX_REMOTE_PACKET_SIZE as the mtu to use unless we allow our override
to apply, so we do that. then, add an afsd switch to allow setting it.

afsd man page update required and will follow.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE IPL10
FIXES 124880

man page update to document previous work

(cherry picked from commit 74df876dafb9cf80ab5a8099b4202f2205bd9791)

doc/man-pages/pod8/afsd.pod
src/afs/afs_call.c
src/afsd/afs.conf.linux
src/afsd/afsd.c
src/config/afs_args.h
src/rx/rx_kcommon.c

index d46c35e2d6a43a37995075fada56849c1f8f41f8..a2f1f09702f9f2ff275aac14f0154dd2b40d2cd5 100644 (file)
@@ -25,7 +25,8 @@ B<afsd> [B<-afsdb>] [B<-backuptree>]
      [B<-nosettime>]
      S<<< [B<-prealloc> <I<number of 'small' preallocated blocks>>] >>>
      [B<-rmtsys>] S<<< [B<-rootvol> <I<name of AFS root volume>>] >>>
-     [B<-rxbind>] S<<< [B<-rxpck> value for rx_extraPackets ] >>>
+     [B<-rxbind>] S<<< [B<-rxmaxmtu> value for maximum MTU ] >>> 
+     S<<< [B<-rxpck> value for rx_extraPackets ] >>>
      [B<-settime>] [B<-shutdown>]
      S<<< [B<-splitcache> <I<RW/RO ratio>>] >>>
      S<<< [B<-stat> <I<number of stat entries>>] >>> [B<-verbose>]
@@ -628,6 +629,13 @@ B<-dynroot> is given.
 
 Bind the Rx socket (one interface only).
 
+=item B<-rxmaxmtu> <I<value for maximum MTU>>
+
+Set a limit for the largest maximum transfer unit (network packet size) that
+the AFS client on this machine will be willing to transmit. This switch can
+be used where an artificial limit on the network precludes packets as large
+as the discoverable MTU from being transmitted successfully.
+
 =item B<-rxpck> <I<value for rx_extraPackets>>
 
 Set rx_extraPackets to this value. This sets the number of extra Rx
index 0e4c4d78d6b0a30d423e7efdb623896aa39a4d43..3b3298b476675cb8da5a30d86826578cab201662 100644 (file)
@@ -1163,6 +1163,8 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
     } else if (parm == AFSOP_SET_RXPCK) {
        rx_extraPackets = parm2;
        afscall_set_rxpck_received = 1;
+    } else if (parm == AFSOP_SET_RXMAXMTU) {
+    rx_MyMaxSendSize = rx_maxReceiveSizeUser = rx_maxReceiveSize = parm2;
     } else
        code = EINVAL;
 
index 6cdc675aaa18184d82f89f5b156f954ee5abbbb3..25a8d496b9a9021e2b7bebd5c61f8f4bb2b07969 100644 (file)
@@ -59,6 +59,8 @@ ENABLE_DYNROOT=on
 #      -logfile   Place where to put the logfile (default in <cache>/etc/AFSLog.
 #      -waitclose make close calls always synchronous (slows em down, tho)
 #      -files_per_subdir [n]   number of files per cache subdir. (def=2048)
+#      -rxmaxmtu  Max mtu. Useful when using VPN when packets might fragment.
+#                 a value of 1244 should work.
 #      -shutdown  Shutdown afs daemons
 # ---------------------------------------------------------------------------
 XXLARGE="-fakestat -stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000"
index c469a4c41afa39ead54d6cf901fa53d79963ad9d..e81d1310626635d0fc91f56e405e981abd403ab2 100644 (file)
@@ -31,6 +31,7 @@
   *    -confdir    The configuration directory .
   *    -nosettime  Don't keep checking the time to avoid drift (default).
   *     -settime    Keep checking the time to avoid drift.
+  *    -rxmaxmtu   Set the max mtu to help with VPN issues.
   *    -verbose     Be chatty.
   *    -disable-dynamic-vcaches     Disable the use of -stat value as the starting size of
   *                          the size of the vcache/stat cache pool, 
@@ -319,6 +320,7 @@ int afsd_dynamic_vcaches = 0;       /* Enable dynamic-vcache support */
 int afsd_verbose = 0;          /*Are we being chatty? */
 int afsd_debug = 0;            /*Are we printing debugging info? */
 int afsd_CloseSynch = 0;       /*Are closes synchronous or not? */
+int rxmaxmtu = 0;       /* Are we forcing a limit on the mtu? */
 
 #ifdef AFS_SGI62_ENV
 #define AFSD_INO_T ino64_t
@@ -1761,6 +1763,12 @@ mainproc(struct cmd_syndesc *as, void *arock)
     printf("afsd: %s dynamically allocated vcaches\n", ( afsd_dynamic_vcaches ? "enabling" : "disabling" ));
 #endif
 
+    /* set -rxmaxmtu */
+    if (as->parms[35].items) {
+        /* -rxmaxmtu */
+        rxmaxmtu = atoi(as->parms[35].items->data);
+    }
+
     /*
      * Pull out all the configuration info for the workstation's AFS cache and
      * the cellular community we're willing to let our users see.
@@ -2173,6 +2181,14 @@ mainproc(struct cmd_syndesc *as, void *arock)
               fullpn_CellInfoFile);
     call_syscall(AFSOP_CELLINFO, fullpn_CellInfoFile);
 
+    if (rxmaxmtu) {
+    if (afsd_verbose)
+        printf("%s: Setting rxmaxmtu in kernel = %d\n", rn, rxmaxmtu);
+    code = call_syscall(AFSOP_SET_RXMAXMTU, rxmaxmtu);
+    if (code)
+        printf("%s: Error seting rxmaxmtu\n", rn);
+    }
+
     if (enable_dynroot) {
        if (afsd_verbose)
            printf("%s: Enabling dynroot support in kernel.\n", rn);
@@ -2472,6 +2488,7 @@ main(int argc, char **argv)
                "set the time");
     cmd_AddParm(ts, "-rxpck", CMD_SINGLE, CMD_OPTIONAL, "set rx_extraPackets to this value");
     cmd_AddParm(ts, "-disable-dynamic-vcaches", CMD_FLAG, CMD_OPTIONAL, "disable stat/vcache cache growing as needed");
+    cmd_AddParm(ts, "-rxmaxmtu", CMD_SINGLE, CMD_OPTIONAL, "set rx max MTU to use");
     return (cmd_Dispatch(argc, argv));
 }
 
index d3a06be4f9425dd5215b7d54f8f5316fe12e2adb..1f8ca28c35f92f567326c80db07f2b55add9badc 100644 (file)
@@ -47,6 +47,7 @@
 #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*/
+#define AFSOP_SET_RXMAXMTU      40     /* set rx_MyMaxSendSize,rx_maxReceiveSizeUser,rx_maxReceiveSize */  
 
 /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
 #define        AFSCALL_PIOCTL          20
index 2382467d8c049fb6b26bb79f99d9f02e02219433..71b2927b2762be496d6d0a3cb2916af33ee25b59 100644 (file)
@@ -389,7 +389,7 @@ rxi_InitPeerParams(register struct rx_peer *pp)
     if (i == -1) {
        pp->timeout.sec = 3;
        /* pp->timeout.usec = 0; */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     } else {
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
@@ -405,7 +405,7 @@ rxi_InitPeerParams(register struct rx_peer *pp)
                pp->ifMTU = rxmtu;
        }
     } else {                   /* couldn't find the interface, so assume the worst */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
 #else /* AFS_USERSPACE_IP_ADDR */
 #ifdef AFS_DARWIN80_ENV
@@ -441,7 +441,7 @@ rxi_InitPeerParams(register struct rx_peer *pp)
     } else {                   /* couldn't find the interface, so assume the worst */
        pp->timeout.sec = 3;
        /* pp->timeout.usec = 0; */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     }
 #endif /* else AFS_USERSPACE_IP_ADDR */
 #else /* AFS_SUN5_ENV */
@@ -450,7 +450,7 @@ rxi_InitPeerParams(register struct rx_peer *pp)
     if (mtu <= 0) {
        pp->timeout.sec = 3;
        /* pp->timeout.usec = 0; */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize);
     } else {
        pp->timeout.sec = 2;
        /* pp->timeout.usec = 0; */
@@ -466,7 +466,7 @@ rxi_InitPeerParams(register struct rx_peer *pp)
                pp->ifMTU = rxmtu;
        }
     } else {                   /* couldn't find the interface, so assume the worst */
-       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+       pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE,rx_MyMaxSendSize);
     }
 #endif /* AFS_SUN5_ENV */
 #else /* ADAPT_MTU */