lustre-devel-lustre.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
	Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 24/50] lnet: Convert ping to support 16-bytes address
Date: Sun, 20 Mar 2022 09:30:38 -0400	[thread overview]
Message-ID: <1647783064-20688-25-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1647783064-20688-1-git-send-email-jsimmons@infradead.org>

From: Mr NeilBrown <neilb@suse.de>

Now that ksocknal can send hello messages with 16-byte address, we can
change lnet_send_ping() to ping hosts with large-address nids.

Note that this doesn't change the addresses in the ping message sent,
only the sending and receiving of the message.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 3e37ac8bb7e068a30 ("LU-10391 lnet: Convert ping to support 16-bytes address")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/43612
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 include/linux/lnet/lib-lnet.h |  5 +++--
 net/lnet/lnet/lib-move.c      | 42 ++++++++++++++++++++----------------------
 net/lnet/lnet/peer.c          |  3 +--
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h
index 0155111..297e5ef 100644
--- a/include/linux/lnet/lib-lnet.h
+++ b/include/linux/lnet/lib-lnet.h
@@ -643,8 +643,9 @@ void lnet_prep_send(struct lnet_msg *msg, int type,
 		    unsigned int len);
 int lnet_send(struct lnet_nid *nid, struct lnet_msg *msg,
 	      struct lnet_nid *rtr_nid);
-int lnet_send_ping(lnet_nid_t dest_nid, struct lnet_handle_md *mdh, int nnis,
-		   void *user_ptr, lnet_handler_t handler, bool recovery);
+int lnet_send_ping(struct lnet_nid *dest_nid, struct lnet_handle_md *mdh,
+		   int nnis, void *user_ptr, lnet_handler_t handler,
+		   bool recovery);
 void lnet_return_tx_credits_locked(struct lnet_msg *msg);
 void lnet_return_rx_credits_locked(struct lnet_msg *msg);
 void lnet_schedule_blocked_locked(struct lnet_rtrbufpool *rbp);
diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index aa230d7..496c895 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -2891,8 +2891,8 @@ enum lnet_mt_event_type {
 };
 
 struct lnet_mt_event_info {
-	enum lnet_mt_event_type mt_type;
-	lnet_nid_t mt_nid;
+	enum lnet_mt_event_type	mt_type;
+	struct lnet_nid		mt_nid;
 };
 
 /* called with res_lock held */
