Whamcloud - gitweb
b=16186,i=isaac:
[fs/lustre-release.git] / lnet / klnds / o2iblnd / o2iblnd_modparams.c
index 61cc0c8..27a6112 100644 (file)
@@ -72,7 +72,7 @@ static int peer_buffer_credits = 0;
 CFS_MODULE_PARM(peer_buffer_credits, "i", int, 0444,
                 "# per-peer router buffer credits");
 
-static int peer_timeout = 0;
+static int peer_timeout = 180;
 CFS_MODULE_PARM(peer_timeout, "i", int, 0444,
                 "Seconds without aliveness news to declare peer dead (<=0 to disable)");
 
@@ -106,7 +106,7 @@ CFS_MODULE_PARM(map_on_demand, "i", int, 0444,
 
 static int fmr_pool_size = 512;
 CFS_MODULE_PARM(fmr_pool_size, "i", int, 0444,
-                "size of the fmr pool (>= ntx)");
+                "size of the fmr pool (>= ntx / 4)");
 
 static int fmr_flush_trigger = 384;
 CFS_MODULE_PARM(fmr_flush_trigger, "i", int, 0444,
@@ -417,13 +417,6 @@ kiblnd_sysctl_fini (void)
 int
 kiblnd_tunables_init (void)
 {
-        if (*kiblnd_tunables.kib_credits > *kiblnd_tunables.kib_ntx) {
-                CERROR("Can't set credits(%d) > ntx(%d)\n",
-                       *kiblnd_tunables.kib_credits,
-                       *kiblnd_tunables.kib_ntx);
-                return -EINVAL;
-        }
-
         if (kiblnd_translate_mtu(*kiblnd_tunables.kib_ib_mtu) < 0) {
                 CERROR("Invalid ib_mtu %d, expected 256/512/1024/2048/4096\n",
                        *kiblnd_tunables.kib_ib_mtu);
@@ -436,6 +429,9 @@ kiblnd_tunables_init (void)
         if (*kiblnd_tunables.kib_peertxcredits > IBLND_CREDITS_MAX)
                 *kiblnd_tunables.kib_peertxcredits = IBLND_CREDITS_MAX;
 
+        if (*kiblnd_tunables.kib_peertxcredits > *kiblnd_tunables.kib_credits)
+                *kiblnd_tunables.kib_peertxcredits = *kiblnd_tunables.kib_credits;
+
         if (*kiblnd_tunables.kib_peercredits_hiw < *kiblnd_tunables.kib_peertxcredits / 2)
                 *kiblnd_tunables.kib_peercredits_hiw = *kiblnd_tunables.kib_peertxcredits / 2;
 
@@ -443,9 +439,12 @@ kiblnd_tunables_init (void)
                 *kiblnd_tunables.kib_peercredits_hiw = *kiblnd_tunables.kib_peertxcredits - 1;
 
         if (*kiblnd_tunables.kib_map_on_demand < 0 ||
-            *kiblnd_tunables.kib_map_on_demand >= IBLND_MAX_RDMA_FRAGS)
+            *kiblnd_tunables.kib_map_on_demand > IBLND_MAX_RDMA_FRAGS)
                 *kiblnd_tunables.kib_map_on_demand = 0; /* disable map-on-demand */
 
+        if (*kiblnd_tunables.kib_map_on_demand == 1)
+                *kiblnd_tunables.kib_map_on_demand = 2; /* don't make sense to create map if only one fragment */
+
         if (*kiblnd_tunables.kib_concurrent_sends == 0) {
                 if (*kiblnd_tunables.kib_map_on_demand > 0 &&
                     *kiblnd_tunables.kib_map_on_demand <= IBLND_MAX_RDMA_FRAGS / 8)