linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Leon Romanovsky <leon@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	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: Mon, 8 Jul 2024 12:05:55 +0200	[thread overview]
Message-ID: <20240708100555.GA24094@lst.de> (raw)
In-Reply-To: <20240707113957.GJ6695@unreal>

On Sun, Jul 07, 2024 at 02:39:57PM +0300, Leon Romanovsky wrote:
> > > 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.

dma_mmap_coherent must be paired with dma_alloc_coherent.
It seems like cxgb4 uses a c4iw_mm_entry as a sort of generic
containers for objects that can be mmaped which are used on first come,
first serve bassis in c4iw_mmap (WTF???).  Not questioning the sanity
of the higher level logic here, which is ABI by now, the right fix
is to tag each entry with what is being mmaped, DMA_ALLOC, vs
uncached ba vs WC bar and remove the guessing logic there.

While we're it, pgprot_writecombine is generally available,
t4_pgprot_wc should go away aswell.

      reply	other threads:[~2024-07-08 10:06 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
2024-07-08 10:05       ` Christoph Hellwig [this message]

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=20240708100555.GA24094@lst.de \
    --to=hch@lst.de \
    --cc=anumula@chelsio.com \
    --cc=bharat@chelsio.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).