/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
*
- * Copyright (c) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2013, Intel Corporation.
*
* This file is part of Portals
* http://sourceforge.net/projects/sandiaportals/
static int check_routers_before_use = 0;
CFS_MODULE_PARM(check_routers_before_use, "i", int, 0444,
- "Assume routers are down and ping them before use");
+ "Assume routers are down and ping them before use");
-static int avoid_asym_router_failure = 0;
-CFS_MODULE_PARM(avoid_asym_router_failure, "i", int, 0444,
- "Avoid asymmetrical failures: reserved, use at your own risk");
+static int avoid_asym_router_failure = 1;
+CFS_MODULE_PARM(avoid_asym_router_failure, "i", int, 0644,
+ "Avoid asymmetrical router failures (0 to disable)");
-static int dead_router_check_interval = 0;
-CFS_MODULE_PARM(dead_router_check_interval, "i", int, 0444,
- "Seconds between dead router health checks (<= 0 to disable)");
+static int dead_router_check_interval = 60;
+CFS_MODULE_PARM(dead_router_check_interval, "i", int, 0644,
+ "Seconds between dead router health checks (<= 0 to disable)");
-static int live_router_check_interval = 0;
-CFS_MODULE_PARM(live_router_check_interval, "i", int, 0444,
- "Seconds between live router health checks (<= 0 to disable)");
+static int live_router_check_interval = 60;
+CFS_MODULE_PARM(live_router_check_interval, "i", int, 0644,
+ "Seconds between live router health checks (<= 0 to disable)");
static int router_ping_timeout = 50;
-CFS_MODULE_PARM(router_ping_timeout, "i", int, 0444,
- "Seconds to wait for the reply to a router health query");
+CFS_MODULE_PARM(router_ping_timeout, "i", int, 0644,
+ "Seconds to wait for the reply to a router health query");
int
lnet_peers_start_down(void)
lp->lp_notify = 1;
lp->lp_notifylnd |= notifylnd;
if (lp->lp_alive)
- lp->lp_ping_version = LNET_PROTO_PING_UNKNOWN; /* reset */
+ lp->lp_ping_feats = LNET_PING_FEAT_INVAL; /* reset */
- CDEBUG(D_NET, "set %s %d\n", libcfs_nid2str(lp->lp_nid), alive);
+ CDEBUG(D_NET, "set %s %d\n", libcfs_nid2str(lp->lp_nid), alive);
}
void
lnet_remotenet_t *
lnet_find_net_locked (__u32 net)
{
- lnet_remotenet_t *rnet;
- cfs_list_t *tmp;
+ lnet_remotenet_t *rnet;
+ cfs_list_t *tmp;
+ cfs_list_t *rn_list;
- LASSERT (!the_lnet.ln_shutdown);
+ LASSERT(!the_lnet.ln_shutdown);
- cfs_list_for_each (tmp, &the_lnet.ln_remote_nets) {
- rnet = cfs_list_entry(tmp, lnet_remotenet_t, lrn_list);
+ rn_list = lnet_net2rnethash(net);
+ cfs_list_for_each(tmp, rn_list) {
+ rnet = cfs_list_entry(tmp, lnet_remotenet_t, lrn_list);
- if (rnet->lrn_net == net)
- return rnet;
- }
- return NULL;
+ if (rnet->lrn_net == net)
+ return rnet;
+ }
+ return NULL;
}
static void lnet_shuffle_seed(void)
seed[0] ^= (LNET_NIDADDR(ni->ni_nid) | lnd_type);
}
- cfs_gettimeofday(&tv);
- cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]);
- seeded = 1;
- return;
+ do_gettimeofday(&tv);
+ cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]);
+ seeded = 1;
+ return;
}
/* NB expects LNET_LOCK held */
cfs_list_add(&route->lr_list, e);
cfs_list_add(&route->lr_gwlist, &route->lr_gateway->lp_routes);
- the_lnet.ln_remote_nets_version++;
- lnet_rtr_addref_locked(route->lr_gateway);
+ the_lnet.ln_remote_nets_version++;
+ lnet_rtr_addref_locked(route->lr_gateway);
}
int
-lnet_add_route (__u32 net, unsigned int hops, lnet_nid_t gateway)
+lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway,
+ unsigned int priority)
{
cfs_list_t *e;
lnet_remotenet_t *rnet;
int add_route;
int rc;
- CDEBUG(D_NET, "Add route: net %s hops %u gw %s\n",
- libcfs_net2str(net), hops, libcfs_nid2str(gateway));
+ CDEBUG(D_NET, "Add route: net %s hops %u priority %u gw %s\n",
+ libcfs_net2str(net), hops, priority, libcfs_nid2str(gateway));
if (gateway == LNET_NID_ANY ||
LNET_NETTYP(LNET_NIDNET(gateway)) == LOLND ||
rnet->lrn_net = net;
route->lr_hops = hops;
route->lr_net = net;
+ route->lr_priority = priority;
lnet_net_lock(LNET_LOCK_EX);
LIBCFS_FREE(rnet, sizeof(*rnet));
if (rc == -EHOSTUNREACH) { /* gateway is not on a local net */
- return 0; /* ignore the route entry */
+ return 0; /* ignore the route entry */
} else {
CERROR("Error %d creating route %s %d %s\n", rc,
libcfs_net2str(net), hops,
rnet2 = lnet_find_net_locked(net);
if (rnet2 == NULL) {
/* new network */
- cfs_list_add_tail(&rnet->lrn_list, &the_lnet.ln_remote_nets);
+ cfs_list_add_tail(&rnet->lrn_list, lnet_net2rnethash(net));
rnet2 = rnet;
}
if (!add_route)
LIBCFS_FREE(route, sizeof(*route));
- if (rnet != rnet2)
- LIBCFS_FREE(rnet, sizeof(*rnet));
+ if (rnet != rnet2)
+ LIBCFS_FREE(rnet, sizeof(*rnet));
- return 0;
+ return 0;
}
int
cfs_list_t *e1;
cfs_list_t *e2;
int cpt;
+ cfs_list_t *rn_list;
+ int i;
cpt = lnet_net_lock_current();
- cfs_list_for_each(e1, &the_lnet.ln_remote_nets) {
- rnet = cfs_list_entry(e1, lnet_remotenet_t, lrn_list);
+ for (i = 0; i < LNET_REMOTE_NETS_HASH_SIZE; i++) {
+ rn_list = &the_lnet.ln_remote_nets_hash[i];
+ cfs_list_for_each(e1, rn_list) {
+ rnet = cfs_list_entry(e1, lnet_remotenet_t, lrn_list);
- route2 = NULL;
- cfs_list_for_each(e2, &rnet->lrn_routes) {
- lnet_nid_t nid1;
- lnet_nid_t nid2;
- int net;
+ route2 = NULL;
+ cfs_list_for_each(e2, &rnet->lrn_routes) {
+ lnet_nid_t nid1;
+ lnet_nid_t nid2;
+ int net;
- route = cfs_list_entry(e2, lnet_route_t, lr_list);
+ route = cfs_list_entry(e2, lnet_route_t,
+ lr_list);
- if (route2 == NULL) {
- route2 = route;
- continue;
- }
+ if (route2 == NULL) {
+ route2 = route;
+ continue;
+ }
- if (route->lr_gateway->lp_ni ==
- route2->lr_gateway->lp_ni)
- continue;
+ if (route->lr_gateway->lp_ni ==
+ route2->lr_gateway->lp_ni)
+ continue;
- nid1 = route->lr_gateway->lp_nid;
- nid2 = route2->lr_gateway->lp_nid;
- net = rnet->lrn_net;
+ nid1 = route->lr_gateway->lp_nid;
+ nid2 = route2->lr_gateway->lp_nid;
+ net = rnet->lrn_net;
- lnet_net_unlock(cpt);
+ lnet_net_unlock(cpt);
- CERROR("Routes to %s via %s and %s not supported\n",
- libcfs_net2str(net), libcfs_nid2str(nid1),
- libcfs_nid2str(nid2));
- return -EINVAL;
+ CERROR("Routes to %s via %s and %s not "
+ "supported\n",
+ libcfs_net2str(net),
+ libcfs_nid2str(nid1),
+ libcfs_nid2str(nid2));
+ return -EINVAL;
+ }
}
}
}
int
-lnet_del_route (__u32 net, lnet_nid_t gw_nid)
+lnet_del_route(__u32 net, lnet_nid_t gw_nid)
{
struct lnet_peer *gateway;
- lnet_remotenet_t *rnet;
- lnet_route_t *route;
- cfs_list_t *e1;
- cfs_list_t *e2;
- int rc = -ENOENT;
+ lnet_remotenet_t *rnet;
+ lnet_route_t *route;
+ cfs_list_t *e1;
+ cfs_list_t *e2;
+ int rc = -ENOENT;
+ cfs_list_t *rn_list;
+ int idx = 0;
- CDEBUG(D_NET, "Del route: net %s : gw %s\n",
- libcfs_net2str(net), libcfs_nid2str(gw_nid));
+ CDEBUG(D_NET, "Del route: net %s : gw %s\n",
+ libcfs_net2str(net), libcfs_nid2str(gw_nid));
- /* NB Caller may specify either all routes via the given gateway
- * or a specific route entry actual NIDs) */
+ /* NB Caller may specify either all routes via the given gateway
+ * or a specific route entry actual NIDs) */
- again:
lnet_net_lock(LNET_LOCK_EX);
+ if (net == LNET_NIDNET(LNET_NID_ANY))
+ rn_list = &the_lnet.ln_remote_nets_hash[0];
+ else
+ rn_list = lnet_net2rnethash(net);
- cfs_list_for_each (e1, &the_lnet.ln_remote_nets) {
- rnet = cfs_list_entry(e1, lnet_remotenet_t, lrn_list);
+ again:
+ cfs_list_for_each(e1, rn_list) {
+ rnet = cfs_list_entry(e1, lnet_remotenet_t, lrn_list);
- if (!(net == LNET_NIDNET(LNET_NID_ANY) ||
- net == rnet->lrn_net))
- continue;
+ if (!(net == LNET_NIDNET(LNET_NID_ANY) ||
+ net == rnet->lrn_net))
+ continue;
- cfs_list_for_each (e2, &rnet->lrn_routes) {
- route = cfs_list_entry(e2, lnet_route_t, lr_list);
+ cfs_list_for_each(e2, &rnet->lrn_routes) {
+ route = cfs_list_entry(e2, lnet_route_t, lr_list);
gateway = route->lr_gateway;
if (!(gw_nid == LNET_NID_ANY ||
cfs_list_del(&route->lr_list);
cfs_list_del(&route->lr_gwlist);
- the_lnet.ln_remote_nets_version++;
+ the_lnet.ln_remote_nets_version++;
- if (cfs_list_empty(&rnet->lrn_routes))
- cfs_list_del(&rnet->lrn_list);
- else
- rnet = NULL;
+ if (cfs_list_empty(&rnet->lrn_routes))
+ cfs_list_del(&rnet->lrn_list);
+ else
+ rnet = NULL;
lnet_rtr_decref_locked(gateway);
lnet_peer_decref_locked(gateway);
lnet_net_unlock(LNET_LOCK_EX);
- LIBCFS_FREE(route, sizeof (*route));
+ LIBCFS_FREE(route, sizeof(*route));
- if (rnet != NULL)
- LIBCFS_FREE(rnet, sizeof(*rnet));
+ if (rnet != NULL)
+ LIBCFS_FREE(rnet, sizeof(*rnet));
- rc = 0;
- goto again;
- }
- }
+ rc = 0;
+ lnet_net_lock(LNET_LOCK_EX);
+ goto again;
+ }
+ }
+ if (net == LNET_NIDNET(LNET_NID_ANY) &&
+ ++idx < LNET_REMOTE_NETS_HASH_SIZE) {
+ rn_list = &the_lnet.ln_remote_nets_hash[idx];
+ goto again;
+ }
lnet_net_unlock(LNET_LOCK_EX);
+
return rc;
}
int
lnet_get_route(int idx, __u32 *net, __u32 *hops,
- lnet_nid_t *gateway, __u32 *alive)
+ lnet_nid_t *gateway, __u32 *alive, __u32 *priority)
{
cfs_list_t *e1;
cfs_list_t *e2;
lnet_remotenet_t *rnet;
lnet_route_t *route;
int cpt;
+ int i;
+ cfs_list_t *rn_list;
cpt = lnet_net_lock_current();
- cfs_list_for_each (e1, &the_lnet.ln_remote_nets) {
- rnet = cfs_list_entry(e1, lnet_remotenet_t, lrn_list);
-
- cfs_list_for_each (e2, &rnet->lrn_routes) {
- route = cfs_list_entry(e2, lnet_route_t, lr_list);
-
- if (idx-- == 0) {
- *net = rnet->lrn_net;
- *hops = route->lr_hops;
- *gateway = route->lr_gateway->lp_nid;
- *alive = route->lr_gateway->lp_alive;
- lnet_net_unlock(cpt);
- return 0;
+ for (i = 0; i < LNET_REMOTE_NETS_HASH_SIZE; i++) {
+ rn_list = &the_lnet.ln_remote_nets_hash[i];
+ cfs_list_for_each(e1, rn_list) {
+ rnet = cfs_list_entry(e1, lnet_remotenet_t, lrn_list);
+
+ cfs_list_for_each(e2, &rnet->lrn_routes) {
+ route = cfs_list_entry(e2, lnet_route_t,
+ lr_list);
+
+ if (idx-- == 0) {
+ *net = rnet->lrn_net;
+ *hops = route->lr_hops;
+ *priority = route->lr_priority;
+ *gateway = route->lr_gateway->lp_nid;
+ *alive = route->lr_gateway->lp_alive;
+ lnet_net_unlock(cpt);
+ return 0;
+ }
}
}
}
void
lnet_swap_pinginfo(lnet_ping_info_t *info)
{
- int i;
- lnet_ni_status_t *stat;
+ int i;
+ lnet_ni_status_t *stat;
__swab32s(&info->pi_magic);
- __swab32s(&info->pi_version);
+ __swab32s(&info->pi_features);
__swab32s(&info->pi_pid);
__swab32s(&info->pi_nnis);
for (i = 0; i < info->pi_nnis && i < LNET_MAX_RTR_NIS; i++) {
if (info->pi_magic != LNET_PROTO_PING_MAGIC) {
CDEBUG(D_NET, "%s: Unexpected magic %08x\n",
libcfs_nid2str(gw->lp_nid), info->pi_magic);
- gw->lp_ping_version = LNET_PROTO_PING_UNKNOWN;
+ gw->lp_ping_feats = LNET_PING_FEAT_INVAL;
return;
}
- gw->lp_ping_version = info->pi_version;
- if (gw->lp_ping_version == LNET_PROTO_PING_VERSION_1)
- return; /* v1 doesn't carry NI status info */
-
- if (gw->lp_ping_version != LNET_PROTO_PING_VERSION) {
- CDEBUG(D_NET, "%s: Unexpected version 0x%x\n",
- libcfs_nid2str(gw->lp_nid), gw->lp_ping_version);
- gw->lp_ping_version = LNET_PROTO_PING_UNKNOWN;
- return;
+ gw->lp_ping_feats = info->pi_features;
+ if ((gw->lp_ping_feats & LNET_PING_FEAT_MASK) == 0) {
+ CDEBUG(D_NET, "%s: Unexpected features 0x%x\n",
+ libcfs_nid2str(gw->lp_nid), gw->lp_ping_feats);
+ return; /* nothing I can understand */
}
+ if ((gw->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) == 0)
+ return; /* can't carry NI status info */
+
cfs_list_for_each_entry(rtr, &gw->lp_routes, lr_gwlist) {
- int ptl_status = LNET_NI_STATUS_INVALID;
int down = 0;
int up = 0;
int i;
if (nid == LNET_NID_ANY) {
CDEBUG(D_NET, "%s: unexpected LNET_NID_ANY\n",
libcfs_nid2str(gw->lp_nid));
- gw->lp_ping_version = LNET_PROTO_PING_UNKNOWN;
+ gw->lp_ping_feats = LNET_PING_FEAT_INVAL;
return;
}
continue;
if (stat->ns_status == LNET_NI_STATUS_DOWN) {
- if (LNET_NETTYP(LNET_NIDNET(nid)) != PTLLND)
- down++;
- else if (ptl_status != LNET_NI_STATUS_UP)
- ptl_status = LNET_NI_STATUS_DOWN;
+ down++;
continue;
}
up = 1;
break;
}
- /* ptl NIs are considered down only when
- * they're all down */
- if (LNET_NETTYP(LNET_NIDNET(nid)) == PTLLND)
- ptl_status = LNET_NI_STATUS_UP;
continue;
}
CDEBUG(D_NET, "%s: Unexpected status 0x%x\n",
libcfs_nid2str(gw->lp_nid), stat->ns_status);
- gw->lp_ping_version = LNET_PROTO_PING_UNKNOWN;
+ gw->lp_ping_feats = LNET_PING_FEAT_INVAL;
return;
}
rtr->lr_downis = 0;
continue;
}
- rtr->lr_downis = down + (ptl_status == LNET_NI_STATUS_DOWN);
+ rtr->lr_downis = down;
}
}
if (event->unlinked) {
LNetInvalidateHandle(&rcd->rcd_mdh);
return;
- }
+ }
LASSERT(event->type == LNET_EVENT_SEND ||
event->type == LNET_EVENT_REPLY);
mdh = rcd->rcd_mdh;
if (rtr->lp_ping_deadline == 0) {
- rtr->lp_ping_deadline = \
+ rtr->lp_ping_deadline =
cfs_time_shift(router_ping_timeout);
}
return 0;
#ifdef __KERNEL__
- cfs_sema_init(&the_lnet.ln_rc_signal, 0);
+ sema_init(&the_lnet.ln_rc_signal, 0);
/* EQ size doesn't matter; the callback is guaranteed to get every
* event */
eqsz = 0;
the_lnet.ln_rc_state = LNET_RC_STATE_RUNNING;
#ifdef __KERNEL__
- rc = cfs_create_thread(lnet_router_checker, NULL, 0);
- if (rc < 0) {
- CERROR("Can't start router checker thread: %d\n", rc);
- /* block until event callback signals exit */
- cfs_down(&the_lnet.ln_rc_signal);
- rc = LNetEQFree(the_lnet.ln_rc_eqh);
- LASSERT (rc == 0);
- the_lnet.ln_rc_state = LNET_RC_STATE_SHUTDOWN;
- return -ENOMEM;
- }
+ rc = PTR_ERR(kthread_run(lnet_router_checker,
+ NULL, "router_checker"));
+ if (IS_ERR_VALUE(rc)) {
+ CERROR("Can't start router checker thread: %d\n", rc);
+ /* block until event callback signals exit */
+ down(&the_lnet.ln_rc_signal);
+ rc = LNetEQFree(the_lnet.ln_rc_eqh);
+ LASSERT(rc == 0);
+ the_lnet.ln_rc_state = LNET_RC_STATE_SHUTDOWN;
+ return -ENOMEM;
+ }
#endif
if (check_routers_before_use) {
#ifdef __KERNEL__
/* block until event callback signals exit */
- cfs_down(&the_lnet.ln_rc_signal);
+ down(&the_lnet.ln_rc_signal);
#else
lnet_router_checker();
#endif
LNetMDUnlink(rcd->rcd_mdh);
lnet_net_lock(LNET_LOCK_EX);
- }
+ }
cfs_list_splice_init(&head, &the_lnet.ln_rcd_zombie);
while (!cfs_list_empty(&the_lnet.ln_rcd_zombie)) {
cfs_list_for_each_entry_safe(rcd, tmp, &the_lnet.ln_rcd_zombie,
rcd_list) {
- if (!LNetHandleIsInvalid(rcd->rcd_mdh))
+ if (LNetHandleIsInvalid(rcd->rcd_mdh))
cfs_list_move(&rcd->rcd_list, &head);
- }
+ }
wait_unlink = wait_unlink &&
!cfs_list_empty(&the_lnet.ln_rcd_zombie);
}
if (!wait_unlink)
- break;
+ return;
i++;
CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET,
lnet_net_lock(LNET_LOCK_EX);
}
+
+ lnet_net_unlock(LNET_LOCK_EX);
}
lnet_peer_t *rtr;
cfs_list_t *entry;
- cfs_daemonize("router_checker");
cfs_block_allsigs();
LASSERT (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING);
cfs_list_for_each(entry, &the_lnet.ln_routers) {
rtr = cfs_list_entry(entry, lnet_peer_t, lp_rtr_list);
- cpt2 = lnet_cpt_of_nid(rtr->lp_nid);
+ cpt2 = lnet_cpt_of_nid_locked(rtr->lp_nid);
if (cpt != cpt2) {
lnet_net_unlock(cpt);
cpt = cpt2;
lnet_prune_rc_data(0); /* don't wait for UNLINK */
- /* Call cfs_pause() here always adds 1 to load average
- * because kernel counts # active tasks as nr_running
- * + nr_uninterruptible. */
- cfs_schedule_timeout_and_set_state(CFS_TASK_INTERRUPTIBLE,
- cfs_time_seconds(1));
- }
+ /* Call cfs_pause() here always adds 1 to load average
+ * because kernel counts # active tasks as nr_running
+ * + nr_uninterruptible. */
+ schedule_timeout_and_set_state(TASK_INTERRUPTIBLE,
+ cfs_time_seconds(1));
+ }
LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING);
lnet_prune_rc_data(1); /* wait for UNLINK */
the_lnet.ln_rc_state = LNET_RC_STATE_SHUTDOWN;
- cfs_up(&the_lnet.ln_rc_signal);
- /* The unlink event callback will signal final completion */
- return 0;
+ up(&the_lnet.ln_rc_signal);
+ /* The unlink event callback will signal final completion */
+ return 0;
}
void
int sz = offsetof(lnet_rtrbuf_t, rb_kiov[npages]);
while (--npages >= 0)
- cfs_free_page(rb->rb_kiov[npages].kiov_page);
+ __free_page(rb->rb_kiov[npages].kiov_page);
LIBCFS_FREE(rb, sz);
}
for (i = 0; i < npages; i++) {
page = cfs_page_cpt_alloc(lnet_cpt_table(), cpt,
- CFS_ALLOC_ZERO | CFS_ALLOC_STD);
+ __GFP_ZERO | GFP_IOFS);
if (page == NULL) {
while (--i >= 0)
- cfs_free_page(rb->rb_kiov[i].kiov_page);
+ __free_page(rb->rb_kiov[i].kiov_page);
LIBCFS_FREE(rb, sz);
return NULL;
}
- rb->rb_kiov[i].kiov_len = CFS_PAGE_SIZE;
+ rb->rb_kiov[i].kiov_len = PAGE_CACHE_SIZE;
rb->rb_kiov[i].kiov_offset = 0;
rb->rb_kiov[i].kiov_page = page;
}
lnet_rtrpools_free(void)
{
lnet_rtrbufpool_t *rtrp;
- int i;
+ int i;
if (the_lnet.ln_rtrpools == NULL) /* uninitialized or freed */
return;
lnet_rtrpools_alloc(int im_a_router)
{
lnet_rtrbufpool_t *rtrp;
- int large_pages = (LNET_MTU + CFS_PAGE_SIZE - 1) >> CFS_PAGE_SHIFT;
+ int large_pages = (LNET_MTU + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
int small_pages = 1;
int nrb_tiny;
int nrb_small;
cfs_time_t now = cfs_time_current();
int cpt = lnet_cpt_of_nid(nid);
- LASSERT (!cfs_in_interrupt ());
+ LASSERT (!in_interrupt ());
- CDEBUG (D_NET, "%s notifying %s: %s\n",
- (ni == NULL) ? "userspace" : libcfs_nid2str(ni->ni_nid),
- libcfs_nid2str(nid),
- alive ? "up" : "down");
+ CDEBUG (D_NET, "%s notifying %s: %s\n",
+ (ni == NULL) ? "userspace" : libcfs_nid2str(ni->ni_nid),
+ libcfs_nid2str(nid),
+ alive ? "up" : "down");
if (ni != NULL &&
LNET_NIDNET(ni->ni_nid) != LNET_NIDNET(nid)) {
lnet_net_lock(cpt);
+ if (the_lnet.ln_shutdown) {
+ lnet_net_unlock(cpt);
+ return -ESHUTDOWN;
+ }
+
lp = lnet_find_peer_locked(the_lnet.ln_peer_tables[cpt], nid);
if (lp == NULL) {
/* nid not found */