}
extern lnd_t the_lolnd;
+extern int avoid_asym_router_failure;
#ifndef __KERNEL__
/* unconditional registration */
int lnet_router_checker_start(void);
void lnet_router_checker_stop(void);
+void lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net);
void lnet_swap_pinginfo(lnet_ping_info_t *info);
int lnet_parse_ip2nets(char **networksp, char *ip2nets);
__u32 *peer_rtr_credits, __u32 *peer_min_rtr_credtis,
__u32 *peer_tx_qnob);
+static inline void
+lnet_peer_set_alive(lnet_peer_t *lp)
+{
+ lp->lp_last_alive = lp->lp_last_query = cfs_time_current();
+ if (!lp->lp_alive)
+ lnet_notify_locked(lp, 0, 1, lp->lp_last_alive);
+}
+
#ifndef __KERNEL__
static inline int
lnet_parse_int_tunable(int *value, char *name)
goto drop;
}
+ if (lnet_isrouter(msg->msg_rxpeer)) {
+ lnet_peer_set_alive(msg->msg_rxpeer);
+ if (avoid_asym_router_failure &&
+ LNET_NIDNET(src_nid) != LNET_NIDNET(from_nid)) {
+ /* received a remote message from router, update
+ * remote NI status on this router.
+ * NB: multi-hop routed message will be ignored.
+ */
+ lnet_router_ni_update_locked(msg->msg_rxpeer,
+ LNET_NIDNET(src_nid));
+ }
+ }
+
lnet_msg_commit(msg, cpt);
/* message delay simulation */
CFS_MODULE_PARM(check_routers_before_use, "i", int, 0444,
"Assume routers are down and ping them before use");
-static int avoid_asym_router_failure = 1;
+int avoid_asym_router_failure = 1;
CFS_MODULE_PARM(avoid_asym_router_failure, "i", int, 0644,
"Avoid asymmetrical router failures (0 to disable)");
}
void
+lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net)
+{
+ lnet_route_t *rte;
+
+ if ((gw->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) != 0) {
+ list_for_each_entry(rte, &gw->lp_routes, lr_gwlist) {
+ if (rte->lr_net == net) {
+ rte->lr_downis = 0;
+ break;
+ }
+ }
+ }
+}
+
+void
lnet_update_ni_status_locked(void)
{
lnet_ni_t *ni;