diff mbox series

[06/12] lnet: Fix source specified send to different net

Message ID 1639321683-22909-7-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: backport OpenSFS work Dec 12, 2021 | expand

Commit Message

James Simmons Dec. 12, 2021, 3:07 p.m. UTC
From: Chris Horn <chris.horn@hpe.com>

The destination NI is fixed for all source-specified sends. Thus, in
order for a source-specified send to be considered "local", i.e. a
send that does not require a route, the destination NID must be on
the same net as the specified source.

HPE-bug-id: LUS-10303
WC-bug-id: https://jira.whamcloud.com/browse/LU-14940
Lustre-commit: 3e3563f719ce89de2 ("LU-14940 lnet: Fix source specified send to different net")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Reviewed-on: https://review.whamcloud.com/44728
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/lib-move.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index 088a754..a411724 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -2733,15 +2733,19 @@  struct lnet_ni *
 
 	/* Identify the different send cases
 	 */
-	if (src_nid == LNET_NID_ANY)
+	if (src_nid == LNET_NID_ANY) {
 		send_case |= SRC_ANY;
-	else
+		if (lnet_get_net_locked(LNET_NIDNET(dst_nid)))
+			send_case |= LOCAL_DST;
+		else
+			send_case |= REMOTE_DST;
+	} else {
 		send_case |= SRC_SPEC;
-
-	if (lnet_get_net_locked(LNET_NIDNET(dst_nid)))
-		send_case |= LOCAL_DST;
-	else
-		send_case |= REMOTE_DST;
+		if (LNET_NIDNET(src_nid) == LNET_NIDNET(dst_nid))
+			send_case |= LOCAL_DST;
+		else
+			send_case |= REMOTE_DST;
+	}
 
 	final_hop = false;
 	if (msg->msg_routing && (send_case & LOCAL_DST))