Whamcloud - gitweb
LU-7734 gnilnd: update GNI lnd driver to handle multirail api changes
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd.c
index 2f3c949..74d0fa2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2012 Cray, Inc.
  *
- * Copyright (c) 2013, 2014, Intel Corporation.
+ * Copyright (c) 2013, 2015, Intel Corporation.
  *
  *   Author: Nic Henke <nic@cray.com>
  *   Author: James Shimek <jshimek@cray.com>
@@ -2684,9 +2684,9 @@ kgnilnd_startup(lnet_ni_t *ni)
        kgn_net_t        *net;
        ENTRY;
 
-       LASSERTF(ni->ni_lnd == &the_kgnilnd,
+       LASSERTF(ni->ni_net->net_lnd == &the_kgnilnd,
                "bad LND 0x%p != the_kgnilnd @ 0x%p\n",
-               ni->ni_lnd, &the_kgnilnd);
+               ni->ni_net->net_lnd, &the_kgnilnd);
 
        if (kgnilnd_data.kgn_init == GNILND_INIT_NOTHING) {
                rc = kgnilnd_base_startup();
@@ -2706,8 +2706,12 @@ kgnilnd_startup(lnet_ni_t *ni)
        INIT_LIST_HEAD(&net->gnn_list);
        ni->ni_data = net;
        net->gnn_ni = ni;
-       ni->ni_maxtxcredits = *kgnilnd_tunables.kgn_credits;
-       ni->ni_peertxcredits = *kgnilnd_tunables.kgn_peer_credits;
+       if (!ni->ni_net->net_tunables_set) {
+               ni->ni_net->net_tunables.lct_max_tx_credits =
+                       *kgnilnd_tunables.kgn_credits;
+               ni->ni_net->net_tunables.lct_peer_tx_credits =
+                       *kgnilnd_tunables.kgn_peer_credits;
+       }
 
        if (*kgnilnd_tunables.kgn_peer_health) {
                int     fudge;
@@ -2717,9 +2721,10 @@ kgnilnd_startup(lnet_ni_t *ni)
                fudge = (GNILND_TO2KA(*kgnilnd_tunables.kgn_timeout) / GNILND_REAPER_NCHECKS);
                timeout = *kgnilnd_tunables.kgn_timeout + fudge;
 
-               if (*kgnilnd_tunables.kgn_peer_timeout >= timeout)
-                       ni->ni_peertimeout = *kgnilnd_tunables.kgn_peer_timeout;
-               else if (*kgnilnd_tunables.kgn_peer_timeout > -1) {
+               if (*kgnilnd_tunables.kgn_peer_timeout >= timeout) {
+                       ni->ni_net->net_tunables.lct_peer_timeout =
+                                *kgnilnd_tunables.kgn_peer_timeout;
+               } else if (*kgnilnd_tunables.kgn_peer_timeout > -1) {
                        LCONSOLE_ERROR("Peer_timeout is set to %d but needs to be >= %d\n",
                                        *kgnilnd_tunables.kgn_peer_timeout,
                                        timeout);
@@ -2727,10 +2732,10 @@ kgnilnd_startup(lnet_ni_t *ni)
                        LIBCFS_FREE(net, sizeof(*net));
                        GOTO(failed, rc = -EINVAL);
                } else
-                       ni->ni_peertimeout = timeout;
+                       ni->ni_net->net_tunables.lct_peer_timeout = timeout;
 
                LCONSOLE_INFO("Enabling LNet peer health for gnilnd, timeout %ds\n",
-                             ni->ni_peertimeout);
+                             ni->ni_net->net_tunables.lct_peer_timeout);
        }
 
        atomic_set(&net->gnn_refcount, 1);