netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma-debug: hns_enet_drv could use more DMA entries
@ 2018-11-30  3:54 Qian Cai
  2018-11-30  8:42 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Qian Cai @ 2018-11-30  3:54 UTC (permalink / raw)
  To: hch, m.szyprowski, robin.murphy
  Cc: yisen.zhuang, salil.mehta, iommu, netdev, linux-kernel, Qian Cai

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,
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-30 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-30  3:54 [PATCH] dma-debug: hns_enet_drv could use more DMA entries Qian Cai
2018-11-30  8:42 ` Christoph Hellwig
     [not found]   ` <20181130084203.GA19812-jcswGhMUV9g@public.gmane.org>
2018-11-30  9:16     ` John Garry
2018-11-30 12:04   ` Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).