+ if (net_tunables->lct_peer_tx_credits >
+ net_tunables->lct_max_tx_credits)
+ net_tunables->lct_peer_tx_credits =
+ net_tunables->lct_max_tx_credits;
+
+ if (net_tunables->lct_peer_rtr_credits == -1)
+ net_tunables->lct_peer_rtr_credits =
+ *ksocknal_tunables.ksnd_peerrtrcredits;
+
+ rc = lnet_inet_enumerate(&ifaces, ni->ni_net_ns);
+ if (rc < 0)
+ goto fail_1;
+
+ if (!ni->ni_interfaces[0]) {
+ ksi = &net->ksnn_interfaces[0];
+
+ /* Use the first discovered interface */
+ net->ksnn_ninterfaces = 1;
+ ni->ni_dev_cpt = ifaces[0].li_cpt;
+ ksi->ksni_ipaddr = ifaces[0].li_ipaddr;
+ ksi->ksni_netmask = ifaces[0].li_netmask;
+ strlcpy(ksi->ksni_name, ifaces[0].li_name,
+ sizeof(ksi->ksni_name));
+ } else {
+ /* Before Multi-Rail ksocklnd would manage
+ * multiple interfaces with its own tcp bonding.
+ * If we encounter an old configuration using
+ * this tcp bonding approach then we need to
+ * handle more than one ni_interfaces.
+ *
+ * In Multi-Rail configuration only ONE ni_interface
+ * should exist. Each IP alias should be mapped to
+ * each 'struct net_ni'.
+ */
+ for (i = 0; i < LNET_INTERFACES_NUM; i++) {
+ int j;
+
+ if (!ni->ni_interfaces[i])
+ break;