From patchwork Thu Feb 27 21:16:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410663 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 4862D138D for ; Thu, 27 Feb 2020 21:43: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 30A0024690 for ; Thu, 27 Feb 2020 21:43:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30A0024690 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 CEA9F3492E9; Thu, 27 Feb 2020 13:35:11 -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 CB707348904 for ; Thu, 27 Feb 2020 13:21:05 -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 8F8E091B3; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 8DF4046A; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:16:45 -0500 Message-Id: <1582838290-17243-538-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 537/622] lnet: Optimize check for routing feature flag 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 Check the routing feature flag outside of the loop. Cray-bug-id: LUS-7862 WC-bug-id: https://jira.whamcloud.com/browse/LU-12942 Lustre-commit: 7a99dc0b2f27 ("LU-12942 lnet: Optimize check for routing feature flag") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/36679 Reviewed-by: Alexandr Boyko Reviewed-by: Alexey Lyashkov Reviewed-by: Neil Brown Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin Reviewed-by: James Simmons Signed-off-by: James Simmons --- net/lnet/lnet/router.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c index 447706d..41d0eb0 100644 --- a/net/lnet/lnet/router.c +++ b/net/lnet/lnet/router.c @@ -325,12 +325,14 @@ bool lnet_is_route_alive(struct lnet_route *route) spin_unlock(&lp->lp_lock); - if (lp_state & LNET_PEER_PING_FAILED) { - CDEBUG(D_NET, - "Ping failed with %d. Set routes down for gw %s\n", - lp->lp_ping_error, libcfs_nid2str(lp->lp_primary_nid)); - /* If the ping failed then mark the routes served by this - * peer down + if (lp_state & LNET_PEER_PING_FAILED || + pbuf->pb_info.pi_features & LNET_PING_FEAT_RTE_DISABLED) { + CDEBUG(D_NET, "Set routes down for gw %s because %s %d\n", + libcfs_nid2str(lp->lp_primary_nid), + lp_state & LNET_PEER_PING_FAILED ? "ping failed" : + "route feature is disabled", lp->lp_ping_error); + /* If the ping failed or the peer has routing disabled then + * mark the routes served by this peer down */ list_for_each_entry(route, &lp->lp_routes, lr_gwlist) lnet_set_route_aliveness(route, false); @@ -359,13 +361,6 @@ bool lnet_is_route_alive(struct lnet_route *route) route->lr_gateway->lp_primary_nid) continue; - /* gateway has the routing feature disabled */ - if (pbuf->pb_info.pi_features & - LNET_PING_FEAT_RTE_DISABLED) { - lnet_set_route_aliveness(route, false); - continue; - } - llpn = lnet_peer_get_net_locked(lp, route->lr_lnet); if (!llpn) { lnet_set_route_aliveness(route, false);