From a50bc221a9600ed49d7e719a90086fcc470ee5ce Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Thu, 12 Aug 2021 16:16:05 -0500 Subject: [PATCH] LU-14941 lnet: Fix source specified to routed destination If a source NI is specified for a send then we should not modify the destination NID that was passed to lnet_send(). Lustre-change: https://review.whamcloud.com/44730 Lustre-commit: 98da4ace43a6c4c59e7981bf0fb649005237d12f Test-Parameters: trivial testlist=sanity-lnet HPE-bug-id: LUS-10301 Signed-off-by: Chris Horn Change-Id: Ie47558d5bce97a0dca30ff7d072dcd39eb903324 Reviewed-on: https://review.whamcloud.com/48441 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: Alexandre Ioffe Reviewed-by: Andreas Dilger --- lnet/lnet/lib-move.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 9f4e754..4ad8cff 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -2104,13 +2104,19 @@ lnet_handle_find_routed_path(struct lnet_send_data *sd, } 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; } -- 1.8.3.1