@@ -578,6 +578,9 @@ struct lnet_peer {
/* primary NID of the peer */
lnet_nid_t lp_primary_nid;
+ /* source NID to use during discovery */
+ lnet_nid_t lp_disc_src_nid;
+
/* net to perform discovery on */
u32 lp_disc_net_id;
@@ -216,6 +216,7 @@
init_waitqueue_head(&lp->lp_dc_waitq);
spin_lock_init(&lp->lp_lock);
lp->lp_primary_nid = nid;
+ lp->lp_disc_src_nid = LNET_NID_ANY;
if (lnet_peers_start_down())
lp->lp_alive = false;
else
@@ -2271,6 +2272,8 @@ static void lnet_peer_clear_discovery_error(struct lnet_peer *lp)
spin_lock(&lp->lp_lock);
+ lp->lp_disc_src_nid = ev->target.nid;
+
/*
* If some kind of error happened the contents of message
* cannot be used. Set PING_FAILED to trigger a retry.
@@ -3088,9 +3091,15 @@ static int lnet_peer_send_push(struct lnet_peer *lp)
goto fail_unlink;
}
- rc = LNetPut(LNET_NID_ANY, lp->lp_push_mdh,
+ rc = LNetPut(lp->lp_disc_src_nid, lp->lp_push_mdh,
LNET_ACK_REQ, id, LNET_RESERVED_PORTAL,
LNET_PROTO_PING_MATCHBITS, 0, 0);
+ /* reset the discovery nid. There is no need to restrict sending
+ * from that source, if we call lnet_push_update_to_peers(). It'll
+ * get set to a specific NID, if we initiate discovery from the
+ * scratch
+ */
+ lp->lp_disc_src_nid = LNET_NID_ANY;
if (rc)
goto fail_unlink;