Whamcloud - gitweb
LU-9120 lnet: health error simulation
[fs/lustre-release.git] / lnet / lnet / lib-move.c
index 2c503b3..a89fa41 100644 (file)
@@ -757,7 +757,7 @@ static void
 lnet_ni_send(struct lnet_ni *ni, struct lnet_msg *msg)
 {
        void   *priv = msg->msg_private;
-       int     rc;
+       int rc;
 
        LASSERT (!in_interrupt ());
        LASSERT (LNET_NETTYP(LNET_NIDNET(ni->ni_nid)) == LOLND ||
@@ -2555,12 +2555,6 @@ again:
        }
        lnet_peer_ni_decref_locked(lpni);
 
-       /* If peer is not healthy then can not send anything to it */
-       if (!lnet_is_peer_healthy_locked(peer)) {
-               lnet_net_unlock(cpt);
-               return -EHOSTUNREACH;
-       }
-
        /*
         * Identify the different send cases
         */
@@ -2743,6 +2737,10 @@ lnet_finalize_expired_responses(bool force)
                                md->md_rspt_ptr = NULL;
                                lnet_res_unlock(i);
 
+                               lnet_net_lock(i);
+                               the_lnet.ln_counters[i]->response_timeout_count++;
+                               lnet_net_unlock(i);
+
                                list_del_init(&rspt->rspt_on_list);
 
                                CDEBUG(D_NET, "Response timed out: md = %p\n", md);
@@ -2810,6 +2808,11 @@ lnet_resend_pending_msgs_locked(struct list_head *resendq, int cpt)
                        lnet_peer_ni_decref_locked(lpni);
 
                        lnet_net_unlock(cpt);
+                       CDEBUG(D_NET, "resending %s->%s: %s recovery %d\n",
+                              libcfs_nid2str(src_nid),
+                              libcfs_id2str(msg->msg_target),
+                              lnet_msgtyp2str(msg->msg_type),
+                              msg->msg_recovery);
                        rc = lnet_send(src_nid, msg, LNET_NID_ANY);
                        if (rc) {
                                CERROR("Error sending %s to %s: %d\n",
@@ -2819,6 +2822,8 @@ lnet_resend_pending_msgs_locked(struct list_head *resendq, int cpt)
                                lnet_finalize(msg, rc);
                        }
                        lnet_net_lock(cpt);
+                       if (!rc)
+                               the_lnet.ln_counters[cpt]->resend_count++;
                }
        }
 }
@@ -4130,7 +4135,7 @@ lnet_parse(struct lnet_ni *ni, struct lnet_hdr *hdr, lnet_nid_t from_nid,
        }
 
        if (!list_empty(&the_lnet.ln_drop_rules) &&
-           lnet_drop_rule_match(hdr)) {
+           lnet_drop_rule_match(hdr, NULL)) {
                CDEBUG(D_NET, "%s, src %s, dst %s: Dropping %s to simulate"
                              "silent message loss\n",
                       libcfs_nid2str(from_nid), libcfs_nid2str(src_nid),