From patchwork Thu Feb 27 21:17:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410703 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06F14924 for ; Thu, 27 Feb 2020 21:44:51 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E30BD24690 for ; Thu, 27 Feb 2020 21:44:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E30BD24690 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 7B54234AED9; Thu, 27 Feb 2020 13:35:49 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 48983348995 for ; Thu, 27 Feb 2020 13:21:16 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id F383E91D5; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id F20CB46D; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:17:18 -0500 Message-Id: <1582838290-17243-571-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 570/622] lnet: Refactor lnet_find_best_lpni_on_net X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Chris Horn Replace lnet_send_data argument. WC-bug-id: https://jira.whamcloud.com/browse/LU-12756 Lustre-commit: 80edb2ad72ba ("LU-12756 lnet: Refactor lnet_find_best_lpni_on_net") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/36534 Reviewed-by: Alexandr Boyko Reviewed-by: Alexey Lyashkov Reviewed-by: Amir Shehata Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/lnet/lib-move.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c index 73f9d20..c8266f0 100644 --- a/net/lnet/lnet/lib-move.c +++ b/net/lnet/lnet/lib-move.c @@ -1247,8 +1247,8 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, /* Prerequisite: the best_ni should already be set in the sd */ static inline struct lnet_peer_ni * -lnet_find_best_lpni_on_net(struct lnet_send_data *sd, struct lnet_peer *peer, - u32 net_id) +lnet_find_best_lpni_on_net(struct lnet_ni *lni, lnet_nid_t dst_nid, + struct lnet_peer *peer, u32 net_id) { struct lnet_peer_net *peer_net; @@ -1264,8 +1264,7 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, return NULL; } - return lnet_select_peer_ni(sd->sd_best_ni, sd->sd_dst_nid, - peer, peer_net); + return lnet_select_peer_ni(lni, dst_nid, peer, peer_net); } static int @@ -1278,13 +1277,12 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, struct lnet_peer *lp2 = r2->lr_gateway; struct lnet_peer_ni *lpni1; struct lnet_peer_ni *lpni2; - struct lnet_send_data sd; int rc; - sd.sd_best_ni = NULL; - sd.sd_dst_nid = LNET_NID_ANY; - lpni1 = lnet_find_best_lpni_on_net(&sd, lp1, r1->lr_lnet); - lpni2 = lnet_find_best_lpni_on_net(&sd, lp2, r2->lr_lnet); + lpni1 = lnet_find_best_lpni_on_net(NULL, LNET_NID_ANY, lp1, + r1->lr_lnet); + lpni2 = lnet_find_best_lpni_on_net(NULL, LNET_NID_ANY, lp2, + r2->lr_lnet); LASSERT(lpni1 && lpni2); if (r1->lr_priority < r2->lr_priority) { @@ -1878,7 +1876,9 @@ struct lnet_ni * return -EHOSTUNREACH; } - sd->sd_best_lpni = lnet_find_best_lpni_on_net(sd, lp, + sd->sd_best_lpni = lnet_find_best_lpni_on_net(sd->sd_best_ni, + sd->sd_dst_nid, + lp, best_lpn->lpn_net_id); if (!sd->sd_best_lpni) { CERROR("peer %s down\n", @@ -2191,7 +2191,8 @@ struct lnet_ni * lnet_msg_discovery(sd->sd_msg)); if (sd->sd_best_ni) { sd->sd_best_lpni = - lnet_find_best_lpni_on_net(sd, sd->sd_peer, + lnet_find_best_lpni_on_net(sd->sd_best_ni, sd->sd_dst_nid, + sd->sd_peer, sd->sd_best_ni->ni_net->net_id); /* if we're successful in selecting a peer_ni on the local