From: John Garry <john.garry@huawei.com>
To: Christoph Hellwig <hch@lst.de>, Qian Cai <cai@gmx.us>
Cc: <robin.murphy@arm.com>, <linux-kernel@vger.kernel.org>,
<iommu@lists.linux-foundation.org>, <netdev@vger.kernel.org>,
<yisen.zhuang@huawei.com>, Linuxarm <linuxarm@huawei.com>
Subject: Re: [PATCH] dma-debug: hns_enet_drv could use more DMA entries
Date: Fri, 30 Nov 2018 09:16:12 +0000 [thread overview]
Message-ID: <23da2426-a397-a33c-cfd8-dba7b3c1aaee@huawei.com> (raw)
In-Reply-To: <20181130084203.GA19812@lst.de>
+
Pasting original message at bottom.
On 30/11/2018 08:42, Christoph Hellwig wrote:
> On Thu, Nov 29, 2018 at 10:54:56PM -0500, Qian Cai wrote:
>> /* allow architectures to override this if absolutely required */
>> #ifndef PREALLOC_DMA_DEBUG_ENTRIES
>> +/* amount of DMA mappings on this driver is huge. */
>> +#ifdef HNS_ENET
>> +#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 17)
>> +#else
>> #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
>> #endif
>> +#endif
>
> How would this be defined in a header that leaks into this file?
>
> I think we need to turn PREALLOC_DMA_DEBUG_ENTRIES into a user
> selectable config options, as I really don't want to collect hacks like
> this.
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
>
>
The amount of DMA mappings from Hisilicon HNS ethernet devices is huge,
so it could trigger "DMA-API: debugging out of memory - disabling".
hnae_get_handle [1]
hnae_init_queue
hnae_init_ring
hnae_alloc_buffers [2]
debug_dma_map_page
dma_entry_alloc
[1] for (i = 0; i < handle->q_num; i++)
[2] for (i = 0; i < ring->desc_num; i++)
On this Huawei TaiShan 2280 aarch64 server, it has reached the limit
already,
4 (ports) x 16 (handles) x 1024 (rings) = 65536
Signed-off-by: Qian Cai <cai@gmx.us>
---
kernel/dma/debug.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 231ca4628062..ae91689cc9ad 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -43,8 +43,13 @@
/* allow architectures to override this if absolutely required */
#ifndef PREALLOC_DMA_DEBUG_ENTRIES
+/* amount of DMA mappings on this driver is huge. */
+#ifdef HNS_ENET
+#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 17)
+#else
#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
#endif
+#endif
enum {
dma_debug_single,
next prev parent reply other threads:[~2018-11-30 9:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 3:54 Qian Cai
2018-11-30 8:42 ` Christoph Hellwig
2018-11-30 9:16 ` John Garry [this message]
2018-11-30 12:04 ` Robin Murphy
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=23da2426-a397-a33c-cfd8-dba7b3c1aaee@huawei.com \
--to=john.garry@huawei.com \
--cc=cai@gmx.us \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=yisen.zhuang@huawei.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
all inboxes | Powered by JetHome®