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 <ashehata@whamcloud.com>
Change-Id: Ifd8dd65fe7695d69609ac4c1af5102429d8aa379
Reviewed-on: https://review.whamcloud.com/36916
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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;