Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752409AbcDRPlB (ORCPT ); Mon, 18 Apr 2016 11:41:01 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48508 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751851AbcDRPk7 (ORCPT ); Mon, 18 Apr 2016 11:40:59 -0400 Date: Mon, 18 Apr 2016 08:40:58 -0700 From: Christoph Hellwig To: Sinan Kaya Cc: Christoph Hellwig , Eli Cohen , "linux-rdma@vger.kernel.org" , "timur@codeaurora.org" , "cov@codeaurora.org" , Yishai Hadas , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Message-ID: <20160418154058.GA4228@infradead.org> References: <1460845412-13120-1-git-send-email-okaya@codeaurora.org> <20160418065447.GA11539@x-vnc01.mtx.labs.mlnx> <20160418143255.GA15203@infradead.org> <20160418151702.GA26565@infradead.org> <5714FB68.3020604@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5714FB68.3020604@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 768 Lines: 18 On Mon, Apr 18, 2016 at 11:21:12AM -0400, Sinan Kaya wrote: > I was looking at the code. I don't see how removing virt_to_page + vmap > would solve the issue. > > The code is trying to access the buffer space with direct.buf member > from the CPU side. This member would become NULL, when this code is > removed and also in mlx4_en_map_buffer. > > ... > > What am I missing? As mentioned before you'll also need to enforce you hit the nbufs = 1 case for these. In fact most callers should simply switch to a plain dma_zalloc_coherent call without all these wrappers. If we have a case where we really want multiple buffers that don't have to be contiguous (maybe the MTT case) I'd rather opencode that instead of building this confusing interface on top of it.