[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPoiz9yx8irYGsEdu8952-buX8iR6FEH1=XPrib93WFyEkvtKQ@mail.gmail.com>
Date: Sat, 4 Jun 2016 11:25:17 -0400
From: Jon Mason <jdmason@...zu.us>
To: "Jiang, Dave" <dave.jiang@...el.com>
Cc: "Allen.Hubbe@....com" <Allen.Hubbe@....com>,
"logang@...tatee.com" <logang@...tatee.com>,
"sudipm.mukherjee@...il.com" <sudipm.mukherjee@...il.com>,
"arnd@...db.de" <arnd@...db.de>,
"john.kading@...ms.com" <john.kading@...ms.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-ntb@...glegroups.com" <linux-ntb@...glegroups.com>
Subject: Re: [PATCH 1/3] ntb_perf: Allow limiting the size of the memory windows
On Fri, Jun 3, 2016 at 5:03 PM, Jiang, Dave <dave.jiang@...el.com> wrote:
> 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@...tatee.com>
> Acked-by: Dave Jiang <dave.jiang@...el.com>
Applied to my ntb-next branch
Thanks,
Jon
>> ---
>> 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
>>
Powered by blists - more mailing lists