@@ -3176,7 +3176,7 @@ struct lnet_mt_event_info {
 	struct lnet_handle_md mdh;
 	struct lnet_ni *tmp;
 	struct lnet_ni *ni;
-	lnet_nid_t nid;
+	struct lnet_nid nid;
 	int healthv;
 	int rc;
 	time64_t now;
@@ -3258,8 +3258,7 @@ struct lnet_mt_event_info {
 			 * We'll unlink the mdh in this case below.
 			 */
 			LNetInvalidateMDHandle(&ni->ni_ping_mdh);
-			/* FIXME need to handle large-addr nid */
-			nid = lnet_nid_to_nid4(&ni->ni_nid);
+			nid = ni->ni_nid;
 
 			/* remove the NI from the local queue and drop the
 			 * reference count to it while we're recovering
@@ -3284,12 +3283,12 @@ struct lnet_mt_event_info {
 
 			ev_info->mt_type = MT_TYPE_LOCAL_NI;
 			ev_info->mt_nid = nid;
-			rc = lnet_send_ping(nid, &mdh, LNET_INTERFACES_MIN,
+			rc = lnet_send_ping(&nid, &mdh, LNET_INTERFACES_MIN,
 					    ev_info, the_lnet.ln_mt_handler,
 					    true);
 			/* lookup the nid again */
 			lnet_net_lock(0);
-			ni = lnet_nid2ni_locked(nid, 0);
+			ni = lnet_nid_to_ni_locked(&nid, 0);
 			if (!ni) {
 				/* the NI has been deleted when we dropped
 				 * the ref count
@@ -3430,7 +3429,7 @@ struct lnet_mt_event_info {
 	struct lnet_handle_md mdh;
 	struct lnet_peer_ni *lpni;
 	struct lnet_peer_ni *tmp;
-	lnet_nid_t nid;
+	struct lnet_nid nid;
 	time64_t now;
 	int healthv;
 	int rc;
@@ -3504,9 +3503,8 @@ struct lnet_mt_event_info {
 
 			/* look at the comments in lnet_recover_local_nis() */
 			mdh = lpni->lpni_recovery_ping_mdh;
+			nid = lpni->lpni_nid;
 			LNetInvalidateMDHandle(&lpni->lpni_recovery_ping_mdh);
-			/* FIXME handle large-addr nid */
-			nid = lnet_nid_to_nid4(&lpni->lpni_nid);
 			lnet_net_lock(0);
 			list_del_init(&lpni->lpni_recovery);
 			lnet_peer_ni_decref_locked(lpni);
@@ -3514,14 +3512,14 @@ struct lnet_mt_event_info {
 
 			ev_info->mt_type = MT_TYPE_PEER_NI;
 			ev_info->mt_nid = nid;
-			rc = lnet_send_ping(nid, &mdh, LNET_INTERFACES_MIN,
+			rc = lnet_send_ping(&nid, &mdh, LNET_INTERFACES_MIN,
 					    ev_info, the_lnet.ln_mt_handler,
 					    true);
 			lnet_net_lock(0);
 			/* lnet_find_peer_ni_locked() grabs a refcount for
 			 * us. No need to take it explicitly.
 			 */
-			lpni = lnet_find_peer_ni_locked(nid);
+			lpni = lnet_peer_ni_find_locked(&nid);
 			if (!lpni) {
 				lnet_net_unlock(0);
 				LNetMDUnlink(mdh);
@@ -3622,7 +3620,7 @@ struct lnet_mt_event_info {
  * Returns < 0 if LNetGet fails
  */
 int
-lnet_send_ping(lnet_nid_t dest_nid,
+lnet_send_ping(struct lnet_nid *dest_nid,
 	       struct lnet_handle_md *mdh, int nnis,
 	       void *user_data, lnet_handler_t handler, bool recovery)
 {
@@ -3631,7 +3629,7 @@ struct lnet_mt_event_info {
 	struct lnet_ping_buffer *pbuf;
 	int rc;
 
-	if (dest_nid == LNET_NID_ANY) {
+	if (LNET_NID_IS_ANY(dest_nid)) {
 		rc = -EHOSTUNREACH;
 		goto fail_error;
 	}
@@ -3659,7 +3657,7 @@ struct lnet_mt_event_info {
 		goto fail_error;
 	}
 	id.pid = LNET_PID_LUSTRE;
-	id.nid = dest_nid;
+	id.nid = lnet_nid_to_nid4(dest_nid);
 
 	rc = LNetGet(LNET_NID_ANY, *mdh, id,
 		     LNET_RESERVED_PORTAL,
@@ -3680,13 +3678,13 @@ struct lnet_mt_event_info {
 lnet_handle_recovery_reply(struct lnet_mt_event_info *ev_info,
 			   int status, bool send, bool unlink_event)
 {
-	lnet_nid_t nid = ev_info->mt_nid;
+	struct lnet_nid *nid = &ev_info->mt_nid;
 
 	if (ev_info->mt_type == MT_TYPE_LOCAL_NI) {
 		struct lnet_ni *ni;
 
 		lnet_net_lock(0);
-		ni = lnet_nid2ni_locked(nid, 0);
+		ni = lnet_nid_to_ni_locked(nid, 0);
 		if (!ni) {
 			lnet_net_unlock(0);
 			return;
@@ -3701,7 +3699,7 @@ struct lnet_mt_event_info {
 
 		if (status != 0) {
 			CERROR("local NI (%s) recovery failed with %d\n",
-			       libcfs_nid2str(nid), status);
+			       libcfs_nidstr(nid), status);
 			return;
 		}
 		/* need to increment healthv for the ni here, because in
@@ -3718,7 +3716,7 @@ struct lnet_mt_event_info {
 		int cpt;
 
 		cpt = lnet_net_lock_current();
-		lpni = lnet_find_peer_ni_locked(nid);
+		lpni = lnet_peer_ni_find_locked(nid);
 		if (!lpni) {
 			lnet_net_unlock(cpt);
 			return;
@@ -3733,7 +3731,7 @@ struct lnet_mt_event_info {
 
 		if (status != 0)
 			CERROR("peer NI (%s) recovery failed with %d\n",
-			       libcfs_nid2str(nid), status);
+			       libcfs_nidstr(nid), status);
 	}
 }
 
@@ -3754,7 +3752,7 @@ struct lnet_mt_event_info {
 	switch (event->type) {
 	case LNET_EVENT_UNLINK:
 		CDEBUG(D_NET, "%s recovery ping unlinked\n",
-		       libcfs_nid2str(ev_info->mt_nid));
+		       libcfs_nidstr(&ev_info->mt_nid));
 		/* fall-through */
 	case LNET_EVENT_REPLY:
 		lnet_handle_recovery_reply(ev_info, event->status, false,
@@ -3762,7 +3760,7 @@ struct lnet_mt_event_info {
 		break;
 	case LNET_EVENT_SEND:
 		CDEBUG(D_NET, "%s recovery message sent %s:%d\n",
-		       libcfs_nid2str(ev_info->mt_nid),
+		       libcfs_nidstr(&ev_info->mt_nid),
 		       (event->status) ? "unsuccessfully" :
 		       "successfully", event->status);
 		lnet_handle_recovery_reply(ev_info, event->status, true, false);
diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index d0b7bc8..494b7ef 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -3471,8 +3471,7 @@ static int lnet_peer_send_ping(struct lnet_peer *lp)
 
 	nnis = max_t(int, lp->lp_data_nnis, LNET_INTERFACES_MIN);
 
-	rc = lnet_send_ping(lnet_nid_to_nid4(&lp->lp_primary_nid),
-			    &lp->lp_ping_mdh, nnis, lp,
+	rc = lnet_send_ping(&lp->lp_primary_nid, &lp->lp_ping_mdh, nnis, lp,
 			    the_lnet.ln_dc_handler, false);
 	/* if LNetMDBind in lnet_send_ping fails we need to decrement the
 	 * refcount on the peer, otherwise LNetMDUnlink will be called
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

  parent reply	other threads:[~2022-03-20 13:33 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 13:30 [lustre-devel] [PATCH 00/50] lustre: update to OpenSFS tree as of March 20, 2022 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 01/50] lustre: type cleanups and remove debug statements James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 02/50] lustre: osc: Fix grant test for ARM James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 03/50] lnet: extend nids in struct lnet_msg James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 04/50] lnet: Change lnet_send() to take large-addr nids James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 05/50] lnet: use large nids in struct lnet_event James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 06/50] lnet: socklnd: prepare for new KSOCK_MSG type James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 07/50] lnet: socklnd: don't deref lnet_hdr in LNDs James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 08/50] lustre: sec: make client encryption compatible with ext4 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 09/50] lustre: sec: allow subdir mount of encrypted dir James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 10/50] lustre: fld: repeat rpc in fld_client_rpc after EAGAIN James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 11/50] lustre: fld: don't obtain a slot for fld request James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 12/50] lustre: update version to 2.14.57 James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 13/50] lustre: llite: deadlock in ll_new_node() James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 14/50] lnet: o2iblnd: avoid static allocation for msg tx James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 15/50] lnet: separate lnet_hdr in msg from that in lnd James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 16/50] lnet: change lnet_hdr to store large nids James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 17/50] lnet: change lnet_prep_send to take net_processid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 18/50] lnet: convert to struct lnet_process_id in lib-move James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 19/50] lnet: convert LNetGetID to return an large-addr pid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 20/50] lnet: alter lnd_notify_peer_down() to take lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 21/50] lnet: socklnd: move lnet_hdr unpack into ->pro_unpack James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 22/50] lnet: socklnd: Change ksock_hello_msg to struct lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 23/50] lnet: socklnd: add hello message version 4 James Simmons
2022-03-20 13:30 ` James Simmons [this message]
2022-03-20 13:30 ` [lustre-devel] [PATCH 25/50] lnet: convert nids in lnet_parse to lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 26/50] lnet: change src_nid arg to lnet_parse() to 16byte James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 27/50] lnet: Fix NULL-deref in lnet_nidstr_r() James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 28/50] lnet: change lnet_del_route() to take lnet_nid James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 29/50] lustre: llite: Move free user pages James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 30/50] lustre: llite: Do not get/put DIO pages James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 31/50] lustre: llite: Remove unnecessary page get/put James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 32/50] lustre: llite: LL_IOC_LMV_GETSTRIPE 'default' shows inherit layout James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 33/50] lustre: hsm: update size upon completion of data version James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 34/50] lustre: llite: Delay dput in ll_dirty_page_discard_warn James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 35/50] lnet: libcfs: Use FAIL_CHECK_QUIET for fake i/o James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 36/50] lnet: Avoid peer NI recovery for local interface James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 37/50] lustre: osc: add OBD_IOC_GETATTR support for osc James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 38/50] lustre: sec: present .fscrypt in subdir mount James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 39/50] lnet: improve hash distribution across CPTs James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 40/50] lustre: osc: osc_extent_wait() deadlock James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 41/50] lustre: quota: delete unused quota ID James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 42/50] lnet: Check LNET_NID_IS_ANY in LNET_NID_NET James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 43/50] lustre: llite: clear async errors on write commit sync James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 44/50] lnet: lnet_peer_data_present() memory leak James Simmons
2022-03-20 13:30 ` [lustre-devel] [PATCH 45/50] lnet: Don't use pref NI for reserved portal James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 46/50] lnet: o2iblnd: avoid memory copy for short msg James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 47/50] lustre: llite: set default LMV hash type with 2.12 MDS James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 48/50] lnet: Stop discovery on deleted peer NI James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 49/50] lustre: sec: fix DIO for encrypted files James Simmons
2022-03-20 13:31 ` [lustre-devel] [PATCH 50/50] lustre: ptlrpc: Use after free of 'conn' in rhashtable retry James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1647783064-20688-25-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=adilger@whamcloud.com \
    --cc=green@whamcloud.com \
    --cc=lustre-devel@lists.lustre.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).