Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752301AbcDRN7i (ORCPT ); Mon, 18 Apr 2016 09:59:38 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40304 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694AbcDRN7h (ORCPT ); Mon, 18 Apr 2016 09:59:37 -0400 Date: Mon, 18 Apr 2016 06:59:36 -0700 From: Christoph Hellwig To: Sinan Kaya 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 Subject: Re: [PATCH V2] net: ethernet: mellanox: correct page conversion Message-ID: <20160418135936.GA25909@infradead.org> References: <1460845412-13120-1-git-send-email-okaya@codeaurora.org> <20160418121247.GA25387@infradead.org> <0c6a430c5f0ec64f51d7c594ef9751dd@codeaurora.org> <20160418131058.GA25421@infradead.org> <5714E5D6.7050600@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5714E5D6.7050600@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: 1367 Lines: 33 On Mon, Apr 18, 2016 at 09:49:10AM -0400, Sinan Kaya wrote: > Here is a good description of logical address vs. virtual address. > > https://www.quora.com/What-is-the-Kernel-logical-and-virtual-addresses-What-is-the-difference-between-them-What-is-the-type-of-addresses-listed-in-the-System-map That's not how we use the terms in Linux. But it's not really the point of my question either. > > Is this correct? > > > No, the driver is plain broken without this patch. It causes a kernel panic > during driver probe. > > This is the definition of vmap API. > > https://www.kernel.org/doc/htmldocs/kernel-api/API-vmap.html Thanks for the pointer, but I'm actually the person who introduced vmap to Linux a long time ago, and this is once again not my question. > You cannot take several virtually mapped addresses returned by dma_alloc_coherent > and try to make them virtually contiguous again. But now we're getting closer to the issue: the mlx4_en driver is using vmap on buffers allocated using dma_alloc_coherent if on a 64-bit architecture, and that's obviously broken. Now the big quetions is: why does it do that, given that dma_alloc_coherent can be used for high order allocations anyway (and in fact many architectures implement is using a version of vmap). Let's get some answers on these question from the Mellanox folks and work from there.