if (ni != NULL) {
net = (struct kib_net *)ni->ni_data;
rej.ibr_incarnation = net->ibn_incarnation;
+ } else {
+ if (ibdev->ibd_nnets == 0) {
+ rej.ibr_why = IBLND_REJECT_EARLY;
+ CNETERR("Can't accept conn from %s on %s (%s:%d:%pI4h): net for nid %s not added yet\n",
+ libcfs_nid2str(nid),
+ libcfs_nidstr(&net->ibn_ni->ni_nid),
+ ibdev->ibd_ifname, ibdev->ibd_nnets,
+ &ibdev->ibd_ifip,
+ libcfs_nid2str(reqmsg->ibm_dstnid));
+ goto failed;
+ }
+ list_for_each_entry(net, &ibdev->ibd_nets, ibn_list) {
+ if ((net->ibn_dev == ibdev) &&
+ (net->ibn_ni != NULL) &&
+ (net->ibn_ni->ni_state != LNET_NI_STATE_ACTIVE)) {
+ rej.ibr_why = IBLND_REJECT_EARLY;
+ CNETERR("Can't accept conn from %s on %s (%s:%d:%pI4h): nid %s not ready\n",
+ libcfs_nid2str(nid),
+ libcfs_nidstr(&net->ibn_ni->ni_nid),
+ ibdev->ibd_ifname, ibdev->ibd_nnets,
+ &ibdev->ibd_ifip,
+ libcfs_nid2str(reqmsg->ibm_dstnid));
+ goto failed;
+ }
+ }
}
if (ni == NULL || /* no matching net */
libcfs_nid2str(peer_ni->ibp_nid));
break;
+ case IBLND_REJECT_EARLY:
+ CNETERR("%s rejected: tried too early\n",
+ libcfs_nid2str(peer_ni->ibp_nid));
+ break;
+
default:
CERROR("%s rejected: o2iblnd reason %d\n",
libcfs_nid2str(peer_ni->ibp_nid),
goto failed0;
}
- lnet_ni_lock(ni);
- ni->ni_state = LNET_NI_STATE_ACTIVE;
- lnet_ni_unlock(ni);
-
/* We keep a reference on the loopback net through the loopback NI */
if (net->net_lnd->lnd_type == LOLND) {
lnet_ni_addref(ni);
lnet_net_lock(LNET_LOCK_EX);
list_splice_tail(&local_ni_list, &net_l->net_ni_list);
lnet_incr_dlc_seq();
+
+ list_for_each_entry(ni, &net_l->net_ni_list, ni_netlist) {
+ if (!ni)
+ break;
+ lnet_ni_lock(ni);
+ ni->ni_state = LNET_NI_STATE_ACTIVE;
+ lnet_ni_unlock(ni);
+ }
lnet_net_unlock(LNET_LOCK_EX);
/* if the network is not unique then we don't want to keep