Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382782

Re: [PATCH V2] net: ethernet: mellanox: correct page conversion

From Sinan Kaya <okaya@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2] net: ethernet: mellanox: correct page conversion
Date 2016-04-19 20:40 +0200
Message-ID <rpIJ3-2OR-9@gated-at.bofh.it> (permalink)
References <roGT0-2e3-15@gated-at.bofh.it> <rpIzp-2JB-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-17 00:30 +0200
  Re: [PATCH V2] net: ethernet: mellanox: correct page conversion David Miller <davem@davemloft.net> - 2016-04-18 06:10 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion okaya@codeaurora.org - 2016-04-18 07:10 +0200
      Re: [PATCH V2] net: ethernet: mellanox: correct page conversion David Miller <davem@davemloft.net> - 2016-04-18 18:00 +0200
        Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-18 18:10 +0200
  Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Eli Cohen <eli@mellanox.com> - 2016-04-18 09:00 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-18 16:00 +0200
      Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Eli Cohen <eli@mellanox.com> - 2016-04-18 16:30 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-18 16:40 +0200
      RE: [PATCH V2] net: ethernet: mellanox: correct page conversion Eli Cohen <eli@mellanox.com> - 2016-04-18 17:00 +0200
        Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-18 17:20 +0200
          Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-18 17:30 +0200
            Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-18 17:50 +0200
              Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-18 19:50 +0200
              Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-19 10:00 +0200
  Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-18 14:20 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion okaya@codeaurora.org - 2016-04-18 15:10 +0200
      Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-18 15:20 +0200
        Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-18 15:50 +0200
          Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-18 16:00 +0200
          Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Timur Tabi <timur@codeaurora.org> - 2016-04-18 17:20 +0200
            Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-18 17:30 +0200
  Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Christoph Hellwig <hch@infradead.org> - 2016-04-19 20:30 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-19 20:40 +0200
      Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Eran Ben Elisha <eranlinuxmellanox@gmail.com> - 2016-04-20 13:10 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-20 15:40 +0200
      Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Timur Tabi <timur@codeaurora.org> - 2016-04-20 15:50 +0200
    Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-20 15:40 +0200
      Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Eran Ben Elisha <eranlinuxmellanox@gmail.com> - 2016-04-20 20:50 +0200
        Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Sinan Kaya <okaya@codeaurora.org> - 2016-04-20 20:50 +0200

csiph-web