From: Amir Shehata Date: Fri, 29 Nov 2019 04:51:27 +0000 (-0800) Subject: LU-12955 lnet: fix routed final dest selection X-Git-Tag: 2.13.53~70 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8cedafff9d46c8067385d698b645bb1d0343cd57;hp=ed2c88b78c88b13f9cbcb3430909350915363ae5 LU-12955 lnet: fix routed final dest selection The final hop gateway should rely on the message initiator to select the final destination NID. IE if gateway is handing off the message to the final destination, always use the NID provided in the message. If the initiator has discovery off, then it'll always pick the same destination NID. Otherwise if the initiator has discovery on && there exists a route to each of the interfaces on the destination, the initiator will select these interfaces in round robin This will work for both single-hop and multi-hop cases. The logic on the routers will be: if destination NID in the message is local then send the message to the destination NID else if destination NID is remote && there exists a route if router is MR then select NI according to selection criteria Test-parameters: trivial Signed-off-by: Amir Shehata Change-Id: Ifd8dd65fe7695d69609ac4c1af5102429d8aa379 Reviewed-on: https://review.whamcloud.com/36916 Reviewed-by: Serguei Smirnov Reviewed-by: Chris Horn Tested-by: Maloo Tested-by: jenkins Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index d4ece42..ffcebb7 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -2698,11 +2698,16 @@ again: send_case |= REMOTE_DST; /* - * if this is a non-MR peer or if we're recovering a peer ni then - * let's consider this an NMR case so we can hit the destination - * NID. + * Deal with the peer as NMR in the following cases: + * 1. the peer is NMR + * 2. We're trying to recover a specific peer NI + * 3. I'm a router sending to the final destination + * In this case the source of the message would've + * already selected the final destination so my job + * is to honor the selection. */ - if (!lnet_peer_is_multi_rail(peer) || msg->msg_recovery) + if (!lnet_peer_is_multi_rail(peer) || msg->msg_recovery || + (msg->msg_routing && (send_case & LOCAL_DST))) send_case |= NMR_DST; else send_case |= MR_DST;