Whamcloud - gitweb
LU-12635 lnet: Fix style issues for selftest/rpc.c
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd_modparams.c
index eb4e7fd..bdf2b97 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "gnilnd.h"
 
-static int credits = 256;
+static int credits = GNILND_DEFAULT_CREDITS;
 module_param(credits, int, 0444);
 MODULE_PARM_DESC(credits, "# concurrent sends");
 
@@ -78,9 +78,13 @@ static int checksum_dump = 0;
 module_param(checksum_dump, int, 0644);
 MODULE_PARM_DESC(checksum_dump, "0: None, 1: dump log on failure, 2: payload data to D_INFO log");
 
-static int bte_dlvr_mode = GNILND_RDMA_DLVR_OPTION;
-module_param(bte_dlvr_mode, int, 0644);
-MODULE_PARM_DESC(bte_dlvr_mode, "enable hashing for BTE (RDMA) transfers");
+static int bte_put_dlvr_mode = GNILND_RDMA_DLVR_OPTION;
+module_param(bte_put_dlvr_mode, int, 0644);
+MODULE_PARM_DESC(bte_put_dlvr_mode, "Modify BTE Put Routing Option");
+
+static int bte_get_dlvr_mode = GNILND_RDMA_DLVR_OPTION;
+module_param(bte_get_dlvr_mode, int, 0644);
+MODULE_PARM_DESC(bte_get_dlvr_mode, "Modify BTE Get Routing Option");
 
 static int bte_relaxed_ordering = 1;
 module_param(bte_relaxed_ordering, int, 0644);
@@ -98,9 +102,10 @@ static int pkey = GNI_JOB_CREATE_COOKIE(GNI_PKEY_LND, 0);
 module_param(pkey, int, 0444);
 MODULE_PARM_DESC(pkey, "pkey for CDM");
 
-static int max_retransmits = 1024;
+static int max_retransmits = 128;
 module_param(max_retransmits, int, 0444);
-MODULE_PARM_DESC(max_retransmits, "max retransmits for FMA");
+MODULE_PARM_DESC(max_retransmits,
+                "max retransmits for FMA before entering delay queue");
 
 static int nwildcard = 4;
 module_param(nwildcard, int, 0444);
@@ -202,6 +207,16 @@ static int reg_fail_timeout = GNILND_REGFAILTO_DISABLE;
 module_param(reg_fail_timeout, int, 0644);
 MODULE_PARM_DESC(reg_fail_timeout, "fmablk registration timeout LBUG");
 
