Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754759AbcDTNit (ORCPT ); Wed, 20 Apr 2016 09:38:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49959 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752281AbcDTNis (ORCPT ); Wed, 20 Apr 2016 09:38:48 -0400 Subject: Re: [PATCH V2] net: ethernet: mellanox: correct page conversion To: eranlinuxmellanox@gmail.com References: <1460845412-13120-1-git-send-email-okaya@codeaurora.org> <20160419182212.GA8441@infradead.org> <571785A5.5040306@codeaurora.org> Cc: Christoph Hellwig , linux-rdma@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, Yishai Hadas , netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Sinan Kaya Message-ID: <57178663.4050503@codeaurora.org> Date: Wed, 20 Apr 2016 09:38:43 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <571785A5.5040306@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1550 Lines: 48 Apologies, Replied to an older post by mistake. I was trying to reply to Eran. >Hi Sinan, > >We are working in Mellanox for a solution which >removes the vmap call and allocate contiguous memory (using dma_alloc_coherent). > >Thanks, >Eran > > >On 4/20/2016 9:35 AM, Sinan Kaya wrote: > 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. >> > It is been 1.5 years since I reported the problem. We came up with three different solutions this week. I'd like to see a version of the solution to get merged until Mellanox comes up with a better solution with another patch. My proposal is to use this one. > > -- a/drivers/net/ethernet/mellanox/mlx4/alloc.c > +++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c > @@ -588,7 +588,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, > { > dma_addr_t t; > > - if (size <= max_direct) { > + if ((size <= max_direct) || (BITS_PER_LONG == 64)){ > buf->nbufs = 1; > buf->npages = 1; > buf->page_shift = get_order(size) + PAGE_SHIFT; > > Of course, this is assuming that you are not ready to submit your patch yet. If you > are, feel free to post. > -- 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