Whamcloud - gitweb
LU-14940 lnet: Fix source specified send to different net 28/44728/3
authorChris Horn <chris.horn@hpe.com>
Thu, 12 Aug 2021 21:08:44 +0000 (16:08 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Nov 2021 03:47:28 +0000 (03:47 +0000)
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
Test-Parameters: trivial testlist=sanity-lnet
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I4847db1d393bbc36def65123f260b928ebbf944e
Reviewed-on: https://review.whamcloud.com/44728
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/lib-move.c
lustre/tests/sanity-lnet.sh

index 3259946..579cfbd 100644 (file)
@@ -2977,15 +2977,19 @@ again:
        /*
         * 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))
index ea76ab1..9d4e0f5 100755 (executable)
@@ -2188,6 +2188,14 @@ test_215() {
                npings=$(($npings * 2))
        done
 
+       # Ping from nid1 to nid2 should fail
+       do_lnetctl ping --source $nid1 $nid2 &&
+               error "ping from $nid1 to $nid2 should fail"
+
+       # Ping from nid2 to nid1 should fail
+       do_lnetctl ping --source $nid2 $nid1 &&
+               error "ping from $nid2 to $nid1 should fail"
+
        return 0
 }
 run_test 215 "Test lnetctl ping --source option"