From patchwork Wed Jun 3 00:59:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11584759 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 90389912 for ; Wed, 3 Jun 2020 01:01:02 +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 786C32072F for ; Wed, 3 Jun 2020 01:01:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 786C32072F 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 1E4AF21FC8E; Tue, 2 Jun 2020 18:00:34 -0700 (PDT) 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 C07F421F714 for ; Tue, 2 Jun 2020 18:00:10 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 8BE406BF; Tue, 2 Jun 2020 21:00:02 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 8AC2D2C6; Tue, 2 Jun 2020 21:00:02 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Tue, 2 Jun 2020 20:59:57 -0400 Message-Id: <1591146001-27171-19-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591146001-27171-1-git-send-email-jsimmons@infradead.org> References: <1591146001-27171-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 18/22] lnet: lnd: Allow independent ko2iblnd timeout 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 Allow ko2iblnd timeout parameter to be set independent of the lnet_transaction_timeout and retry_count. WC-bug-id: https://jira.whamcloud.com/browse/LU-13510 Lustre-commit: 0c038ee2f613e ("LU-13510 lnd: Allow independent ko2iblnd timeout") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/38459 Reviewed-by: Serguei Smirnov Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/klnds/o2iblnd/o2iblnd.h | 6 ++++++ net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 10 +++++----- net/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.h b/net/lnet/klnds/o2iblnd/o2iblnd.h index 8aa79d5..f60a69d 100644 --- a/net/lnet/klnds/o2iblnd/o2iblnd.h +++ b/net/lnet/klnds/o2iblnd/o2iblnd.h @@ -642,6 +642,12 @@ struct kib_peer_ni { int kiblnd_msg_queue_size(int version, struct lnet_ni *ni); +static inline int kiblnd_timeout(void) +{ + return *kiblnd_tunables.kib_timeout ? *kiblnd_tunables.kib_timeout : + lnet_get_lnd_timeout(); +} + static inline int kiblnd_concurrent_sends(int version, struct lnet_ni *ni) { diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c index f7c802f..09a46d6 100644 --- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -1160,7 +1160,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx, return; } - timeout_ns = lnet_get_lnd_timeout() * NSEC_PER_SEC; + timeout_ns = kiblnd_timeout() * NSEC_PER_SEC; tx->tx_queued = 1; tx->tx_deadline = ktime_add_ns(ktime_get(), timeout_ns); @@ -1289,12 +1289,12 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid, if (*kiblnd_tunables.kib_use_priv_port) { rc = kiblnd_resolve_addr(cmid, &srcaddr, &dstaddr, - lnet_get_lnd_timeout() * 1000); + kiblnd_timeout() * 1000); } else { rc = rdma_resolve_addr(cmid, (struct sockaddr *)&srcaddr, (struct sockaddr *)&dstaddr, - lnet_get_lnd_timeout() * 1000); + kiblnd_timeout() * 1000); } if (rc != 0) { /* Can't initiate address resolution: */ @@ -3021,7 +3021,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid, rc = event->status; } else { rc = rdma_resolve_route(cmid, - lnet_get_lnd_timeout() * 1000); + kiblnd_timeout() * 1000); if (!rc) { struct kib_net *net = peer_ni->ibp_ni->ni_data; struct kib_dev *dev = net->ibn_dev; @@ -3437,7 +3437,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid, * interval. */ - lnd_timeout = lnet_get_lnd_timeout(); + lnd_timeout = kiblnd_timeout(); if (lnd_timeout > n * p) chunk = (chunk * n * p) / lnd_timeout; if (!chunk) diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c index c9e14ec..7407ced 100644 --- a/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c +++ b/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c @@ -45,7 +45,7 @@ module_param(cksum, int, 0644); MODULE_PARM_DESC(cksum, "set non-zero to enable message (not RDMA) checksums"); -static int timeout = 50; +static int timeout; module_param(timeout, int, 0644); MODULE_PARM_DESC(timeout, "timeout (seconds)");