diff mbox series

[07/12] lnet: Fix source specified to routed destination

Message ID 1639321683-22909-8-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>

If a source NI is specified for a send then we should not modify the
destination NID that was passed to lnet_send().

HPE-bug-id: LUS-10301
WC-bug-id: https://jira.whamcloud.com/browse/LU-14941
Lustre-commit: 98da4ace43a6c4c59 ("LU-14941 lnet: Fix source specified to routed destination")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Reviewed-on: https://review.whamcloud.com/44730
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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index a411724..caffa30 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -1989,13 +1989,19 @@  struct lnet_ni *
 	}
 
 	if (!route_found) {
-		if (sd->sd_msg->msg_routing) {
+		if (sd->sd_msg->msg_routing || src_nid != LNET_NID_ANY) {
 			/* If I'm routing this message then I need to find the
 			 * next hop based on the destination NID
+			 *
+			 * We also find next hop based on the destination NID
+			 * if the source NI was specified
 			 */
 			best_rnet = lnet_find_rnet_locked(LNET_NIDNET(sd->sd_dst_nid));
 			if (!best_rnet) {
-				CERROR("Unable to route message to %s - Route table may be misconfigured\n",
+				CERROR("Unable to send message from %s to %s - Route table may be misconfigured\n",
+				       src_nid != LNET_NID_ANY ?
+						libcfs_nid2str(src_nid) :
+						"any local NI",
 				       libcfs_nid2str(sd->sd_dst_nid));
 				return -EHOSTUNREACH;
 			}