Whamcloud - gitweb
LU-7734 gnilnd: update GNI lnd driver to handle multirail api changes 22/25122/2
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 7 Jul 2016 18:07:50 +0000 (14:07 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 3 Feb 2017 00:26:04 +0000 (00:26 +0000)
The multirail changes moved several parameters in struct lnet_ni
to the new data structure called struct lnet_net. This patch
updates the Gemini driver to handle the API changes.

Test-Parameters: trivial
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: I75830c570ed56c5b1b665115e8ac96a733a7e57e
Reviewed-on: https://review.whamcloud.com/21192
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-on: https://review.whamcloud.com/25122
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/klnds/gnilnd/gnilnd.c

index 2922f5e..74d0fa2 100644 (file)
@@ -2706,8 +2706,12 @@ kgnilnd_startup(lnet_ni_t *ni)
        INIT_LIST_HEAD(&net->gnn_list);
        ni->ni_data = net;
        net->gnn_ni = 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;
 
        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;
 
                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);
                        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
                        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",
 
                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);
        }
 
        atomic_set(&net->gnn_refcount, 1);