From: Ratheesh Kannoth <rkannoth@marvell.com>
To: <davem@davemloft.net>, <gakula@marvell.com>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<sgoutham@marvell.com>
Cc: <andrew+netdev@lunn.ch>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>
Subject: Re: [PATCH v3 net] octeontx2-af: allocate qmem from page allocator to avoid CMA
Date: Mon, 31 Aug 2026 08:08:33 +0530 [thread overview]
Message-ID: <apTpKcN_S1xIwRbZ@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20260827070554.3919891-1-rkannoth@marvell.com>
On 2026-08-27 at 12:35:53, Ratheesh Kannoth (rkannoth@marvell.com) wrote:
> qmem_alloc() uses dma_alloc_attrs() with DMA_ATTR_FORCE_CONTIGUOUS for
> physically contiguous DMA memory (e.g. CN10K LMTST regions spanning page
> boundaries). With CMA enabled, those allocations are drawn from the CMA
> pool. qmem backs NIX/NPA queue contexts, admin queues, and LMTST regions,
> so total usage scales with enabled interfaces and is hard to provision in
> CMA.
>
> Add otx2_dma_alloc_coherent() and otx2_dma_free_coherent() helpers that
> allocate compound pages from the buddy allocator via __get_free_pages()
> with __GFP_COMP, __GFP_ZERO, and __GFP_RECLAIM (qmem_alloc() runs in
> GFP_KERNEL context), select DMA-reachable memory with dma_coherent_ok()
> (retrying with GFP_DMA32), and map the contiguous physical range for DMA
> through dma_map_phys() and dma_unmap_phys() with DMA_ATTR_REQUIRE_COHERENT
> so SMMU/IOMMU page table entries are installed on IOMMU-backed platforms.
> Switch qmem_alloc() and qmem_free() to these helpers instead of
> dma_alloc_attrs()/dma_free_attrs() with DMA_ATTR_FORCE_CONTIGUOUS.
>
Will address compilation issues in v4.
pw-bot: changes-requested
next prev parent reply other threads:[~2026-08-31 2:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 7:05 [PATCH v3 net] octeontx2-af: allocate qmem from page allocator to avoid CMA Ratheesh Kannoth
2026-08-31 2:38 ` Ratheesh Kannoth [this message]
2026-09-03 3:18 ` kernel test robot
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=apTpKcN_S1xIwRbZ@rkannoth-OptiPlex-7090 \
--to=rkannoth@marvell.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sgoutham@marvell.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