linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@codeaurora.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-rdma@vger.kernel.org, timur@codeaurora.org,
	cov@codeaurora.org, Yishai Hadas <yishaih@mellanox.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] net: ethernet: mellanox: correct page conversion
Date: Tue, 19 Apr 2016 14:37:42 -0400	[thread overview]
Message-ID: <57167AF6.9090507@codeaurora.org> (raw)
In-Reply-To: <20160419182212.GA8441@infradead.org>

On 4/19/2016 2:22 PM, Christoph Hellwig wrote:
> What I think we need is something like the patch below.  In the long
> ru nwe should also kill the mlx4_buf structure which now is pretty
> pointless.

Maybe; this could be the correct approach if we can guarantee that the 
architecture can allocate the requested amount of memory with
dma_alloc_coherent. 

When I brought this issue a year ago, the objection was that my code
doesn't compile on intel (dma_to_phys) and also some arches run out of
DMA memory with existing customer base.

If there is a real need to maintain compatibility with the existing 
architectures due to limited amount of DMA memory, we need to correct this
code to make proper use of vmap via alloc_pages and also insert the 
dma_sync in proper places for DMA API conformance. 

Also, the tx descriptors always has to be allocated from a single DMA region
or the tx code needs to be corrected to support page_list.

If we can live with just using dma_alloc_coherent, your solution is
better. I was trying to put this support for 64bit arches only while
maintaining support for the existing code base.

> 
> ---
> From a493881d2a6c90152d3daabb7b6b3afd1d254d78 Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Tue, 19 Apr 2016 14:12:14 -0400
> Subject: mlx4_en: don't try to split and vmap dma coherent allocations
> 
> The memory returned by dma_alloc_coherent is not suitable for calling
> virt_to_page on it, as it might for example come from vmap allocator.
> 
> Remove the code that calls virt_to_page and vmap on dma coherent
> allocations from the mlx4 drivers, and replace them with a single
> high-order dma_alloc_coherent call.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reported-by: Sinan Kaya <okaya@codeaurora.org>


-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

  reply	other threads:[~2016-04-19 18:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16 22:23 [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya
2016-04-18  4:00 ` David Miller
2016-04-18  5:06   ` okaya
2016-04-18 15:59     ` David Miller
2016-04-18 16:06       ` Sinan Kaya
2016-04-18  6:54 ` Eli Cohen
2016-04-18 13:53   ` Sinan Kaya
2016-04-18 14:05     ` Eli Cohen
2016-04-18 14:32   ` Christoph Hellwig
2016-04-18 14:39     ` Eli Cohen
2016-04-18 15:17       ` Christoph Hellwig
2016-04-18 15:21         ` Sinan Kaya
2016-04-18 15:40           ` Christoph Hellwig
2016-04-18 17:47             ` Sinan Kaya
2016-04-19  7:50             ` Sinan Kaya
2016-04-18 12:12 ` Christoph Hellwig
2016-04-18 13:06   ` okaya
2016-04-18 13:10     ` Christoph Hellwig
2016-04-18 13:49       ` Sinan Kaya
2016-04-18 13:59         ` Christoph Hellwig
2016-04-18 15:15         ` Timur Tabi
2016-04-18 15:22           ` Sinan Kaya
2016-04-19 18:22 ` Christoph Hellwig
2016-04-19 18:37   ` Sinan Kaya [this message]
2016-04-20 11:08     ` Eran Ben Elisha
2016-04-20 13:35   ` Sinan Kaya
2016-04-20 13:38     ` Sinan Kaya
2016-04-20 13:41       ` Timur Tabi
2016-04-20 18:40     ` Eran Ben Elisha
2016-04-20 18:42       ` Sinan Kaya

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=57167AF6.9090507@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=cov@codeaurora.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=timur@codeaurora.org \
    --cc=yishaih@mellanox.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).