+static int to_reconn_disable;
+module_param(to_reconn_disable, int, 0644);
+MODULE_PARM_DESC(to_reconn_disable,
+                 "Timed out connection waits for peer before reconnecting");
+
+static int vzalloc_no_retry = GNILND_VZALLOC_RETRY;
+module_param(vzalloc_no_retry, int, 0644);
+MODULE_PARM_DESC(vzalloc_no_retry,
+                "Should we pass the no_retry flag to vmalloc 1: no_retry 0: normal");
+
 kgn_tunables_t kgnilnd_tunables = {
        .kgn_min_reconnect_interval = &min_reconnect_interval,
        .kgn_max_reconnect_interval = &max_reconnect_interval,
@@ -213,7 +228,8 @@ kgn_tunables_t kgnilnd_tunables = {
        .kgn_max_immediate          = &max_immediate,
        .kgn_checksum               = &checksum,
        .kgn_checksum_dump          = &checksum_dump,
-       .kgn_bte_dlvr_mode          = &bte_dlvr_mode,
+       .kgn_bte_put_dlvr_mode      = &bte_put_dlvr_mode,
+       .kgn_bte_get_dlvr_mode      = &bte_get_dlvr_mode,
        .kgn_bte_relaxed_ordering   = &bte_relaxed_ordering,
        .kgn_ptag                   = &ptag,
        .kgn_pkey                   = &pkey,
@@ -243,358 +259,16 @@ kgn_tunables_t kgnilnd_tunables = {
        .kgn_thread_affinity        = &thread_affinity,
        .kgn_thread_safe            = &thread_safe,
        .kgn_reg_fail_timeout       = &reg_fail_timeout,
-       .kgn_max_purgatory          = &max_conn_purg
-};
-
-#if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
-static struct ctl_table kgnilnd_ctl_table[] = {
-       {
-               INIT_CTL_NAME
-               .procname = "min_reconnect_interval",
-               .data     = &min_reconnect_interval,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "max_reconnect_interval",
-               .data     = &max_reconnect_interval,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "credits",
-               .data     = &credits,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "peer_credits",
-               .data     = &peer_credits,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "fma_cq_size",
-               .data     = &fma_cq_size,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "timeout",
-               .data     = &timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "max_immediate",
-               .data     = &max_immediate,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "checksum",
-               .data     = &checksum,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "bte_dlvr_mode",
-               .data     = &bte_dlvr_mode,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "ptag",
-               .data     = &ptag,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "pkey",
-               .data     = &pkey,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "nwildcard",
-               .data     = &nwildcard,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "bte_relaxed_ordering",
-               .data     = &bte_relaxed_ordering,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "checksum_dump",
-               .data     = &checksum_dump,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "nice",
-               .data     = &nice,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "rdmaq_intervals",
-               .data     = &rdmaq_intervals,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "loops",
-               .data     = &loops,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "hash_size",
-               .data     = &hash_size,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "peer_health",
-               .data     = &peer_health,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "vmap_cksum",
-               .data     = &vmap_cksum,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "mbox_per_block",
-               .data     = &mbox_per_block,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "mbox_credits"
-               .data     = &mbox_credits,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "sched_threads"
-               .data     = &sched_threads,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "net_hash_size",
-               .data     = &net_hash_size,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "hardware_timeout",
-               .data     = &hardware_timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "mdd_timeout",
-               .data     = &mdd_timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "max_retransmits"
-               .data     = &max_retransmits,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "concurrent_sends",
-               .data     = &concurrent_sends,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "nphys_mbox",
-               .data     = &nphys_mbox,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "sched_timeout",
-               .data     = &sched_timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "sched_nice",
-               .data     = &sched_nice,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "reverse_rdma",
-               .data     = &reverse_rdma,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-               INIT_CTL_NAME
-               .procname = "dgram_timeout"
-               .data     = &dgram_timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "peer_timeout"
-               .data     = &peer_timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "eager_credits",
-               .data     = &eager_credits,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "efault_lbug"
-               .data     = &efault_lbug,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "thread_affinity"
-               .data     = &thread_affinity,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "thread_safe"
-               .data     = &thread_safe,
-               .maxlen   = sizeof(int),
-               .mode     = 0444,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "reg_fail_timeout"
-               .data     = &reg_fail_timeout,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       {
-               INIT_CTL_NAME
-               .procname = "max_conn_purg"
-               .data     = &max_conn_purg,
-               .maxlen   = sizeof(int),
-               .mode     = 0644,
-               .proc_handler = &proc_dointvec
-       },
-       { 0 }
-};
-
-static struct ctl_table kgnilnd_top_ctl_table[] = {
-       {
-               INIT_CTL_NAME
-               .procname = "gnilnd",
-               .data     = NULL,
-               .maxlen   = 0,
-               .mode     = 0555,
-               .child    = kgnilnd_ctl_table
-       },
-       { 0 }
+       .kgn_to_reconn_disable      = &to_reconn_disable,
+       .kgn_max_purgatory          = &max_conn_purg,
+       .kgn_vzalloc_noretry        = &vzalloc_no_retry
 };
-#endif
 
 int
 kgnilnd_tunables_init()
 {
        int rc = 0;
 
-#if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
-       kgnilnd_tunables.kgn_sysctl =
-               register_sysctl_table(kgnilnd_top_ctl_table, 0);
-
-       if (kgnilnd_tunables.kgn_sysctl == NULL)
-               CWARN("Can't setup /proc tunables\n");
-#endif
        switch (*kgnilnd_tunables.kgn_checksum) {
        default:
                CERROR("Invalid checksum module parameter: %d\n",
@@ -636,12 +310,3 @@ kgnilnd_tunables_init()
 out:
        return rc;
 }
-
-void
-kgnilnd_tunables_fini()
-{
-#if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
-       if (kgnilnd_tunables.kgn_sysctl != NULL)
-               unregister_sysctl_table(kgnilnd_tunables.kgn_sysctl);
-#endif
-}