From: Amir Shehata Date: Tue, 22 Oct 2019 18:27:24 +0000 (-0700) Subject: LU-12893 lnet: fix peer_ni selection X-Git-Tag: 2.12.90~9 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=94ee26738884e3f5b241698bc2e7a8da9702d264;hp=fba6abdb9818b01d02ac7663e4ac9881258c8ead LU-12893 lnet: fix peer_ni selection When selecting a peer-ni we must use the same peer NID through all the messages which belong to the same RPC. This is necessary in order to ensure we do the RDMA over the optimal interface. Signed-off-by: Amir Shehata Change-Id: I0391537da32bc6ac7a8a3d92e207bf172d111981 Reviewed-on: https://review.whamcloud.com/36552 Reviewed-by: Chris Horn Tested-by: jenkins Reviewed-by: Serguei Smirnov Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 88f20e7..7cc9237 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1910,8 +1910,11 @@ lnet_handle_spec_local_nmr_dst(struct lnet_send_data *sd) * Local Destination * MR Peer * - * Run the selection algorithm on the peer NIs unless we're sending - * a response, in this case just send to the destination + * Don't run the selection algorithm on the peer NIs. By specifying the + * local NID, we're also saying that we should always use the destination NID + * provided. This handles the case where we should be using the same + * destination NID for the all the messages which belong to the same RPC + * request. */ static int lnet_handle_spec_local_mr_dst(struct lnet_send_data *sd) @@ -1924,17 +1927,6 @@ lnet_handle_spec_local_mr_dst(struct lnet_send_data *sd) return -EINVAL; } - /* - * only run the selection algorithm to pick the peer_ni if we're - * sending a GET or a PUT. Responses are sent to the same - * destination NID provided. - */ - if (!(sd->sd_send_case & SND_RESP)) { - sd->sd_best_lpni = - lnet_find_best_lpni_on_net(sd, sd->sd_peer, - sd->sd_best_ni->ni_net->net_id); - } - if (sd->sd_best_lpni && sd->sd_best_lpni->lpni_nid == the_lnet.ln_loni->ni_nid) return lnet_handle_lo_send(sd);