From: "Jiang, Dave" <dave.jiang@intel.com>
To: "Allen.Hubbe@emc.com" <Allen.Hubbe@emc.com>,
"logang@deltatee.com" <logang@deltatee.com>,
"jdmason@kudzu.us" <jdmason@kudzu.us>,
"sudipm.mukherjee@gmail.com" <sudipm.mukherjee@gmail.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"john.kading@gd-ms.com" <john.kading@gd-ms.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ntb@googlegroups.com" <linux-ntb@googlegroups.com>
Subject: Re: [PATCH 1/3] ntb_perf: Allow limiting the size of the memory windows
Date: Fri, 3 Jun 2016 21:03:50 +0000 [thread overview]
Message-ID: <1464987814.16234.148.camel@intel.com> (raw)
In-Reply-To: <9e9ca38bef468fc1dd3d135f5f3d3cfb6b61246d.1464986161.git.logang@deltatee.com>
On Fri, 2016-06-03 at 14:50 -0600, Logan Gunthorpe wrote:
> On my system, dma_alloc_coherent won't produce memory anywhere
> near the size of the BAR. So I needed a way to limit this.
>
> It's pretty much copied straight from ntb_transport.
>
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/ntb/test/ntb_perf.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/ntb/test/ntb_perf.c
> b/drivers/ntb/test/ntb_perf.c
> index 8dfce9c..30635c8 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -83,6 +83,10 @@ MODULE_DESCRIPTION(DRIVER_DESCRIPTION);
>
> static struct dentry *perf_debugfs_dir;
>
> +static unsigned long max_mw_size;
> +module_param(max_mw_size, ulong, 0644);
> +MODULE_PARM_DESC(max_mw_size, "Limit size of large memory windows");
> +
> static unsigned int seg_order = 19; /* 512K */
> module_param(seg_order, uint, 0644);
> MODULE_PARM_DESC(seg_order, "size order [n^2] of buffer segment for
> testing");
> @@ -472,6 +476,10 @@ static void perf_link_work(struct work_struct
> *work)
> dev_dbg(&perf->ntb->pdev->dev, "%s called\n", __func__);
>
> size = perf->mw.phys_size;
> +
> + if (max_mw_size && size > max_mw_size)
> + size = max_mw_size;
> +
> ntb_peer_spad_write(ndev, MW_SZ_HIGH, upper_32_bits(size));
> ntb_peer_spad_write(ndev, MW_SZ_LOW, lower_32_bits(size));
> ntb_peer_spad_write(ndev, VERSION, PERF_VERSION);
> --
> 2.1.4
>
next parent reply other threads:[~2016-06-03 21:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1464986161.git.logang@deltatee.com>
[not found] ` <9e9ca38bef468fc1dd3d135f5f3d3cfb6b61246d.1464986161.git.logang@deltatee.com>
2016-06-03 21:03 ` Jiang, Dave [this message]
2016-06-04 15:25 ` [PATCH 1/3] ntb_perf: Allow limiting the size of the memory windows Jon Mason
[not found] ` <a573b7044c8f38d28bdad9eb0ea7d2aaaedc7e19.1464986161.git.logang@deltatee.com>
2016-06-03 21:20 ` [PATCH 3/3] ntb_tool: Add memory window debug support Allen Hubbe
2016-06-04 15:25 ` Jon Mason
[not found] ` <efa91cd782ad223cc30eeeda8d2341cc11a8646d.1464986161.git.logang@deltatee.com>
2016-06-04 15:40 ` [PATCH 2/3] ntb_transport: Check the number of spads the hardware supports Jon Mason
2016-06-07 17:15 ` Logan Gunthorpe
[not found] ` <1465320022-4385-1-git-send-email-logang@deltatee.com>
2016-06-07 17:24 ` [PATCH v2 " Jiang, Dave
2016-06-09 14:51 ` Jon Mason
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=1464987814.16234.148.camel@intel.com \
--to=dave.jiang@intel.com \
--cc=Allen.Hubbe@emc.com \
--cc=arnd@arndb.de \
--cc=jdmason@kudzu.us \
--cc=john.kading@gd-ms.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.com \
--cc=logang@deltatee.com \
--cc=sudipm.mukherjee@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox