lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Mar 2019 16:47:18 +0200
From:   Ilias Apalodimas <ilias.apalodimas@...aro.org>
To:     brouer@...hat.com, netdev@...r.kernel.org
Cc:     tariqt@...lanox.com, davem@...emloft.net, toke@...hat.com,
        mcroce@...hat.com, Ilias Apalodimas <ilias.apalodimas@...aro.org>
Subject: [net-next, PATCH 2/2] net: page_pool: add helper funtion to unmap dma addresses

The page_pool API has no users for it's DMA capabilities yet.
Unmapping 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 unmapping them.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@...aro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
---
 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 b885d86..ad218ce 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 897a69a..83b4ba2 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -189,6 +189,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.7.4

Powered by blists - more mailing lists