All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 21/25] lustre: lnet: set LND tunables properly
Date: Tue, 25 Sep 2018 22:48:13 -0400	[thread overview]
Message-ID: <1537930097-11624-22-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1537930097-11624-1-git-send-email-jsimmons@infradead.org>

From: Amir Shehata <ashehata@whamcloud.com>

Make sure to set all NIs to the proper LND tunables
specified.

Add ntx tunable to dynamic configuration. This way all
tunables required to tune OPA performance can be configured
via lnetctl, allowing the ability to tune OPA network and IB
network differently

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-9536
Reviewed-on: https://review.whamcloud.com/27263
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h  |  2 +-
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c        | 14 +++++++++-----
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c  |  4 +++-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h
index 07516fd..8f03aa3 100644
--- a/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h
+++ b/drivers/staging/lustre/include/uapi/linux/lnet/lnet-dlc.h
@@ -66,7 +66,7 @@ struct lnet_ioctl_config_o2iblnd_tunables {
 	__u32 lnd_fmr_flush_trigger;
 	__u32 lnd_fmr_cache;
 	__u16 lnd_conns_per_peer;
-	__u16 pad;
+	__u16 lnd_ntx;
 };
 
 struct lnet_lnd_tunables {
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 0ce9962..50c0c00 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2034,9 +2034,13 @@ static void kiblnd_destroy_tx_pool(struct kib_pool *pool)
 	kfree(tpo);
 }
 
-static int kiblnd_tx_pool_size(int ncpts)
+static int kiblnd_tx_pool_size(struct lnet_ni *ni, int ncpts)
 {
-	int ntx = *kiblnd_tunables.kib_ntx / ncpts;
+	struct lnet_ioctl_config_o2iblnd_tunables *tunables;
+	int ntx;
+
+	tunables = &ni->ni_lnd_tunables.lnd_tun_u.lnd_o2ib;
+	ntx = tunables->lnd_ntx / ncpts;
 
 	return max(IBLND_TX_POOL, ntx);
 }
