netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: brouer@redhat.com, netdev@vger.kernel.org
Cc: tariqt@mellanox.com, davem@davemloft.net, toke@redhat.com,
	mcroce@redhat.com, Ilias Apalodimas <ilias.apalodimas@linaro.org>
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	[thread overview]
Message-ID: <1553784438-17503-1-git-send-email-ilias.apalodimas@linaro.org> (raw)

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 <ilias.apalodimas@linaro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
 include/net/page_pool.h | 5 +++++
 1 file changed, 5 insertions(+)

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
-- 
2.7.4


             reply	other threads:[~2019-03-28 14:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 14:47 Ilias Apalodimas [this message]
2019-03-28 14:47 ` [net-next, PATCH 2/2] net: page_pool: add helper funtion to unmap dma addresses Ilias Apalodimas
2019-03-29 18:14 ` [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1553784438-17503-1-git-send-email-ilias.apalodimas@linaro.org \
    --to=ilias.apalodimas@linaro.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=mcroce@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.com \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).