From patchwork Mon Feb 11 16:06:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 1039919 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43yrJY3bqVz9s5c for ; Tue, 12 Feb 2019 03:06:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729922AbfBKQGw (ORCPT ); Mon, 11 Feb 2019 11:06:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729657AbfBKQGu (ORCPT ); Mon, 11 Feb 2019 11:06:50 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 766807F6C8; Mon, 11 Feb 2019 16:06:49 +0000 (UTC) Received: from firesoul.localdomain (ovpn-200-20.brq.redhat.com [10.40.200.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0023D1850E; Mon, 11 Feb 2019 16:06:42 +0000 (UTC) Received: from [10.1.2.1] (localhost [IPv6:::1]) by firesoul.localdomain (Postfix) with ESMTP id CD12330C2C6B3; Mon, 11 Feb 2019 17:06:41 +0100 (CET) Subject: [net-next PATCH 0/2] Fix page_pool API and dma address storage From: Jesper Dangaard Brouer To: netdev@vger.kernel.org, linux-mm@kvack.org Cc: Toke =?utf-8?q?H=C3=B8iland-J=C3=B8rgensen?= , Ilias Apalodimas , willy@infradead.org, Saeed Mahameed , Jesper Dangaard Brouer , Andrew Morton , mgorman@techsingularity.net, "David S. Miller" , Tariq Toukan Date: Mon, 11 Feb 2019 17:06:41 +0100 Message-ID: <154990116432.24530.10541030990995303432.stgit@firesoul> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 11 Feb 2019 16:06:49 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org As pointed out by David Miller in [1] the current page_pool implementation stores dma_addr_t in page->private. This won't work on 32-bit platforms with 64-bit DMA addresses since the page->private is an unsigned long and the dma_addr_t a u64. Since no driver is yet using the DMA mapping capabilities of the API let's fix this by storing the information in 'struct page' and use that to store and retrieve DMA addresses from network drivers. As long as the addresses returned from dma_map_page() are aligned the first bit, used by the compound pages code should not be set. Ilias tested this on Espressobin driver mvneta, for which we have patches for using the DMA API of page_pool. [1]: https://lore.kernel.org/netdev/20181207.230655.1261252486319967024.davem@davemloft.net/ Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Ilias Apalodimas --- Question: Who of the maintainers MM or netdev will take these changes? --- Ilias Apalodimas (1): net: page_pool: don't use page->private to store dma_addr_t Jesper Dangaard Brouer (1): mm: add dma_addr_t to struct page include/linux/mm_types.h | 8 ++++++++ net/core/page_pool.c | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) --