@@ -2176,10 +2180,10 @@ static int kiblnd_net_init_pools(struct kib_net *net, struct lnet_ni *ni,
 
 	tunables = &ni->ni_lnd_tunables.lnd_tun_u.lnd_o2ib;
 
-	if (tunables->lnd_fmr_pool_size < *kiblnd_tunables.kib_ntx / 4) {
+	if (tunables->lnd_fmr_pool_size < tunables->lnd_ntx / 4) {
 		CERROR("Can't set fmr pool size (%d) < ntx / 4(%d)\n",
 		       tunables->lnd_fmr_pool_size,
-		       *kiblnd_tunables.kib_ntx / 4);
+		       tunables->lnd_ntx / 4);
 		rc = -EINVAL;
 		goto failed;
 	}
@@ -2237,7 +2241,7 @@ static int kiblnd_net_init_pools(struct kib_net *net, struct lnet_ni *ni,
 		cpt = !cpts ? i : cpts[i];
 		rc = kiblnd_init_poolset(&net->ibn_tx_ps[cpt]->tps_poolset,
 					 cpt, net, "TX",
-					 kiblnd_tx_pool_size(ncpts),
+					 kiblnd_tx_pool_size(ni, ncpts),
 					 kiblnd_create_tx_pool,
 					 kiblnd_destroy_tx_pool,
 					 kiblnd_tx_init, NULL);
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
index 3bb537e..0f2ad91 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c
@@ -157,7 +157,6 @@ struct kib_tunables kiblnd_tunables = {
 	.kib_cksum             = &cksum,
 	.kib_timeout           = &timeout,
 	.kib_keepalive         = &keepalive,
-	.kib_ntx               = &ntx,
 	.kib_default_ipif      = &ipif_name,
 	.kib_retry_count       = &retry_count,
 	.kib_rnr_retry_count   = &rnr_retry_count,
@@ -282,6 +281,8 @@ int kiblnd_tunables_setup(struct lnet_ni *ni)
 		tunables->lnd_fmr_flush_trigger = fmr_flush_trigger;
 	if (!tunables->lnd_fmr_cache)
 		tunables->lnd_fmr_cache = fmr_cache;
+	if (!tunables->lnd_ntx)
+		tunables->lnd_ntx = ntx;
 	if (!tunables->lnd_conns_per_peer) {
 		tunables->lnd_conns_per_peer = (conns_per_peer) ?
 			conns_per_peer : 1;
@@ -299,5 +300,6 @@ void kiblnd_tunables_init(void)
 	default_tunables.lnd_fmr_pool_size = fmr_pool_size;
 	default_tunables.lnd_fmr_flush_trigger = fmr_flush_trigger;
 	default_tunables.lnd_fmr_cache = fmr_cache;
+	default_tunables.lnd_ntx = ntx;
 	default_tunables.lnd_conns_per_peer = conns_per_peer;
 }
-- 
1.8.3.1

  parent reply	other threads:[~2018-09-26  2:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26  2:47 [lustre-devel] [PATCH 00/25] lustre: lnet: remaining fixes for multi-rail James Simmons
2018-09-26  2:47 ` [lustre-devel] [PATCH 01/25] lustre: lnet: remove ni from lnet_finalize James Simmons
2018-09-26 23:57   ` NeilBrown
2018-09-30  2:19     ` James Simmons
2018-10-02  4:24       ` NeilBrown
2018-09-26  2:47 ` [lustre-devel] [PATCH 02/25] lustre: lnet: Allow min stats to be reset in peers and nis James Simmons
2018-09-26 23:59   ` NeilBrown
2018-09-26  2:47 ` [lustre-devel] [PATCH 03/25] lustre: lnet: remove debug ioctl James Simmons
2018-09-26  2:47 ` [lustre-devel] [PATCH 04/25] lustre: lnet: Normalize ioctl interface James Simmons
2018-09-26  2:47 ` [lustre-devel] [PATCH 05/25] lustre: lnet: fix race in lnet shutdown path James Simmons
2018-09-27  0:03   ` NeilBrown
2018-09-27  1:14     ` NeilBrown
2018-09-26  2:47 ` [lustre-devel] [PATCH 06/25] lustre: lnet: loopback NID in lnet_select_pathway() James Simmons
2018-09-26  2:47 ` [lustre-devel] [PATCH 07/25] lustre: lnet: rename LNET_MAX_INTERFACES James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 08/25] lustre: lnet: selftest MR fix James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 09/25] lustre: lnet: prevent assert on ln_state James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 10/25] lustre: lnet: increment per NI stats James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 11/25] lustre: lnet: Fix lost lock James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 12/25] lustre: lnet: correct locking in legacy add net James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 13/25] lustre: lnet: fix lnet_cpt_of_md() James Simmons
2018-09-27  1:03   ` NeilBrown
2018-09-27  1:17     ` NeilBrown
2018-09-26  2:48 ` [lustre-devel] [PATCH 14/25] lustre: lnet: safe access to msg James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 15/25] lustre: o2iblnd: reconnect peer for REJ_INVALID_SERVICE_ID James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 16/25] lustre: o2iblnd: kill timedout txs from ibp_tx_queue James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 17/25] lustre: o2iblnd: multiple sges for work request James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 18/25] lustre: lnd: Turn on 2 sges by default James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 19/25] lustre: lnd: Don't Assert On Reconnect with MultiQP James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 20/25] lustre: lnet: handle empty CPTs James Simmons
2018-09-26  2:48 ` James Simmons [this message]
2018-09-26  2:48 ` [lustre-devel] [PATCH 22/25] lustre: lnd: Don't Page Align remote_addr with FastReg James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 23/25] lustre: lnd: pending transmits dropped silently James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 24/25] lustre: socklnd: propagate errors on send failure James Simmons
2018-09-26  2:48 ` [lustre-devel] [PATCH 25/25] lustre: ko2iblnd: allow for discontiguous fragments James Simmons
2018-09-27  1:19 ` [lustre-devel] [PATCH 00/25] lustre: lnet: remaining fixes for multi-rail NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537930097-11624-22-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.