[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190605132009.10734-3-ivan.khoronzhuk@linaro.org>
Date: Wed, 5 Jun 2019 16:20:04 +0300
From: Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
To: grygorii.strashko@...com, hawk@...nel.org, davem@...emloft.net
Cc: ast@...nel.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org, xdp-newbies@...r.kernel.org,
ilias.apalodimas@...aro.org, netdev@...r.kernel.org,
daniel@...earbox.net, jakub.kicinski@...ronome.com,
john.fastabend@...il.com,
Jesper Dangaard Brouer <brouer@...hat.com>,
Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
Subject: [PATCH v3 net-next 2/7] net: page_pool: add helper function to unmap dma addresses
From: Ilias Apalodimas <ilias.apalodimas@...aro.org>
On a previous patch dma addr was stored in 'struct page'.
Use that to unmap DMA addresses used by network drivers
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@...aro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
---
include/net/page_pool.h | 1 +
net/core/page_pool.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index b885d86cb7a1..ad218cef88c5 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -110,6 +110,7 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool)
struct page_pool *page_pool_create(const struct page_pool_params *params);
void page_pool_destroy(struct page_pool *pool);
+void page_pool_unmap_page(struct page_pool *pool, struct page *page);
/* Never call this directly, use helpers below */
void __page_pool_put_page(struct page_pool *pool,
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 5b2252c6d49b..205af7bd6d09 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -190,6 +190,13 @@ static void __page_pool_clean_page(struct page_pool *pool,
page->dma_addr = 0;
}
+/* unmap the page and clean our state */
+void page_pool_unmap_page(struct page_pool *pool, struct page *page)
+{
+ __page_pool_clean_page(pool, page);
+}
+EXPORT_SYMBOL(page_pool_unmap_page);
+
/* Return a page to the page allocator, cleaning up our state */
static void __page_pool_return_page(struct page_pool *pool, struct page *page)
{
--
2.17.1
Powered by blists - more mailing lists