From: James Simmons Date: Thu, 7 Jul 2016 18:07:50 +0000 (-0400) Subject: LU-7734 gnilnd: update GNI lnd driver to handle multirail api changes X-Git-Tag: 2.9.53~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=254aec0ff702a856e688e0e61e773d63b3285171;hp=0308951e8bba1663bc9495eee2f6ae631e6bcbd0 LU-7734 gnilnd: update GNI lnd driver to handle multirail api changes 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 Change-Id: I75830c570ed56c5b1b665115e8ac96a733a7e57e Reviewed-on: https://review.whamcloud.com/21192 Reviewed-by: Amir Shehata Tested-by: Amir Shehata Reviewed-on: https://review.whamcloud.com/25122 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Olaf Weber Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/gnilnd/gnilnd.c b/lnet/klnds/gnilnd/gnilnd.c index 2922f5e..74d0fa2b 100644 --- a/lnet/klnds/gnilnd/gnilnd.c +++ b/lnet/klnds/gnilnd/gnilnd.c @@ -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);