From patchwork Thu Mar 28 14:47:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 161318 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp805983jan; Thu, 28 Mar 2019 07:47:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7oa6vV6coChlov/hIGPcr7DREyAoawiQu7CRvy5ayeGdCG9mejUFgOThwyVpniMZz4llR X-Received: by 2002:a62:3585:: with SMTP id c127mr40938579pfa.71.1553784445539; Thu, 28 Mar 2019 07:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553784445; cv=none; d=google.com; s=arc-20160816; b=tKxUrCrolup2uUXW2RyMYMmzvF3uU2fwYs9cRXVwNGFe56AFyMwZtvcqUkjNBmVtLF sp2ru1DoS61ci410Z9LP8lSRzeD0DMmBf9FSbZX330S28y3G2GYQ1M+wPCRm/Shhu/Il SNEU5IycCyQEV9vOjPhRL105anvrcYN9BUe34F0rfJ12vDwaVUsfxNT8ZKNYUivwn3YW /lfpCoiLgpQc3Jvr/oD7HEADV+YHJjuCatG4ehWvSPqUouhnto1pi78ymfZj/fjRrTPq zQ8h/2yUlENCDw/e38GHzuKYjr4e0P8PIlqvBt5hJ1S+TzIxuoZcx568EjZU6f6NcV9/ gt3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=HWZ+8t0RXb66eJXzmJXGu8ooK4qVIsnGjH9596so8Ec=; b=qxVOvpuKXDCBQg8XORsuDHcHcOu0oB0sN9nTkfOxbAyyuVfO+mzZDryCz2WY0wtR+V j86zs89CMH5WfhVCGusxJm/pVgq6MiJYuBsKFbOZU40aC5qaad7GdxEkihKSa9YNPssj JvQAgfuzcuC27wmWsQ5JHnijAHooU5lEKY0BUgBL9ndpBfZX9Kn7XXcE+kBCTrWX6NTR Ca4LoM3G8EwhWr+uBWye2eAWCHMLLEPl1dPA5V8I8rG7V0zOxUNlIWT7IoNKVzq/ajza Vdw1vXw5gOnPeIvhCRnrEDhMuldcUziTXy4apR/nUrjaoIrslWI2sBkWN/twDTqUOL1R v0Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pmQAbqYd; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a40si22993177pla.234.2019.03.28.07.47.25; Thu, 28 Mar 2019 07:47:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pmQAbqYd; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbfC1OrY (ORCPT + 9 others); Thu, 28 Mar 2019 10:47:24 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:33539 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbfC1OrY (ORCPT ); Thu, 28 Mar 2019 10:47:24 -0400 Received: by mail-wm1-f65.google.com with SMTP id z6so7470186wmi.0 for ; Thu, 28 Mar 2019 07:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=HWZ+8t0RXb66eJXzmJXGu8ooK4qVIsnGjH9596so8Ec=; b=pmQAbqYd8pntk9Ip91KxLi3nFRH0gUuA/fg020NB0g8owoGwr/9aie92WqZ9Hkp+wE HOPN94Z1sIAACnvMqaJ+y1kPx3E15PMxpxPLjDwz9lKwgp1cNPKmlO0U2Cjv9nIdg46N t4pi8VQLB3BilR22Le6kxxLSoWozXNZdnTtyfzVPW6yiTVGGFEUc6kKTSYcAZBQo51Uc Oy/gy72valr2YMPTanZz4ESJC1cnsOSZdxRkSpkMm7SLFWbR826ZdT2rYHjzd7pi2A8m U4rkv14hMKJToBkB7oEBh26iAdOXYCky2LBdOTD2Up3V5qUxyqTxjkhYpoVbBkobQR8q lEmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HWZ+8t0RXb66eJXzmJXGu8ooK4qVIsnGjH9596so8Ec=; b=peImXWJB84lBc6DzVxdwX7uslesZDCNt4hOO/N8gGRIAIWerL1a4QGopMJx4zHAKU/ ZO0GBXaE5R82n6Ezj13RmDXbqBy88t4O8f/AVBHyB+gfy8NHgi4f1Ep7YyhoySE7FZP7 3a7WeRCCxDJiuZrH8FO8AO7BPjspuQwGcehSLGQpXoulD5np0pFDLhBmqX3rd+MwyCvj aYngtmhSZBrXXvgAkPUCMaOJvfb+IeUi85U4XZ+jEk5kk0KqFkDCZBiyAuaz+gnx0X1/ t1eV74PMG3LPbabeMn/2XI6vvduKNdYOk+8gjWxE4YYGyMxnA15M9xuEyDs2EjdKsqSz ozMw== X-Gm-Message-State: APjAAAUu9/4tU8zCbeTDjc42gk1vhLWFT/W0G56CiKeX93362wzCbTDE zpQgVjgbysMTDCi67jOYrb82Tw== X-Received: by 2002:a1c:1d4:: with SMTP id 203mr234354wmb.101.1553784442270; Thu, 28 Mar 2019 07:47:22 -0700 (PDT) Received: from apalos.lan (ppp-94-64-206-130.home.otenet.gr. [94.64.206.130]) by smtp.gmail.com with ESMTPSA id v184sm5680854wma.6.2019.03.28.07.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Mar 2019 07:47:21 -0700 (PDT) From: Ilias Apalodimas To: brouer@redhat.com, netdev@vger.kernel.org Cc: tariqt@mellanox.com, davem@davemloft.net, toke@redhat.com, mcroce@redhat.com, Ilias Apalodimas Subject: [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses Date: Thu, 28 Mar 2019 16:47:17 +0200 Message-Id: <1553784438-17503-1-git-send-email-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The page_pool API has no users for it's DMA capabilities yet. Retrieving DMA addresses used by network drivers will be needed for real users. commit 1567b85eb8ad ("net: page_pool: don't use page->private to store dma_addr_t") uses 'struct page' to store the addresses. This patch provides a helper for retrieving them. Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer --- include/net/page_pool.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/include/net/page_pool.h b/include/net/page_pool.h index 694d055..b885d86 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -132,6 +132,11 @@ static inline void page_pool_recycle_direct(struct page_pool *pool, __page_pool_put_page(pool, page, true); } +static inline dma_addr_t page_pool_get_dma_addr(struct page *page) +{ + return page->dma_addr; +} + static inline bool is_page_pool_compiled_in(void) { #ifdef CONFIG_PAGE_POOL