From: Chris Horn Date: Thu, 12 Aug 2021 21:08:44 +0000 (-0500) Subject: LU-14940 lnet: Fix source specified send to different net X-Git-Tag: 2.14.56~44 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F44728%2F3;p=fs%2Flustre-release.git LU-14940 lnet: Fix source specified send to different net 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 Change-Id: I4847db1d393bbc36def65123f260b928ebbf944e Reviewed-on: https://review.whamcloud.com/44728 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 3259946..579cfbd 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -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)) diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index ea76ab1..9d4e0f5 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -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"