#define LNET_NRB_LARGE_PAGES ((LNET_MTU + PAGE_SIZE - 1) >> \
PAGE_SHIFT)
-extern unsigned int lnet_current_net_count;
-
static char *forwarding = "";
module_param(forwarding, charp, 0444);
MODULE_PARM_DESC(forwarding, "Explicitly enable/disable forwarding between networks");
* aliveness information can only be obtained when discovery is
* enabled.
*/
- if (lnet_peer_discovery_disabled)
+ if (lnet_is_discovery_disabled(gw))
return route->lr_alive;
/*
spin_lock(&lp->lp_lock);
lp_state = lp->lp_state;
- spin_unlock(&lp->lp_lock);
/* only handle replies if discovery is disabled. */
- if (!lnet_peer_discovery_disabled)
+ if (!lnet_is_discovery_disabled_locked(lp)) {
+ spin_unlock(&lp->lp_lock);
return;
+ }
+
+ spin_unlock(&lp->lp_lock);
- if (lp_state & LNET_PEER_PING_FAILED) {
- CDEBUG(D_NET,
- "Ping failed with %d. Set routes down for gw %s\n",
- lp->lp_ping_error, libcfs_nid2str(lp->lp_primary_nid));
- /* If the ping failed then mark the routes served by this
- * peer down
+ if (lp_state & LNET_PEER_PING_FAILED ||
+ pbuf->pb_info.pi_features & LNET_PING_FEAT_RTE_DISABLED) {
+ CDEBUG(D_NET, "Set routes down for gw %s because %s %d\n",
+ libcfs_nid2str(lp->lp_primary_nid),
+ lp_state & LNET_PEER_PING_FAILED ? "ping failed" :
+ "route feature is disabled", lp->lp_ping_error);
+ /* If the ping failed or the peer has routing disabled then
+ * mark the routes served by this peer down
*/
list_for_each_entry(route, &lp->lp_routes, lr_gwlist)
lnet_set_route_aliveness(route, false);
route->lr_gateway->lp_primary_nid)
continue;
- /* gateway has the routing feature disabled */
- if (pbuf->pb_info.pi_features &
- LNET_PING_FEAT_RTE_DISABLED) {
- lnet_set_route_aliveness(route, false);
- continue;
- }
-
llpn = lnet_peer_get_net_locked(lp, route->lr_lnet);
if (!llpn) {
lnet_set_route_aliveness(route, false);
spin_lock(&lp->lp_lock);
lp->lp_state &= ~LNET_PEER_RTR_DISCOVERY;
+ lp->lp_state |= LNET_PEER_RTR_DISCOVERED;
spin_unlock(&lp->lp_lock);
/*
add_device_randomness(&ni->ni_nid, sizeof(ni->ni_nid));
seeded = 1;
- return;
}
/* NB expects LNET_LOCK held */
LIBCFS_FREE(rnet, sizeof(*rnet));
/* kick start the monitor thread to handle the added route */
- wake_up(&the_lnet.ln_mt_waitq);
+ complete(&the_lnet.ln_mt_wait_complete);
return rc;
}
struct lnet_peer_ni *lpni;
struct lnet_route *route;
struct list_head zombies;
- struct lnet_peer *lp;
+ struct lnet_peer *lp = NULL;
int i = 0;
INIT_LIST_HEAD(&rnet_zombies);
spin_lock(&rtr->lp_lock);
- if ((rtr->lp_state & LNET_PEER_DISCOVERED) == 0) {
+ if ((rtr->lp_state & LNET_PEER_RTR_DISCOVERED) == 0) {
all_known = 0;
spin_unlock(&rtr->lp_lock);
break;
lnet_net_lock(LNET_LOCK_EX);
the_lnet.ln_routing = 1;
lnet_net_unlock(LNET_LOCK_EX);
- wake_up(&the_lnet.ln_mt_waitq);
+ complete(&the_lnet.ln_mt_wait_complete);
return 0;
failed: