Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Anumula Murali Mohan Reddy <anumula@chelsio.com>,
	jgg@nvidia.com, linux-rdma@vger.kernel.org,
	Potnuri Bharat Teja <bharat@chelsio.com>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH for-next] RDMA/cxgb4: use dma_mmap_coherent() for mapping non-contiguous memory
Date: Sun, 7 Jul 2024 14:39:57 +0300	[thread overview]
Message-ID: <20240707113957.GJ6695@unreal> (raw)
In-Reply-To: <20240707113103.GA4441@lst.de>

On Sun, Jul 07, 2024 at 01:31:03PM +0200, Christoph Hellwig wrote:
> On Sun, Jul 07, 2024 at 12:11:05PM +0300, Leon Romanovsky wrote:
> > On Fri, Jul 05, 2024 at 06:47:53PM +0530, Anumula Murali Mohan Reddy wrote:
> > > dma_alloc_coherent() allocates contiguous memory irrespective of
> > > iommu mode, but after commit f5ff79fddf0e ("dma-mapping: remove
> > > CONFIG_DMA_REMAP") if iommu is enabled in translate mode,
> > > dma_alloc_coherent() may allocate non-contiguous memory.
> > > Attempt to map this memory results in panic.
> > > This patch fixes the issue by using dma_mmap_coherent() to map each page
> > > to user space.
> > 
> > It is perfect time to move to use rdma_user_mmap_io(), instead of
> > open-code it in the driver.
> 
> rdma_user_mmap_io does not work on dma coherent allocations.

They used dma_mmap_coherent() to implement workaround, original cxgb4
didn't use it and probably doesn't need too.

Thanks

  reply	other threads:[~2024-07-07 11:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 13:17 [PATCH for-next] RDMA/cxgb4: use dma_mmap_coherent() for mapping non-contiguous memory Anumula Murali Mohan Reddy
2024-07-06  0:16 ` Zhu Yanjun
2024-07-07  9:11 ` Leon Romanovsky
2024-07-07 11:31   ` Christoph Hellwig
2024-07-07 11:39     ` Leon Romanovsky [this message]
2024-07-08 10:05       ` Christoph Hellwig

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=20240707113957.GJ6695@unreal \
    --to=leon@kernel.org \
    --cc=anumula@chelsio.com \
    --cc=bharat@chelsio.com \
    --cc=hch@lst.de \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=robin.murphy@arm.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