<div dir="ltr"><div dir="ltr">This block logic that was removed from lnet_startup_lndni() is done in the LND. Each LND has its own defaults. As an example look at kiblnd_tunables_setup() and ksocknal_startup().</div><div>These tunables are LND specific and have different values per LND. So instead of configuring it in the common LNet function and then it gets overwritten again the LND. We let the LND take care of initializing to the default values that they use for that LND, if they haven't already been set by the user.</div><div>Note currently dynamic configuration of these parameters work only for the o2iblnd. Socklnd and gnilnd appear to not make use of the dynamic ability. I'll create an LU ticket to add the ability to dynamically set these values to the socklnd.</div><div>The tunables are divided into two parts, a common set of tunables that are common to all the LND (although each LND could have different default values), and a specific set of LND tunables which pertain to a specific LND, again that's only used by the o2iblnd at the moment.<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 6 Sep 2018 at 18:00, NeilBrown <<a href="mailto:neilb@suse.com">neilb@suse.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't understand parts of this change.<br>
Particularly the removal for<br>
       /* If given some LND tunable parameters, parse those now to<br>
        * override the values in the NI structure. */<br>
<br>
isn't clear to me.<br>
<br>
This is part of<br>
    8cbb8cd3e771e7f7e0f99cafc19fad32770dc015<br>
       LU-7734 lnet: Multi-Rail local NI split<br>
<br>
Signed-off-by: NeilBrown <<a href="mailto:neilb@suse.com" target="_blank">neilb@suse.com</a>><br>
---<br>
 drivers/staging/lustre/lnet/lnet/api-ni.c |   41 ++++++++---------------------<br>
 1 file changed, 12 insertions(+), 29 deletions(-)<br>
<br>
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c<br>
index 6e0b8310574d..53ecfd700db3 100644<br>
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c<br>
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c<br>
@@ -1240,10 +1240,8 @@ lnet_shutdown_lndni(struct lnet_ni *ni)<br>
 }<br>
<br>
 static int<br>
-lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf)<br>
+lnet_startup_lndni(struct lnet_ni *ni, struct lnet_lnd_tunables *tun)<br>
 {<br>
-       struct lnet_ioctl_config_lnd_tunables *lnd_tunables = NULL;<br>
-       struct lnet_lnd_tunables *tun = NULL;<br>
        int rc = -EINVAL;<br>
        int lnd_type;<br>
        struct lnet_lnd *lnd;<br>
@@ -1296,36 +1294,12 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf)<br>
<br>
        ni->ni_net->net_lnd = lnd;<br>
<br>
-       if (conf && conf->cfg_hdr.ioc_len > sizeof(*conf)) {<br>
-               lnd_tunables = (struct lnet_ioctl_config_lnd_tunables *)conf->cfg_bulk;<br>
-               tun = &lnd_tunables->lt_tun;<br>
-       }<br>
-<br>
        if (tun) {<br>
                memcpy(&ni->ni_lnd_tunables, tun,<br>
                       sizeof(*tun));<br>
                ni->ni_lnd_tunables_set = true;<br>
        }<br>
<br>
-       /*<br>
-        * If given some LND tunable parameters, parse those now to<br>
-        * override the values in the NI structure.<br>
-        */<br>
-       if (conf) {<br>
-               if (conf->cfg_config_u.cfg_net.net_peer_rtr_credits >= 0)<br>
-                       ni->ni_net->net_tunables.lct_peer_rtr_credits =<br>
-                               conf->cfg_config_u.cfg_net.net_peer_rtr_credits;<br>
-               if (conf->cfg_config_u.cfg_net.net_peer_timeout >= 0)<br>
-                       ni->ni_net->net_tunables.lct_peer_timeout =<br>
-                               conf->cfg_config_u.cfg_net.net_peer_timeout;<br>
-               if (conf->cfg_config_u.cfg_net.net_peer_tx_credits != -1)<br>
-                       ni->ni_net->net_tunables.lct_peer_tx_credits =<br>
-                               conf->cfg_config_u.cfg_net.net_peer_tx_credits;<br>
-               if (conf->cfg_config_u.cfg_net.net_max_tx_credits >= 0)<br>
-                       ni->ni_net->net_tunables.lct_max_tx_credits =<br>
-                               conf->cfg_config_u.cfg_net.net_max_tx_credits;<br>
-       }<br>
-<br>
        rc = lnd->lnd_startup(ni);<br>
<br>
        mutex_unlock(&the_lnet.ln_lnd_mutex);<br>
@@ -1861,9 +1835,13 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, struct lnet_ioctl_config_data *conf)<br>
        struct list_head net_head;<br>
        struct lnet_remotenet *rnet;<br>
        int rc;<br>
+       struct lnet_ioctl_config_lnd_tunables *lnd_tunables = NULL;<br>
<br>
        INIT_LIST_HEAD(&net_head);<br>
<br>
+       if (conf && conf->cfg_hdr.ioc_len > sizeof(*conf))<br>
+               lnd_tunables = (struct lnet_ioctl_config_lnd_tunables *)conf->cfg_bulk;<br>
+<br>
        /* Create a net/ni structures for the network string */<br>
        rc = lnet_parse_networks(&net_head, nets);<br>
        if (rc <= 0)<br>
@@ -1898,9 +1876,14 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, struct lnet_ioctl_config_data *conf)<br>
                goto failed0;<br>
<br>
        list_del_init(&net->net_list);<br>
+       if (lnd_tunables)<br>
+               memcpy(&net->net_tunables,<br>
+                      &lnd_tunables->lt_cmn, sizeof(lnd_tunables->lt_cmn));<br>
+<br>
        ni = list_first_entry(&net->net_ni_list, struct lnet_ni, ni_netlist);<br>
-       rc = lnet_startup_lndni(ni, conf);<br>
-       if (rc)<br>
+       rc = lnet_startup_lndni(ni, (lnd_tunables ?<br>
+                                    &lnd_tunables->lt_tun : NULL));<br>
+       if (rc < 0)<br>
                goto failed1;<br>
<br>
        if (ni->ni_net->net_lnd->lnd_accept) {<br>
<br>
<br>
_______________________________________________<br>
lustre-devel mailing list<br>
<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a><br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org" rel="noreferrer" target="_blank">http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org</a><br>
</blockquote></div>